[R] small sample techniques
Nordlund, Dan (DSHS/RDA)
NordlDJ at dshs.wa.gov
Thu Aug 9 21:59:16 CEST 2007
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Nair,
> Murlidharan T
> Sent: Thursday, August 09, 2007 12:02 PM
> To: Nordlund, Dan (DSHS/RDA); r-help at stat.math.ethz.ch
> Subject: Re: [R] small sample techniques
>
> n=300
> 30% taking A relief from pain
> 23% taking B relief from pain
> Question; If there is no difference are we likely to get a 7%
> difference?
>
> Hypothesis
> H0: p1-p2=0
> H1: p1-p2!=0 (not equal to)
>
> 1>Weighed average of two sample proportion
> 300(0.30)+300(0.23)
> ------------------- = 0.265
> 300+300
> 2>Std Error estimate of the difference between two
> independent proportions
> sqrt((0.265 *0.735)*((1/300)+(1/300))) = 0.03603
>
> 3>Evaluation of the difference between sample proportion as a
> deviation from the hypothesized difference of zero
> ((0.30-0.23)-(0))/0.03603 = 1.94
>
>
> z did not approach 1.96 hence H0 is not rejected.
>
> This is what I was trying to do using prop.test.
>
> prop.test(c(30,23),c(300,300))
>
> What function should I use?
>
>
The proportion test above indicates that p1=0.1 and p2=0.07666667. But in your t-test you specify p1=0.3 and p2=0.23. Which is correct? If p1=0.3 and p2=0.23, then use
prop.test(c(.30*300,.23*300),c(300,300))
Hope this is helpful,
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
More information about the R-help
mailing list