I am generating a strange error about my attributes being integer. I have made sure that my attributes are charter but I am still getting the error. Code below and data attached.
fit.m<-ergm.ego(ego.obj_m ~edges + nodefactor("sex",base=1)+nodefactor("race",base=1),
+ control=control.ergm.ego(ppopsize=25000, stats.est="bootstrap"))
Constructing pseudopopulation network.
Note: Constructed network has size 20206, different from requested 25000. Estimation should not be meaningfully affected.
Unable to match target stats. Using MCMLE estimation.
Starting maximum likelihood estimation via MCMLE:
Iteration 1 of at most 20:
The log-likelihood improved by 0.01582
Step length converged once. Increasing MCMC sample size.
Iteration 2 of at most 20:
The log-likelihood improved by 0.06599
Step length converged twice. Stopping.
This model was fit using MCMC. To examine model diagnostics and check for degeneracy, use the mcmc.diagnostics() function.
This does not. No idea what the difference is????
fit.m<-ergm.ego(ego.obj_m ~edges + nodefactor("casual",base=1)+nodefactor("race",base=1),
+ control=control.ergm.ego(ppopsize=25000, stats.est="bootstrap"))
Constructing pseudopopulation network.
Note: Constructed network has size 20206, different from requested 25000. Estimation should not be meaningfully affected.
Error in `[[<-.data.frame`(`*tmp*`, attrname, value = integer(0)) :
replacement has 0 rows, data has 9338
Error in `[[<-.data.frame`(`*tmp*`, attrname, value = integer(0)) :
replacement has 0 rows, data has 9338
In addition: Warning message:
In ergm.ego(ego.obj_m ~ edges + nodefactor("casual", base = 1) + :
Non-scaling statistic detected when trying to fit a model: network-size invariant parametrization probably does not exist so pseudopopulation size should equal the population size.
I am generating a strange error about my attributes being integer. I have made sure that my attributes are charter but I am still getting the error. Code below and data attached.
Load required packages.
Make the three ergm.ego objects.
Make sure the variables for casual and main are character.
Just to be sure make them n/y.
This fits.
This does not. No idea what the difference is????
nsfg.egodata.zip