[R] metafor mixed-effect models: testing different predictor combinations for lowest AIC
Michael Dewey
info at aghmed.fsnet.co.uk
Sun Jun 2 13:27:08 CEST 2013
At 22:12 01/06/2013, emhanlon wrote:
>Good afternoon,
>
>
>I am trying to use a mixed-effect model to find the best predictors of
>wildlife response (fledgling success, offspring growth rate, etc...) to
>human disturbance. I am using a Log Response Ratio as my measure of effect
>size along with study variance, and testing to see how: habitat, diet, mass,
>generation time, sociality, etc... influence how a species responds to
>disturbance. I have 9 total predictors, but a sample size that would only
>allow for 3, at most, in a model. Does anyone know of any code that could
>allow me to automatically test all combinations of 1,2, or 3 predictors to
>get the model with the lowest overall AIC?
You could use the facility that mods can be a matrix and use combn to
generate all the possible combinations of 9 taken 1, 2, 3 at a time.
Each time you call ram.uni just save whatever you want to use as your
criterion.
I am not sure how good an idea that is and I would advise looking at
all the solutions near (for some meaning of near) the apparently best
one. You might be surprised how close they are which rather casts
doubt on the wisdom of selecting variables.
>#Code I had been using in different combinations manually:
> > res <- rma(LRR, est_var, mods = cbind(Gentime, Sociality, Season), data =
> > data)
>
>#Also, if the best model has more than one predictor, how can you get
>specific mean effect sizes for different levels of the #variable, especially
>if it is categorical (non-ranked)?
>
>
>Thank you so much for your help,
>
>Edward
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/metafor-mixed-effect-models-testing-different-predictor-combinations-for-lowest-AIC-tp4668486.html
>Sent from the R help mailing list archive at Nabble.com.
Michael Dewey
info at aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html
More information about the R-help
mailing list