Dear R users, I've got a serious problem running some gee functions, and I really can't fix it. My dataframe is made of several rows and columns (say 7600 x 15), like the one below:
header inr ......... inside group_cod 1 2.25 0 1 1 3.46 0 0 1 ...... 1 0 1 ...... 1 ....... 1 ...... ..... ....... .... ...... ..... ....... .... ...... ..... ....... .... ...... ..... ....... .... ...... ..... ....... .... ...... ..... ....... 615 ...... ..... ....... 615 ...... ..... ....... 615 ...... ..... ....... As you can see I've got several repeated measures, resulting in clusters ( i.e. ID) of different sizes. You can get a frame like this by running this code: header <- rep.int(seq(1:615),sample(seq(1:19),size=615,replace=T)) inr <- rlnorm(length(header),0.8434359,0.3268392) group_cod <- sample(c(0,1),size=length(header),replace=T) inside <- sample(c(0,1),size=length(header),replace=T) gee.frame <- data.frame(header,inr,group_cod,inside) When I try running a longitudinal model with geeglm, the corstr="unstructured" option returns me an assertion failure of R itself (a sort of error window), while the ar1 option for corstr returns a model only with estimates, and no s.e. or wald test. Same is for the anova method. I removed subjects with only one observation, but the problem's still the same. This is the code used: - for corstr= unstructured geeglm.model<- geeglm(inside~group_cod,family=binomial, data=gee.frame ,id=header,corstr="unstructured") This model gives me an error (not the kind written in R-gui: simply the program seems to stop not producing anything), and doesn't produce any result, leading me to quit R. The same happens when I use a userdefined matrix built with genZcor function using crostrv=4 (i.e. unstructured). My initial thought was of problems because of highly unbalanced observations and because of exceeding of correlation parameters to estimate, but restricting cluster size did not result in any improvement. Is there a problem with the code, or it could be due to the data? - for costr= ar1 In my dataset I also have a variable "weeks", that I use to specify waves in the geeglm. When I use this, the output for an autoregressive gee model gives me only the estimates, when I don't use it everything's alright. The problem's that I have unbalanced observations, so the use of waves could take this into account while estimating parameters. Is this a conflict between these options, or what? In addition, I've built the empirical correlation structure. A 19x19 structure, thus with nrow=maximum cluster size. When I use this as zcor the program gives me geeglm.fixed <- geeglm(inside~weeks+group_cod+età,family=binomial, data= frame.model,id=header,waves=weeks,zcor=corr.gee,corstr="userdefined") *Errore in geese.fit(xx, yy, id, offset, soffset, w, waves = waves, zsca, : nrow(zcor) need to be equal sum(clusz * (clusz - 1) / 2) for unstructured or userdefined corstr.* I really don't understand the meaning of this: the correlation should have number of rows equal to maximum cluster size. Also in the online help the details say something about the dimension of Zcor, but I can't understand the same... I hope I've been clear. Thanks in advance niccolò [[alternative HTML version deleted]]
______________________________________________ R-help@stat.math.ethz.ch 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.