[R] add 'weights' in gamm with poisson or binomial family
He
hzshasha at googlemail.com
Wed Feb 1 14:17:17 CET 2012
Dear all,
I am doing unblanced longitudinal analysis (the number of individuals
declines with time). I want to consider the decreasing cases with time
by adding a weight which assumes a different variance function at each
time.
However, if i run 'm1' (shown below), the error message ' weights must
be like glm weights for generalized case' is shown. If i delete
'family=poisson' which is 'm2', the model works.
m1<-gamm(y<-s(t1)+t2,random=list(id=~1),data,weights=varIdent(form=~1|t1),family=poisson,methods='REML')
m2<-gamm(y<-s(t1)+t2,random=list(id=~1),data,weights=varIdent(form=~1|t1),methods='REML')
Does anybody know how to keep 'weights=varIdent' working in gamm model
with poisson or binomial family without specifing a numeric weights
(because i dont know the real population variance)?
Or any suggestions?
Thank you very much in advance. I will be really appreciated for your
time and help.
Best wishes,
He
More information about the R-help
mailing list