Description Usage Arguments Value Examples
mice.impute.QAS
is used to prepare the predictQAS
output for mice
1 | mice.impute.QAS(y, ry, x, boot = TRUE, ...)
|
y |
The target variable |
ry |
a logical vector, which indicates the missing values in the target variable |
x |
a data frame with the independent variables |
boot |
if TRUE, a bayesian bootstrap sample is applied |
... |
further objects from other functions |
An object of class mice.impute.QAS is a vector containing the imputed values of the target variable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # generate Data
y <- as.integer(c(1,0,0,0,1,1,1,0,0,1))
x <- c(15,88,90,60,24,30,26,57,69,18)
z <- as.integer(c(3,2,2,1,3,3,2,1,1,3))
example_data <- data.frame(y,x,z)
# deploy QAS.func-Function
result1 <- QAS.func(y~x+z, data=example_data, weights=NULL, seed=NULL, tau=NULL)
# deploy predictQas-Function
result2 <- predictQAS(QAS.res = result1, data=example_data)
# generate logical vector and data frame with independent variables
ry <- c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE)
x <- data.frame(x,z)
# deploy mice.impute.QAS-Funktion
impute <- mice.impute.QAS(y=y, ry=ry, x=example_data, boot=TRUE)
# run mice function
library(mice)
final <- mice(nhanes2,method=c("","pmm","QAS","pmm"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.