Function to calculate predictions and uncertainties of predictions from estimates from hierarchical multivariate regression analysis of survey data with the item count technique.

# S3 method for ictregBayesHier
predict(object, newdata, = FALSE,
  interval = c("none", "confidence"), level = 0.95, sensitive.item, ...)



Object of class inheriting from "ictregBayes" or "ictregBayesMulti"


An optional data frame containing data that will be used to make predictions from. If omitted, the data used to fit the regression are used.

A switch indicating if standard errors are required.


Type of interval calculation.


Significance level for confidence intervals.


For the multiple sensitive item design, the integer indicating which sensitive item coefficients will be used for prediction.


further arguments to be passed to or from other methods.


predict.ictreg produces a vector of predictions or a matrix of predictions and bounds with column names fit, lwr, and upr if interval is set. If is TRUE, a list with the following components is returned:


vector or matrix as above

standard error of prediction


predict.ictregBayesHier produces predicted values, obtained by evaluating the regression function in the frame newdata (which defaults to model.frame(object). If the logical is TRUE, standard errors of the predictions are calculated. Setting interval specifies computation of confidence intervals at the specified level or no intervals.

The mean prediction across all observations in the dataset is calculated, and if the option is set to TRUE a standard error for this mean estimate will be provided. The interval option will output confidence intervals instead of only the point estimate if set to TRUE.

In the multiple sensitive item design, prediction can only be based on the coefficients from one of the sensitive item fits. The sensitive.item option allows you to specify which is used, using integers from 1 to the number of sensitive items.


Blair, Graeme and Kosuke Imai. (2012) ``Statistical Analysis of List Experiments." Political Analysis, Vol. 20, No 1 (Winter). available at

Imai, Kosuke. (2011) ``Multivariate Regression Analysis for the Item Count Technique.'' Journal of the American Statistical Association, Vol. 106, No. 494 (June), pp. 407-416. available at

See also

ictreg for model fitting


# NOT RUN { mle.estimates.multi <- ictreg(y ~ male + college, data = multi, constrained = TRUE) draws <- mvrnorm(n = 3, mu = coef(mle.estimates.multi), Sigma = vcov(mle.estimates.multi) * 9) <- ictregBayesHier(y ~ male + college, formula.level.2 = ~ 1, delta.start.level.1 = list(draws[1, 8:9], draws[1, 2:3], draws[1, 5:6]), data = multi, treat = "treat", delta.tune = list(rep(0.005, 2), rep(0.05, 2), rep(0.05, 2)), alpha.tune = rep(0.001, length(unique(multi$state))), J = 3, group.level.2 = "state", n.draws = 100, burnin = 10, thin = 1) bayes.predict <- predict(, interval = "confidence", = TRUE) # }