wikpur / Spacial-Econometrics-Project

Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

The code worked before the change of variables into rates and now it isn't working #23

Open MPaw18 opened 2 months ago

MPaw18 commented 2 months ago

https://github.com/wikpur/Spacial-Econometrics-Project/blob/f12e530994bb4025f811a1ba6b30d68c48c33c41/Spacial-Econometrics-Project.Rmd#L349

@rsbivand

rsbivand commented 2 months ago

This line works for me - what was the error message? Was the problem rather in the next line:

> car2 <- hglm(fixed=form_pre, random= ~ 1|TERYT, data=wpom3, family = gaussian(), rand.family=CAR(D = w))
0.1 is chosen as the initial values for the dispersion parameter of the random effects.
0.1 is chosen as the initial values for the dispersion parameter of the mean model.
Error in if (iter < maxit & all(sigma2u/(sum(sigma2u) + sigma2e) < (1 -  : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family,  :
  Residuals numerically 0 are replaced by 1e-8
2: In rm(list = c("g12", "SummarySt", "devu", "hvu")) :
  object 'g12' not found
3: In hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family,  :
  Residuals numerically 0 are replaced by 1e-8
4: In log(ifelse(y == 0, 1, y/mu)) : NaNs produced
5: In hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family,  :
  Residuals numerically 0 are replaced by 1e-8
6: In log(ifelse(y == 0, 1, y/mu)) : NaNs produced
7: In hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family,  :
  Residuals numerically 0 are replaced by 1e-8
8: In log(ifelse(y == 0, 1, y/mu)) : NaNs produced
9: In hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family,  :
  Residuals numerically 0 are replaced by 1e-8
10: In log(ifelse(y == 0, 1, y/mu)) : NaNs produced
> car2
Error: object 'car2' not found

Is this step essential to your analysis?