[R] Help on hypothesis testing

Gregory Snow Greg.Snow at intermountainmail.org
Thu Apr 6 17:21:27 CEST 2006


There is a z.test function in the TeachingDemos Package.  Note however
that this function is meant for teaching purposes as a stepping stone
for students to learn the syntax and output for hypothesis test
functions before learning about t tests etc.  The z.test function only
does one sample tests.

If you need more functionality you can look at the code for the function
(as well as the code for functions t.test and var.test) to see how to
write your own function (or extend one of the above).

For simple tests you can compute the test statistic by hand and use the
pnorm and pchisq functions.  If you want the output in the standard
hypothesis test format then you will need to write or extend a function
to do that (it's not hard).



-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jinsong Zhao
> Sent: Thursday, April 06, 2006 5:17 AM
> To: R-help
> Subject: [R] Help on hypothesis testing
> 
> Hi,
> 
> I hope to use R to perform some hypothesis testing, such as 
> t.test() and var.test(). 
> However, I don't find a function that could do test on means 
> with variance known (i.e., u test or z test in some 
> textbook), and a function that could do test on variances of 
> normal distribution (i.e. chi-squared test).
> 
> Thanks in advance for any hints.
> 
> Best wishes,
> 
> Jinsong
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list