Description Usage Arguments Details Value Author(s) References See Also Examples
The weightitmice.data()
function extracts data from an object of the wimids
class.
1 | weightitmice.data(object, n = 1)
|
object |
This argument specifies an object of the |
n |
This argument specifies the weighted imputed dataset number, intended to extract its data. The input must be a positive integer. The default is |
The weighted datasets within the wimids
class object are extracted.
This function returns the imputed dataset after weighting with weights of observations included in the dataset (listed as the inverse.weights
variables).
Farhad Pishgar
Daniel Ho, Kosuke Imai, Gary King, and Elizabeth Stuart (2007). Matching as Nonparametric Preprocessing for Reducing Model Dependence in Parametric Causal Inference. Political Analysis, 15(3): 199-236. http://gking.harvard.edu/files/abs/matchp-abs.shtml
1 2 3 4 5 6 7 8 9 10 11 12 13 | #Loading the dataset
data(dataset)
#Multiply imputing the missing values
imputed.datasets <- mice(dataset, m = 5, maxit = 10,
method = c("", "", "", "mean", "polyreg", "logreg", "logreg", "logreg"))
#Estimating weights of observations in the multiply imputed datasets
weighted.datasets <- weightitmice(OSP ~ AGE + SEX + BMI + RAC + SMK, imputed.datasets,
approach = 'within', method = 'nearest')
#Extracting the first imputed dataset
weighted.dataset.1 <- weightitmice.data(weighted.datasets, n = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.