Code: Selecteer alles
> temp$debilt
[1] 14.9 13.7 14.2 15.3 14.1 18.1 15.7 17.2 17.2 17.0 15.4 17.8 19.3 17.0 15.4 15.9 15.8 16.3 18.9 20.1
The file temp contains measurements of the mean temperature (oC) in the month of July of 20 consecutive years in a number of towns. Consider the mean temperature in July in De Bilt.
A)
Assume that the mean temperature in July in De Bilt can be modeled as a normal random variable with expectation μ = 16 and standard deviation = 1.5. Determine the probability of a mean temperature in July in De Bilt higher than 18 degrees under this model assumption.
Because some doubt about the normality assumption is justified, we now do not assume normality of the mean temperature in July in De Bilt. Instead, we investigate the probability of a mean temperature in July in De Bilt higher than 18 degrees based
on the 20 measured mean temperatures. For this we note that the probability of a mean temperature in July in De Bilt higher than 18 degrees may also be viewed as the ‘population’ fraction of mean temperatures in July in De Bilt higher than 18 degrees.
B)
Give a point estimate for the ‘population’ fraction of mean temperatures in July in De Bilt higher than 18 degrees.
C)
Compute the 90% margin of error for this estimate and determine a 90% confidence interval for the ‘population’ fraction of mean temperatures in July in De Bilt higher than 18 degrees.
D)
Test with the z-score the null hypothesis that the ‘population’ fraction of mean temperatures in July in De Bilt higher than 18 degrees is equal to 0.25 against the alternative that this fraction is smaller than 0.25. Take significance level 10%.
E)
Is it appropriate to use the test based on the normality of the Z-score for these data, as we did in part d? Why (not)?
================================
Mijn antwoorden tot zover!
================================
A)
Code: Selecteer alles
> pnorm(18, 16, 1.5, lower.tail=FALSE)
[1] 0.09121122
B)
Code: Selecteer alles
> n = length(temp$debilt)
> n
[1] 20
> k = sum(temp$debilt > 18)
> k
[1] 4
> pbar = k/n
> pbar
[1] 0.2
C)
Code: Selecteer alles
> n = length(temp$debilt)
> n
[1] 20
> k = sum(temp$debilt > 18)
> k
[1] 4
> pbar = k/n
> pbar
[1] 0.2
> SE = sqrt(pbar*(1-pbar)/n)
> SE
[1] 0.08944272
> E = qnorm(.975)*SE
> E
[1] 0.1753045
> pbar + c(-E, E)
[1] 0.02469549 0.37530451
D)
Code: Selecteer alles
Hypothesis
H0: P = 0.25
Ha: P < 0.25
P from H0 = 0.25
P (1 - P) from H0 = 0.75
> pbar
[1] 0.2
> Z = (pbar - 0.25) / (sqrt(0.25*0.75) / sqrt(20))
> Z
[1] -0.5163978
The table value of Z is 0.3085
P = 0.3085
P > 0.10, so we accept H0.
Zijn mijn antwoorden correct tot zover??