Skip to content

prop.test correct true and false gives same answer

3 messages · David Arnold, Albyn Jones, (Ted Harding)

#
All,

How come both of these are the same.  Both say "1-sample proportions test
without continuity correction." I would suspect one would say "without" and
one would say "with."
1-sample proportions test without continuity correction

data:  118 out of 236, null probability 0.5 
X-squared = 0, df = 1, p-value = 1
alternative hypothesis: true p is not equal to 0.5 
95 percent confidence interval:
 0.4367215 0.5632785 
sample estimates:
  p 
0.5
1-sample proportions test without continuity correction

data:  118 out of 236, null probability 0.5 
X-squared = 0, df = 1, p-value = 1
alternative hypothesis: true p is not equal to 0.5 
95 percent confidence interval:
 0.4367215 0.5632785 
sample estimates:
  p 
0.5 




--
View this message in context: http://r.789695.n4.nabble.com/prop-test-correct-true-and-false-gives-same-answer-tp4662659.html
Sent from the R help mailing list archive at Nabble.com.
#
?prop.test is helpful.

"Continuity correction is used only if it does not exceed the
difference between sample and null proportions in absolute value."

albyn
On Wed, Mar 27, 2013 at 02:04:51PM -0700, David Arnold wrote:

  
    
#
On 27-Mar-2013 21:04:51 David Arnold wrote:
Note what is said (admittedly somewhat deeply tucked away)
under "Details" in ?prop.test:

 "Continuity correction is used only if it does not exceed
  the difference between sample and null proportions
  in absolute value."

In your example, the sample proportion exactly matches the
null-hypothesis proportion (0.5).

Confirmation:
[A] Your same example:
  prop.test(118,236,.5,correct=TRUE,conf.level=0.95)
  #         1-sample proportions test without continuity correction
  # data:  118 out of 236, null probability 0.5 
  # X-squared = 0, df = 1, p-value = 1
  # alternative hypothesis: true p is not equal to 0.5 
  # 95 percent confidence interval:
  #  0.4367215 0.5632785 
  # sample estimates:
  #   p 
  # 0.5 

[B1] Slightly change x, but keep "correct=TRUE":
  prop.test(117,236,.5,correct=TRUE,conf.level=0.95)
  #         1-sample proportions test with continuity correction
  # data:  117 out of 236, null probability 0.5 
  # X-squared = 0.0042, df = 1, p-value = 0.9481
  # alternative hypothesis: true p is not equal to 0.5 
  # 95 percent confidence interval:
  #  0.4304724 0.5611932 
  # sample estimates:
  #         p 
  # 0.4957627 

[B2] Slightly change x, but now "correct=FALSE":
  prop.test(117,236,.5,correct=FALSE,conf.level=0.95)
  #         1-sample proportions test without continuity correction
  # data:  117 out of 236, null probability 0.5 
  # X-squared = 0.0169, df = 1, p-value = 0.8964
  # alternative hypothesis: true p is not equal to 0.5 
  # 95 percent confidence interval:
  #  0.4325543 0.5591068 
  # sample estimates:
  #         p 
  # 0.4957627 

So it doesn't do the requested continuity correction in [A] because
there is no need to. But in [B1] it makes a difference (compare
with [B2]), so it does it.

Hoping this helps,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 27-Mar-2013  Time: 21:21:39
This message was sent by XFMail