3

I am doing some problems on hypothesis tests on the variance, using a $\chi^2$ distribution. I need to find the power of the test, and I tried to write my own code in R.

I don't know how to express non-centrality parameter in terms of other known values like sample size or sample variance. I was looking at R package called pwr and there is a function called pwr.chisq.test, but this function is talking about the effect size.

How do I related the effect size to the non-centrality parameter to do my calculation?


Ok I will just post a problem here... The assumption here is that the underlying distribution is normal... Some study is to be done on the diameter of the rivet holes which are used in engineering components. Sample of 15 components (n=15) was tested and it was found that standard dev, s = 0.008 mm. Is there strong evidence to indicate that std of hole diameter exceeds 0.01 mm ? Use $\alpha = 0.01$. Find the P-value of the test.( I can do this part using pchisq function in R... till this point its fine).. If real std is as large as 0.0125 mm, what sample size will be required to detect this with power of at least 0.8 ? This is the part I am having trouble with R. I can use Minitab to get the answer. But I want to learn how to use R to do this. This function pwr.chisq.test has the parameter called effect size and in this case I don't have idea how to choose it.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
user9026
  • 131
  • 4
  • Can you say more about your situation, data, & goals here? It may be that what you're trying to do is best accomplished some other (easier) way, but I can't tell. You may find this blog post helpful: [How to ask a statistics question](http://www.statisticalanalysisconsulting.com/how-to-ask-a-statistics-question/comment-page-1/). – gung - Reinstate Monica Nov 10 '12 at 14:36
  • EG, if you want to test for *homogeneity of variance*, I discuss some tests here: [Why levene test of equality of variances rather than F ratio](http://stats.stackexchange.com/questions/24022//24024#24024). To conduct power analyses in non-standard situations, it is often convenient to simulate. That approach is discussed in several places on CV; eg, I discuss it here: [Simulation of logistic regression power analysis - designed experiments](http://stats.stackexchange.com/questions/35940/). – gung - Reinstate Monica Nov 10 '12 at 14:41
  • Hi gung, I am just doing one sample hypothesis tests on the variance. So the null hypothesis is H_o = nullvariance and alternative hypothesis is H_1 != nullvariance. So I need to find the power to do this if we have been given the actual variance and alpha... – user9026 Nov 11 '12 at 04:38
  • So you will want to test whether a distribution will have some specific variance, is that right? Can you provide more details (as noted above)? Will the dist be normal (or roughly so)? What is the variance you're interested in? What range of $N$'s would be reasonable for you to run? What $\alpha$ and power are you hoping to use (.05, & .80, are very common)? – gung - Reinstate Monica Nov 11 '12 at 17:35

0 Answers0