## Homework #2 Problem 10

One way to evaluate a teaching assistant’s effectiveness is to examine the scores achieved by his or her students at the end of the semester. Obviously the mean score is of interest. However, the variance also contains useful information - some teachers have a style that works well with more able students but is unsuccessful for less able of poorly motivated students. A professor gives a standard exam to all sections of a course at the end of a semester. The variation on this exam is usually very close to 300. A new TA has a class of 30 students, whose test scores had a variance of 150. Is there reason to believe the student scores for this TA have a different variance from the norm?

This test statistic for testing this claim will have the following distribution:

The value of the test statistic for testing this claim is:

The p-value associated with this test statistic is: Based on your results, what is your conclusion? (Use $$\alpha$$ = :05)

Construct a 95% confidence interval for the true variance of student scores. The LCL is ______. The UCL is ______.

The test statistic follows a $$\chi^{2}$$ distribution with $$29$$ degrees of freedom.

#### Ho sigma2=300
#### Ha sigma2 not equal to 300   *two tailed test!!!
sigma2<-300
n=30
s2<-150
x2<-s2*(n-1)/sigma2
x2
##  14.5

Finding the $$p-value$$:

1. Working with the left tail
#### You need to multiply by 2!
pchisq(x2,df=29)
##  0.01146266
pvalue<-2*pchisq(x2, df=29)
pvalue
##  0.02292532
1. Working with the right tail (Excel style)
####### If you want to work "from the right to the left", as in excel, you need to tell the function! The argument "lower.tail=FALSE" do the work.
pchisq(x2,df=29, lower.tail = FALSE)   ### That is the excel output for the CHIDIST function
##  0.9885373
pvalue_excel<-2*(1-pchisq(x2,df=29,lower.tail=FALSE))
pvalue_excel
##  0.02292532

Reject $$H_{0}$$ or not?

what_to_do<-ifelse(pvalue<0.05, "reject", "don't'")
what_to_do
##  "reject"

Finding Critical Values:

# Finding critical values for X^2
Xc1<-qchisq(0.025, df=29)
Xc1
##  16.04707
Xc2<-qchisq(1-0.025, df=29)
Xc2
##  45.72229

The LCL and UCL:

Upper<-(n-1)*s2/Xc1
Upper
##  271.0775
Lower<-(n-1)*s2/Xc2
Lower
##  95.1396