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

predict.ictreg does not support multiple sensitive item design with y_i(0) included as a covariate #23

Open leungkp opened 2 years ago

leungkp commented 2 years ago

Hi,

When running a multiple sensitive item design with ictreg(..., multi.condition = "level"), it is not currently supported by predict.ictreg() to make prediction:

require(list)

## multi.condition = none 
results_no_level <- ictreg(y ~ male + college + age + south + age:south, treat = "treat", 
                           J = 3, data = multi, method = "ml")

## prediction succeeds
predict.ictreg(results_no_level, sensitive.item = 1, avg = TRUE)

## multi.condition = level
results_w_level <- ictreg(y ~ male + college + age + south + age:south, treat = "treat", 
                          J = 3, data = multi, multi.condition = "level", method = "ml")

## prediction fails
predict.ictreg(results_w_level, sensitive.item = 1, avg = TRUE)

which gives an error message: Error in xvar %*% beta : non-conformable arguments

It seems like the reason is that y_i(0) and the extra associated parameter are not taken into account in predict.ictreg().

In general, I manually simulated the expected probabilities of respondents choosing the sensitive items taking y_i(0) and the extra parameter into account (following the replication file PA_Replication.R -- Replication R command file for: Graeme Blair and Kosuke Imai, "Statistical Analysis of List Experiments," Political Analysis, In Press. Created 27 October 2011). It seems like the inclusion of y_i(0) and the associated parameter drastically changes the expected probabilities vis-a-vis the difference-in-means estimate. Will there be any implementation of robust NLS/ML models (i.e.ictreg(...robust = TRUE)) for multiple sensitive item design to ensure their correspondence?

Thank you!

graemeblair commented 2 years ago

Thanks for your report. I believe this is fixed in version 9.2.4 which is just now on CRAN. Could you please reinstall and confirm 9.2.4 is installed and try again?

We don't have any plans for implementing more models at this time.

leungkp commented 2 years ago

Thanks so much for the reply. Unfortunately, the Error in xvar %*% beta : non-conformable arguments error persists in version 9.2.4:

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] list_9.2.4     sandwich_3.0-2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3      mvtnorm_1.1-3     quadprog_1.5-8    lattice_0.20-45   corpcor_1.6.10    zoo_1.8-10        MASS_7.3-57       grid_4.2.1       
 [9] magic_1.6-0       arm_1.12-2        nlme_3.1-157      stats4_4.2.1      coda_0.19-4       minqa_1.2.4       nloptr_2.0.3      Matrix_1.4-1     
[17] boot_1.3-28       splines_4.2.1     lme4_1.1-29       tools_4.2.1       abind_1.4-5       compiler_4.2.1    gamlss.dist_6.0-3 VGAM_1.1-6