Skip to content
Prev 10642 / 398502 Next

Hypothesis test

JRG
From:           	"Moustafa ElHousinie" <drhosini at hotmail.com>
To:             	r-help at stat.math.ethz.ch
Copies to:      	syed at saudionline.com.sa
Subject:        	Re: [R] Hypothesis test
Date sent:      	Sat, 07 Apr 2001 06:33:16 -0000
<<SNIP>>
Ahem.  I believe this is not the question originally posed:
That would seem to be:  How do I test Ho: p = p0 for some fixed 
value of p0, given an observed proportion p-hat (based on a 
sample of size n)?

Answer:  Calculate a p-value directly from the binomial distribution 
B(n, p0) or, if min(n*p0, n*(1-p0)) is not too small, use the normal 
approximation based on

	z = (p-hat - p0) / sqrt(p0*(1-p0)/n)

To that z you may or may not want to add a continuity correction, 
depending on your position on that particular issue.

Both tests assume that n is small compared to the population size,  
are standard fare in intro textbooks, and easily calculated from R's 
command line.

---JRG



John R. Gleason

Syracuse University
430 Huntington Hall                      Voice:   315-443-3107
Syracuse, NY 13244-2340  USA             FAX:     315-443-4085

PGP public key at keyservers
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._