Module 8: Hypothesis Testing and Correlation Analysis


First Question:

The director of manufacturing at a cookies needs to determine whether a new machine is production a particular type of cookies according to the manufacturer's specifications, which indicate that cookies should have a mean of 70 and standard deviation of 3.5 pounds. A sample pf 49 of cookies reveals a sample mean breaking strength of 69.1 pounds.
A. State the null and alternative hypothesis _______

H0 – Null Hypothesis µ ≥ 70 , since it is better if the machine produces more.

HA – Alternative Hypothesis µ < 70 – Lower tail test




B. Is there evidence that the machine is nor meeting the manufacturer's specifications for average strength? Use a 0.05 level of significance _______ 

Xbar = 69.1

µ0 = 70

Ỽ = 3.5

n = 49

test stat t = (69.1 - 70) / (3.5/sqrt(49)) = -1.8

Critical Value

𝛼 = .05 z value = -1.644

Z.half. 𝛼 = -1.96

The test statistics came out less than the actual stats which means it failed to reject the null hypothesis. The machine is working within average conditions.


C. Compute the p value and interpret its meaning _______

P value = pnorm(z) = 0.0359

If the P value is less than .05 we do not reject the null hypothesis.


D. What would be your answer in (B) if the standard deviation were specified as 1.75 pounds?______

xbar <- 69.1

µ0 <- 70

stdev <-1.75

n <- 49

z <- (xbar-µ0)/(stdev/sqrt(n))

z = -3.6


E. What would be your answer in (B) if the sample mean were 69 pounds and the standard deviation is 3.5 pounds? ______
xbar <- 69.1

µ0 <- 69

stdev <-3.5

n <- 49

z <- (xbar-µ0)/(stdev/sqrt(n))

z = 0.2


Second Question:

If x̅ = 85, σ = standard deviation = 8, and n=64, set up 95% confidence interval estimate of the population mean μ.




Third Question using Correlation Analysis
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.


In R
x < - c(your date)
y<- c(your data)
z<- c(your data)
df<-data.frame(x,y,z) plot
cor(x,y,z)
cor(df,method="pearson") #As pearson correlation
cor(df, method="spearman") #As spearman correlation
Use corrgram( ) to plot correlograms .

Comments