Hi All,

 

I am making the switch to R and uncertain which of the several packages for
mixed models is appropriate for my analysis. I am waiting for Pinheiro and
Bates' book to arrive via inter-library loan, but it will be a week or more
before it arrives.

 

I am trying to fit a generalized linear mixed model of survival data
(successes/trials) as a function of several categorical fixed and nested
random effects and a covariate. Additionally, the residual variance in the
data is a negative function of the covariate, which I would like to model as
well. Working in SAS, I was able to do this on transformed data in PROC
MIXED, but ran into trouble trying to run it as a logistic regression in the
original scale in GLIMMIX. 

 

Can glmer in lme4 do this? It seems that "weights" in lme4 refers to
weighting of observations rather than modeling the variance-covariate, as it
does in nlme. I tried running nlme, but I'm stuck on syntax, particularly
with regards to how the fixed and random statements should be constructed
separate from the model statement (not sure how this is supposed to work).
Generally, I believe my model in lme4 should look like this: 

 

gm1 = glmer(cbind(#successes,#trials) ~ A*B + covariate + (1|B/C),

family = binomial, link="logit", data=mydata,

weights=varExp(form = ~covariate))

 

where #trials is the number of subjects at the beginning of the experiment
in each experimental unit, #successes is the number of survivors, A and B
are fully crossed fixed categorical factors, C is a categorical random
factor nested within B (i.e. random site within year), and covariate is a
continuous numerical variable ranging from 1- +inf.

 

Can someone please suggest (a) which package to use for this analysis and
(b) perhaps share some dummy code using my mock variables above?

 

Many thanks,

 

Jeff Evans

 

PhD Candidate

Department of Entomology

EEBB Graduate Program

Michigan State University

 


        [[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.

Reply via email to