[R] permutation test for linear models with continuous covariates
Tim Hesterberg
timh at insightful.com
Mon Dec 12 20:52:24 CET 2005
What do you want to test?
To test H0: Y is independent of all X's,
you can permute Y.
To test H0: a particular X does not contribute to predicting Y, conditional
on the other X's
you have to be careful. If you permute that X, the size is wrong; the
type I error can be nearly 50%, because you've lost the correlation
between that X and others. I don't know of a suitable permutation test
in general for testing individual X's.
S+Resample has a permutationTest() function that lets you specify
which columns to permute. The Canty/Davison/Hinkley "boot" library
(in R or S-PLUS) offers "permutation" as one of the options for sampling
in the boot() function; to use this you would specify the Y variable
as the data set and pass the X's separately to the statistic.
Tim Hesterberg
>Hi I was wondering if there is a permutation test available in R for linear
>models with continuous dependent covariates. I want to do a test like the
>one shown here.
>
>bmi<-rnorm(100,25)
>x<-c(rep(0,75),rep(1,25))
>y<-rnorm(100)+bmi^(1/2)+rnorm(100,2)*x+bmi*x
>
>H0<-lm(y~1+x+bmi)
>H1<-lm(y~1+x+bmi+x*bmi)
>anova(H0,H1)
>summary(lm(y~1+x+bmi))
>
>
>But I want to use permutation testing to avoid an inflated p-value due to a
>y that is not totally normal distributed and I do not want to log transform
>y.
>
>Thanks
>
>Anders
========================================================
| Tim Hesterberg Research Scientist |
| timh at insightful.com Insightful Corp. |
| (206)802-2319 1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax) Seattle, WA 98109-3012, U.S.A. |
| www.insightful.com/Hesterberg |
========================================================
Download the S+Resample library from www.insightful.com/downloads/libraries
Two Research Scientist positions:
data mining
frailty/mixed effects
http://www.insightful.com/company/jobs.asp
Speak out about biased science in Washington D.C.
http://home.comcast.net/~timhesterberg/ScientificIntegrity.html
More information about the R-help
mailing list