[R] permutation test for linear models with continuous covariates

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Nov 30 15:11:45 CET 2005


"anders superanders" <andersdetermigigen at hotmail.com> writes:

> 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.

Er, what would you permute? For an interaction test like this (notice
by the way that "*" in your model formula does not mean what you think
it does) I do not think a permutation test exists.  You could try
bootstrapping to get an improved approximation the distribution of the
interaction term.


-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list