SensitiveQuestions / list

R list package for analyzing list experiments, also known as the item count technique
GNU General Public License v3.0
7 stars 5 forks source link

NA's in coefs or vcov lead to error in predict() #7

Open graemeblair opened 7 years ago

graemeblair commented 7 years ago

When there are NA's in either the coefficient estimates or the variance-covariance matrix (not sure which, likely both), then the following error results at least in some cases:

> predict(ictreg_results, se.fit = TRUE, avg = TRUE, interval = "confidence")

Error in vcov[(nPar + 1):(nPar * 2), (nPar + 1):(nPar * 2)] :
subscript out of bounds

I suspect predict.lm() just drops those coefficients in calculating the predictions, so perhaps we can do that too. I can't reproduce this error at the moment.

kosukeimai commented 7 years ago

In that case, the estimates are not valid and so we should be catching this when they are fitting the model, no?