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
sire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Jorunn Slagstad Verzonden: vrijdag 9 mei 2008 15:24 Aan: R-help Onderwerp: [R] Using lme() inside

[R] Using lme() inside a function

2008-05-09 Thread Jorunn Slagstad
Dear R-help I'm working on a large dataset which I have divided into 20 subsets based on similar features. Each subset consists of observations from different locations and I wish to use the location as a random effect. For each group I want to select regressors by a stepwise procedure and include