Re: [R] Using lme() inside a function (should be: stepAIC from lme inside function)

2008-05-09 Thread Dieter Menne
ONKELINX, Thierry inbo.be> writes: > This solutions works with R 2.7.0 under windows > > library(MASS) > library(nlme) > PredRes <- function(cal, val){ > cal <<- cal > lmemod <- lme(distance ~ age * Sex, random = ~1|Subject, data = cal, > method="ML") > themod <- stepAIC(lmemod, dir=

Re: [R] Using lme() inside a function

2008-05-09 Thread ONKELINX, Thierry
Jorunn, This solutions works with R 2.7.0 under windows library(MASS) library(nlme) PredRes <- function(cal, val){ cal <<- cal lmemod <- lme(distance ~ age * Sex, random = ~1|Subject, data = cal, method="ML") themod <- stepAIC(lmemod, dir="both", trace = FALSE) prs <- predict(them