# 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, van der Ark, Sijtsma and Vermunt (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

## 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.

## Examples

  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) 

### Example output

Loading required package: mice
IN1 IN2 IN3 IN4 IN5 IN6 IN7 IN8 IN9     IN10     IN11     IN12 IN13
278 3.481817   5   3   6   5   6   3   2   5 4.736068 5.000000 4.848673    5
279 2.676261   6   4   5   4   5   3   2   5 4.000000 4.557963 4.000000    2
280 3.000000   7   4   5   3   7   5   3   7 4.000000 7.000000 7.000000    7
281 3.000000   5   3   6   5   7   4   2   4 3.000000 5.000000 5.000000    7
IN14 IN15 IN16 IN17 IN18 IN19 IN20 IN21 IN22
278 4.894401    4    5    6    3    6    4    5    4
279 3.000000    4    3    4    3    3    3    5    3
280 7.000000    5    6    6    5    7    3    3    4
281 7.000000    2    5    7    7    3    1    7    3
IN1 IN2 IN3 IN4 IN5 IN6 IN7 IN8 IN9     IN10     IN11     IN12 IN13
278 2.366588   5   3   6   5   6   3   2   5 4.498552 5.000000 4.753356    5
279 1.849107   6   4   5   4   5   3   2   5 4.000000 6.114235 4.000000    2
280 3.000000   7   4   5   3   7   5   3   7 4.000000 7.000000 7.000000    7
281 3.000000   5   3   6   5   7   4   2   4 3.000000 5.000000 5.000000    7
IN14 IN15 IN16 IN17 IN18 IN19 IN20 IN21 IN22
278 6.847369    4    5    6    3    6    4    5    4
279 3.000000    4    3    4    3    3    3    5    3
280 7.000000    5    6    6    5    7    3    3    4
281 7.000000    2    5    7    7    3    1    7    3


miceadds documentation built on Dec. 11, 2018, 5:05 p.m.