Zahoor Ahmad

 

Home

AIOU

MIU

IMCB H9

Contact

 

Data Analysis and Statistical Packages (1569)

Assignment # 2:

   

1

a)

What are minitab macros? Discuss its types.

 

b)

Write a minitab macro to simulate tossing of a die 2000 times. Find the proportion of even numbers appeared.

 

 

 

2

a)

Write a minitab macro to find mean deviation of values given in any column of worksheet.

 

b)

Write a Minitab macro to draw a systematic random sample of size n from a population of size N. Population may be stored in a column on Minitab worksheet

 

 

3

a)

Suppose you have data of 9876 students who have appeared in an entry test examination for admission to M.Sc. Statistics. Data is available in a column of the worksheet. Write a Minitab macro which calculates the percentile to the marks of a given student.

 

b)

Compare and contrast the coding methods available in SPSS and Minitab.

 

 

4

a)

Define p-value approach in testing of hypothesis. How will you calculate p-value for a z-test. Account for problems in calculation of p-value for t-test and F-test without using statistical software. Write down command in R and Minitab to get p-value for a given value of 't' and 'F' test statistic.

 

b)

Compare and contrast the methods of testing hypothesis of single , two or more than two mean available in R and Minitab.

 

 

 

5

a)

What do you know about functions in R. Explain arithmetic operators available in R.

 

b)

Create a function in R, that will calculate the number of divisors of any integer given by the user. It also displays all the divisors.

 

 

 

6

a)

Write a function in R to calculate number of combinations. Values of n and r are provided by the user.

 

 

 

 

b)

Create a function in R to find that how many times an integer appears in a given vector.

 

 

 

7

a)

Write a function in R to print the following pattern using any loop statement

1   2   3   4   5

1   2   3   4

1   2   3

1   2

1

 

 

b)

Implement a fizzbuzz function. It takes a single number as input. If the number is divisible by three, it returns "fizz". If it's divisible by five it returns "buzz". If it's divisible by three and five, it returns "fizzbuzz". Otherwise, it returns the number.

 

 

 

8

a)

Write a function that calculates the geometric mean of a vector x = (x1, . . . , xn) and returns an error message if any element of x is negative.

 

b)

Write a function that calculates the complete binomial probability distribution for given values of the parameters 'n' and 'p'.

   

 

If you find any advertisement showing some indecent material please report its web address (URL) on contact page. It will help us to block such websites to show their ads in future. Sorry for inconvenience.