0
$\begingroup$

I have used the following line of code but it doesn't give me the right answer for (chi-squared) test statistic while it gives the right answer for p-value regarding the following question: "Consider testing H_0: p = 0.5 against H_1: p ≠ 0.5, given that there were 38 successes in a sample of size 56. Find the value of the (chi-squared) test statistic. (Do not use the continuity correction.)"

> prop.test(38,n=56,p=1/2)
    1-sample proportions test with continuity correction

data:  38 out of 56, null probability 1/2
X-squared = 6.4464, df = 1, p-value = 0.01112
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
 0.5390880 0.7935168
sample estimates:
        p 
0.6785714 

Can you give some explanation in your answers? I am not coming from a statistics background.

$\endgroup$
  • 2
    $\begingroup$ What does the last line of the question say? What does the first line of your output say? What does ?prop.test say about continuity corrections? $\endgroup$ – Glen_b -Reinstate Monica Feb 14 '14 at 4:10
  • $\begingroup$ If this is a homework question you should apply the self-study tag. $\endgroup$ – dmartin Feb 14 '14 at 4:25
2
$\begingroup$

The problem was that I was using proportions test with continuity correction while in the question it was mentioned to use proportions test without continuity correction. So we just need to add correct=FALSE parameter to prop.test function.

> prop.test(38,n=56,p=1/2,correct=FALSE)

    1-sample proportions test without continuity correction

data:  38 out of 56, null probability 1/2
X-squared = 7.1429, df = 1, p-value = 0.007526
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
 0.5482264 0.7859901
sample estimates:
        p 
0.6785714 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.