[R] Error in gee.fit$working.correlation[1, 2] : subscript out of bounds

Phat Chau ph@t@ch@u @end|ng |rom m@||@utoronto@c@
Thu Jun 4 22:17:41 CEST 2020


Hello,

I have a dataframe in R that looks like the following

  cluster id period   u_3 timeID startTrt Ijt    error      y
1:       1  1      0 -1.26      1        1   0   1.2015 17.809
2:       1  2      0 -1.26      1        1   0  -1.6577 14.950
3:       1  3      0 -1.26      1        1   0  -3.8639 12.744
4:       1  4      0 -1.26      1        1   0   1.4978 18.105
5:       1  5      0 -1.26      1        1   0  -5.3182 11.289

When I try to run a gee model on it using the geesmv package which adjusts the variance covariance matrix for small sample sizes as follows

test <- GEE.var.fg(y ~ factor(period) + factor(Ijt),id="id",family=gaussian, dx,corstr="exchangeable")

I get this error message:

Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
    (Intercept) factor(period)1 factor(period)2 factor(period)3 factor(period)4 factor(period)5    factor(Ijt)1
          17.25           -8.27           -6.47           -9.13           -8.17          -11.89            8.96
Error in gee.fit$working.correlation[1, 2] : subscript out of bounds

I think the usual culprit for this kind of error message is that the variable being referred to (id in this case I assume) is non-existent. That is clearly not the case here and I checked to make sure it is it not a typo.

Does anyone know why this is? How would I troubleshoot this?

Thank you,
Edward


	[[alternative HTML version deleted]]



More information about the R-help mailing list