# Create simple model
Model <- estimatePopsize(
formula = capture ~ nation + gender,
data = netherlandsimmigrant,
model = ztpoisson,
method = "IRLS"
)
# Apply heteroscedasticity consistent covariance matrix estimation
require(sandwich)
cov <- vcovHC(Model, type = "HC3")
summary(Model, cov = cov,
popSizeEst = redoPopEstimation(Model, cov = cov))
# Compare to results with usual covariance matrix estimation
summary(Model)
## get confidence interval with larger significance level
redoPopEstimation(Model, control = controlPopVar(alpha = .000001))
Run the code above in your browser using DataLab