On Sep 22, 2010, at 5:09 AM, Lorenzo Cattarino wrote:

actually I need to extract the random effect from the formula, not the model

any idea?

________________________________

From: Sacha Viquerat [mailto:sacha.v...@googlemail.com]
Sent: Wed 22/09/2010 5:55 PM
To: Lorenzo Cattarino
Subject: Re: [R] extracting random effects from model formula



Am 22.09.2010 09:22, schrieb Lorenzo Cattarino:
Hi R-users



I would like to extract the random effects ("1|SITE", "1+SPECIES| SITE"
and "BA|SITE") from this model formula:


> modterm <- attr(terms(Full_model), "term.labels")
> modterm[grep("\\|", attr(terms(Full_model), "term.labels")  )]
[1] "1 | SITE"           "1 + SPECIES | SITE" "BA | SITE"




Full_model<- formula (VAR ~ (1|SITE) + (1+SPECIES|SITE) + (BA|SITE) +
HEIGHT + COND + NN_DIST)



I tried:



terms(Full_model)

labels(terms(Full_model))



but I could not distinguish between random and fixed effects.



thanks



Lorenzo


     [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


try ranef(model).



        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to