mi.count {mi}R Documentation

Elementary function: Bayesian overdispersed poisson regression to impute a count variable.

Description

Imputes univariate missing data using bayesglm, an R functions for generalized linear modeling with independent normal, t, or Cauchy prior distribution for the coefficients.

Usage

mi.count(formula, data = NULL, start = NULL, n.iter = 100, 
  draw.from.beta = FALSE, ...)
## S4 method for signature 'mi.count':
resid(object, y)
## S4 method for signature 'mi.count':
residuals(object, y)

Arguments

formula an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. See bayesglm formula for details.
data A data frame containing the incomplete data and the matrix of the complete predictors.
start Starting value for bayesglm.
n.iter Maximum number of iteration for bayesglm. The default is 100.
draw.from.beta Draws from posterior distribution of the betas to add randomness.
... Currently not used.
object mi.countr object.
y Observed values.

Details

In bayesglm default the prior distribution is Cauchy with center 0 and scale 2.5 for all coefficients (except for the intercept, which has a prior scale of 10). See also glm for other details.

Value

model A summary of the bayesian fitted model.
expected The expected values estimated by the model.
random Vector of length n.mis of random predicted values predicted by using the binomial distribution.

Note

see also http://www.stat.columbia.edu/~gelman/standardize/

Author(s)

Masanao Yajima yajima@stat.columbia.edu, Yu-Sung Su ys463@stat.columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu

References

Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2007.

See Also

mi.info, mi.method, mi

Examples

  # true data
  x <- rnorm(100,0,1) 
  y <- rpois(100,40)  
  # create artificial missingness on y
  y [seq(1,100,10)] <- NA
  dat.xy <- data.frame(x,y)
  # imputation
  mi.count(y ~ x, data = dat.xy)

[Package mi version 0.04-6 Index]