Hi all,

I was trying to fit a Gamma hierarchical model using "glmer", but got weird 
error message that I could not understand. On the other hand, a similar call to 
the glmmPQL leads to results that are close to what I expect. I also tried to 
change tha "nAGQ" argument in "glmer", but it did not solve the problem. The 
model I was fitting has a simple structure - one hierarchy and one offset, and 
I did not expect "glmer" to fail on this simple data set. Did I specify 
something wrong here? I appreciate any help. Thanks in advance.

#############################################################
## Code to fit the model
#############################################################
library(MASS)
library(lme4)
address <- 
"http://instruction.bus.wisc.edu/jfrees/jfreesbooks/Longitudinal%20and%20Panel%20Data/Book/Data/TXTData/WorkerC.txt";
wc <- read.table(address,header=T)
# clean data
cl <- unique(wc$CL[wc$LOSS==0])
wc2 <- subset(wc, !(CL %in% cl) )
# fit model
fit1 <- glmmPQL(LOSS~ YR+offset(log(PR)), random=~1|CL,family=Gamma(link="log"),
          data=wc2)
fit2 <- glmer(LOSS~ (1|CL) + YR+offset(log(PR)), family=Gamma(link="log"),
          data=wc2)


#############################################################
## Results of fit1 and fit2
#############################################################

> fit1
Linear mixed-effects model fit by maximum likelihood
  Data: wc2
  Log-likelihood: NA
  Fixed: LOSS ~ YR + offset(log(PR))
  (Intercept)            YR
-4.2830507147  0.0005085944

Random effects:
 Formula: ~1 | CL
        (Intercept)  Residual
StdDev:   0.8313193 0.5346455

Variance function:
 Structure: fixed weights
 Formula: ~invwt
Number of Observations: 700
Number of Groups: 100
> fit2
Error in asMethod(object) : matrix is not symmetric [1,2]




Wayne (Yanwei) Zhang
Statistical Research
CNA
Email: yanwei.zh...@cna.com<mailto:yanwei.zh...@cna.com>




NOTICE:  This e-mail message, including any attachments and appended messages, 
is for the sole use of the intended recipients and may contain confidential and 
legally privileged information.
If you are not the intended recipient, any review, dissemination, distribution, 
copying, storage or other use of all or any portion of this message is strictly 
prohibited.
If you received this message in error, please immediately notify the sender by 
reply e-mail and delete this message in its entirety.

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