Recently Published
STAT 432 Statistical Computer Packages and Their Applications: SAS and R - Project 4
Instructions:
Conduct a short study on the performance of the 1 sample t-test under the following settings
1) Ho: mu=20 Ha: mu<>20 n=30
True distribution is normal with mean=20, sd=3
2) Ho: mu=20 Ha: mu<>20 n=10
True distribution is normal with mean=20, sd=3
3) Ho: mu=20 Ha: mu<>20 n=30
True distribution is exponential with parameter lamda=1/20 (mean=20)
4) Ho: mu=20 Ha: mu<>20 n=10
True distribution is exponential with parameter lamda=1/20 (mean=20)
STAT 432 Statistical Computer Packages and Their Applications - Project 3
Project performing the following tasks:
1) Construct a function called conv1 which inputs a measurement in centimeters and outputs the corresponding measurement in inches.
2) Construct a function called conv2 which inputs a measurement in centimeters and outputs the corresponding measurements in inches, feet, and meters
3) Construct a function called conv3 which inputs a measurement in centimeters and outputs the corresponding measurement in inches. However, if a negative value is entered as an input, no conversion of unit is done and an error message is printed instead.
4) Construct a function called mat1 that inputs a square matrix and outputs the following as a list
a. Sum of the elements of the matrix
b. Product of the matrix and its transpose (use the t function)
c. Inverse of the matrix in (b.) (use the solve function)
5) Construct a function called mat2 that does the same as mat1 except that it first checks if the input is a matrix and outputs an error message (and nothing else) if it is not a matrix
6) Import Project1data.xls (the file used in Project 1 and 2) as a dataset in R with the name dataset1
7) Compute the mean, median, and standard deviation of variables BMI, Age, and Exercise_minutes_a_day
8) Create a new vector named OW with the same length as the number of rows of dataset1. The element of the vector is 1 if BMI of the corresponding respondent in dataset1 is >=24 and 0 otherwise.
9) Create a new dataset2 which combines OW as a new vector of dataset1
10) Generate a random sample of 100 datapoints from a normal distribution with mean=20 and standard deviation=5. Use seed=1, Save this as a object named group1.
11) Generate a random sample of 100 datapoints from a normal distribution with mean=25 and standard deviation=5. Use seed=1, Save this as a object named group2.
12) Construct histograms of group1 and group2. Place them on the same graph. Give each histogram a different color and change the transparency so that both are visible
13) Construct histograms for group1 and group2. This time, place them on the same panel but separate graphs
14) Construct a histogram for group1 and overlay it with the curve of the density function corresponding to the distribution that was used to generate the sample
15) Look for the t.test function in R and examine how to use it. Then, apply it to test if there is a difference between the means of group1 and group2.