In: Math
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. The following is a random sample of CT scores selected from 32 Miami students. 28, 27, 29, 27, 29, 31, 32, 30, 34, 30, 27, 25, 30, 32, 35, 32 23, 26, 27, 33, 33, 33, 31, 25, 28, 34, 30, 33, 28, 26, 30, 28 (a) Find the mean and standard deviation of this sample. Give the interpretation of the mean in the context. (b) Find the five numbers summary and provide the interpretation of the sample median in the context. (c) Draw the histogram of the data. What can you say about the distribution of the data. (d) Draw the Boxplot of the data. Is there any potential outlier? 2. The weekly amount spent for maintenance and repairs in a certain company has an approximately normal distribution, with a mean of $600 and a standard deviation of $40. If $700 is budgeted to cover repairs for next week, (a) what is the probability that the actual costs will exceed the budgeted amount? (b) how much should be budgeted weekly for maintenance and repairs to ensure that the probability that the budgeted amount will be exceeded in any given week is only 0.1?
Q1 Let X be the CT score of Miami students.
### By using R:
a) >
X=c(28,27,29,27,29,31,32,30,34,30,27,25,30,32,35,32,23,26,27,33,33,33,31,25,28,34,30,33,28,26,30,28)
> X
[1] 28 27 29 27 29 31 32 30 34 30 27 25 30 32 35 32 23 26 27 33 33
33 31 25 28
[26] 34 30 33 28 26 30 28
> Xbar=mean(X) ## sample mean
> Xbar
[1] 29.5625
> sd=sd(X) ###standard deviation
> sd
[1] 3.036737
The sample mean is 29.56 which indicates that the average CT score of 32 Miami students is 26.56
b)
> summary(X) ### five point summary
Min. 1st Qu. Median Mean 3rd Qu. Max.
23.00 27.00 30.00 29.56 32.00 35.00
The median is 30.00, which indicates that the median CT score of 32 Miami students is 30.00
c) >hist(X) ### Command for Histogram
From the histogram we say that the distribution of the CT scores is approximately symmetric.
d) > boxplot(X,main="Boxplot")## Command for boxplot
The box-plot does not indicate the presence of potential outliers.
Q2. Let Y be the weekly amount spent for maintenance and repairs in a certain company.
Therefore,
a) The probability that the actual costs will exceed the budgeted amount is given by:
### By using r command:
> 1-pnorm(700,600,40)
[1] 0.006209665
b) The amount that should be budgeted weekly for maintenance and repairs to ensure that the probability that the budgeted amount will be exceeded in any given week is only 0.1 obtained by:
## By using the r command:
> qnorm(0.90,600,40)
[1] 651.2621
Therefore we need to budget $651.26 so that the probability that
the budgeted amount will be exceeded in any given week is only
0.1