HW 10 Solution

# HW 10 Solution - 5 use t test as above 6 state rejection...

This preview shows pages 1–2. Sign up to view the full content.

HW 10 Solution 1. load datahw10.dat wc = datahw10; n = length(wc); % Part I ybar = sum(wc)/n; sy = 0; for i = 1:n sy = sy + (wc(i)-ybar)^2/(n-1); end sy = sqrt(sy); 2. % Part II: confidence intervals a = [0.1 0.05 0.01]; d = sy/sqrt(n)*tinv(1-a/2,n-1); L = ybar - d; U = ybar + d; 3. % Part III: test of hypothesis mu0 = 69; a = 0.05; % 95% confidence level d = sy/sqrt(n)*tinv(1-a/2,n-1); % same as part II L = mu0 - d; U = mu0 + d; % Rejection region % ybar does not fall within this region, so H0 is not supported 1. length of data set, mean and standard deviation computed in part one 2. null hypothesis: mu0 = 69% 3. alternate hypothesis: mu0 ~= 69% 4. 95% confidence interval computed as above

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5. use t test as above 6. state rejection region for the statistic as above 7. does ybar fall within L and U? 8. no, so reject statistic 4. % Part IV: Type I error sig = 2; % Assume true variance is 2% zL = (L-mu0)/(sig/sqrt(n)); zU = (U-mu0)/(sig/sqrt(n)); % This one matches z about right on the one-sided Matlab t-table x = 0.9862; tinv(x,Inf) 2*(1-x) % So probability of a Type I error is 2.76% 5. % Part V: Type II error mu = 70.2; % Assume this is actual mean and keep sig = 2 zL = (L-mu)/(sig/sqrt(n)); zU = (U-mu)/(sig/sqrt(n)); % This one matches zU pretty well tinv(0.316,Inf) % P(z<zU) = 31.6% tinv(1e-6,Inf) % P(z < zL) ~ 0...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

HW 10 Solution - 5 use t test as above 6 state rejection...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online