Question 1:
A. The null hypothesis is that the new machine is able to produce cookies with a mean of 70 pounds according to the specification from the manufacture. The alternative hypothesis is that the new machine is not able to produce cookies with a mean of 70 pounds according to the specification from the manufacture.
B. To determine if the machine is not meeting the manufacturer's specifications for average strength, I used the test statistic formula to give me the result. The result is -1.8 based on the formula:
z = (69.1 - 70) / (3.5 / sqrt(49)) = -1.8
Here is the code in R:
C. The equation that I used to compute the p-value was: 2 * (1-pnorm(abs(test_statistic)))
The p-value is .07186064 and since the p-value is greater than the alpha value, the null hypothesis is not rejected since there is not enough evidence that the new machine is not meeting the manufacturer's specifications.
D. If the standard deviation was 1.75 pounds, then the new z-score is -3.6. This puts the new p-value to .0003182172. Since the new p-value is less than the level of significance of .05, the null hypothesis is rejected.
E. If the sample mean is 69 pounds and the standard deviation is 3.5 pounds, the p-value will be .04550026. That is less than the .05 level of significance, therefore the null hypothesis would be rejected.
Question 2:
The critical value for a 95% confidence interval is approximately 1.96 for a two-tailed confidence interval. With all of the calculations for the 95% confidence interval, the lower bond is 83.04 and the upper bond is 86.96. This means that the population mean is between these two values for a 95% confidence interval.
Question 3:
The correlation coefficient analysis formula:
(r) =[ nΣxy – (Σx)(Σy) / Sqrt([nΣx2 – (Σx)2][nΣy2 – (Σy)2])]
r: The correlation coefficient is denoted by the letter r.
n: Number of values. If we had five people, we were calculating the correlation coefficient for, the value of n would be 5.
x: This is the first data variable.
y: This is the second data variable.
Σ: The Sigma symbol (Greek) tells us to calculate the “sum of” whatever is tagged next to it.
x1 < - c(your data) e.g. girls_goals <- c(data1, data2, data3)
x2 <- c(your data) e.g. girls_time<- c(data1, data2, data3)
y1<- c(your data) e.g. boys_goals ..........
y2<- c(your data) e.g. boys_time............
Merge all in a dataframe
df<-data.frame(x1, x2, y1, y2)
Plot:
cor(df)
cor(df,method="pearson") #As pearson correlation
cor(df, method="spearman") #As spearman correlation
Use corrgram( ) to plot correlograms. (Note: you may have to install the corrgram package and call the library)
The results:
I created a Girls and Boys data frames using the data given and combined them together into one singular data frame to create a correlation matrix and plotted the data. I was able to create a correlogram using the results from the correlation coefficient and the Pearson correlation coefficient.
Plotting the correlation for the Girls and Boys data frame:
Plotting the Correlation:
Comments
Post a Comment