I'm manually doing a form of stepwise regression in a mixed model but with many variables, it is time consuming. I thought I'd try to use an automated approach. stepAIC gave me false convergence when I used it with my model, so I thought it can't be hard to set up a basic program to do it based on the p-values. Thus I tried a couple of (very) crude options: 1) trying to 'multiply' my 40 terms by a vector of length 40 of 1's (some of which would then become 0's so that the term would be effectively eliminated in the model). This didn't work as lme didn't recognise the vector. 2) setting the term I wished to drop to a column of 0's so it couldn't be used in the analysis, but this created a singularity which then stopped lme from working.... Hmm, perhaps I should abandon such abominations ... does anyone have some advice on how I might get such a crude method working or must I turn back and fight with stepAIC? Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Stepwise-in-lme-tp4224724p4224724.html Sent from the R help mailing list archive at Nabble.com.
Pablo <pschatfield <at> gmail.com> writes:> > I'm manually doing a form of stepwise regression in a mixed model but with > many variables, it is time consuming. I thought I'd try to use an automated > approach. stepAIC gave me false convergence when I used it with my model, > so I thought it can't be hard to set up a basic program to do it based on > the p-values. Thus I tried a couple of (very) crude options: >[snip]> > Hmm, perhaps I should abandon such abominations ... does anyone have some > advice on how I might get such a crude method working or must I turn back > and fight with stepAIC? >As with most mixed model questions, you might be better off re-posting this to the r-sig-mixed-models at r-project.org mailing list ... I suspect you won't do much better than stepAIC. I suspect that the "false convergence" problem you're running into is not a function of stepAIC itself, but that one of the sub-models you're trying to run hits a false-convergence problem in lme itself -- that is, it won't matter what your stepwise framework looks like, you'll still have to run that model. You could also try the dredge() function in the MuMIn package (I'm not sure about the capitalization -- maybe MuMin?) Ben Bolker
Stepwise regression without proper penalization is invalid. Frank Pablo wrote> > I'm manually doing a form of stepwise regression in a mixed model but with > many variables, it is time consuming. I thought I'd try to use an > automated approach. stepAIC gave me false convergence when I used it with > my model, so I thought it can't be hard to set up a basic program to do it > based on the p-values. Thus I tried a couple of (very) crude options: > > 1) trying to 'multiply' my 40 terms by a vector of length 40 of 1's (some > of which would then become 0's so that the term would be effectively > eliminated in the model). This didn't work as lme didn't recognise the > vector. > 2) setting the term I wished to drop to a column of 0's so it couldn't be > used in the analysis, but this created a singularity which then stopped > lme from working.... > > Hmm, perhaps I should abandon such abominations ... does anyone have some > advice on how I might get such a crude method working or must I turn back > and fight with stepAIC? > > Thank you! >----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Stepwise-in-lme-tp4224724p4225391.html Sent from the R help mailing list archive at Nabble.com.