# tw.imputation: Two-Way Imputation In miceadds: Some Additional Multiple Imputation Functions, Especially for 'mice'

## Description

Two-way imputation using the simple method of Sijtsma and van der Ark (2003) and the MCMC based imputation of van Ginkel et al. (2007).

## Usage

 1 2 3 tw.imputation(data, integer = FALSE) tw.mcmc.imputation(data, iter = 100, integer = FALSE) 

## Arguments

 data Matrix of item responses corresponding to a scale integer A logical indicating whether imputed values should be integers. The default is FALSE. iter Number of iterations

## Details

For persons p and items i, the two-way imputation is conducted by posing a linear model of tau-equivalent measurements:

X_{pi} = θ_p + b_i + \varepsilon_{ij}

If the score X_{pi} is missing then it is imputed by

\hat{X}_{pi} = \tilde{X}_p + b_i

where \tilde{X}_p is the person mean of person p of the remaining items with observed responses.

The two-way imputation can also be seen as a scaling procedure to obtain a scale score which takes different item means into account.

## Value

A matrix with original and imputed values

## Author(s)

Alexander Robitzsch

## References

Sijtsma, K., & Van der Ark, L. A. (2003). Investigation and treatment of missing item scores in test and questionnaire data. Multivariate Behavioral Research, 38, 505-528.

Van Ginkel, J. R., Van der Ark, A., Sijtsma, K., & Vermunt, J. K. (2007). Two-way imputation: A Bayesian method for estimating missing scores in tests and questionnaires, and an accurate approximation. Computational Statistics & Data Analysis, 51, 4013-4027.

The two-way imputation method is also implemented in the TestDataImputation::Twoway function of the TestDataImputation package.
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ############################################################################# # EXAMPLE 1: Two-way imputation data.internet ############################################################################# data(data.internet) data <- data.internet #*** # Model 1: Two-way imputation method of Sijtsma and van der Ark (2003) set.seed(765) dat.imp <- miceadds::tw.imputation( data ) dat.imp[ 278:281,] ## IN9 IN10 IN11 IN12 ## 278 5 4.829006 5.00000 4.941611 ## 279 5 4.000000 4.78979 4.000000 ## 280 7 4.000000 7.00000 7.000000 ## 281 4 3.000000 5.00000 5.000000 ## Not run: #*** # Model 2: Two-way imputation method using MCMC dat.imp <- miceadds::tw.mcmc.imputation( data , iter=3) dat.imp[ 278:281,] ## IN9 IN10 IN11 IN12 ## 278 5 6.089222 5.000000 3.017244 ## 279 5 4.000000 5.063547 4.000000 ## 280 7 4.000000 7.000000 7.000000 ## 281 4 3.000000 5.000000 5.000000 ## End(Not run)