View source: R/simulateDatav02.R
simulateMissDfYorX | R Documentation |
This function generates missing covariate or missing responses data. The missing data generation in the last two supplied covariates will be generated based on a predefined mechanisms. Missing data generation in the response variable will be based on the suppilied true alpha.
simulateMissDfYorX(
dataCov,
truebeta = c(1, -1, 1, 5),
truealpha = c(-1, 5, -1, -1, -1, 0.01),
x2Mar = c(1, -1, -1),
ymiss = FALSE,
nsim = 1
)
dataCov |
input data, the default number of covariates is 7 (5+2) |
truebeta |
the beta parameter to be used to generate binary responses 1/0 s |
truealpha |
to be used to generate nonignorable missing values based on the model |
x2Mar |
to be used to generate missing values in x2 based on the model |
ymiss |
to be used for missing responses, default is FALSE |
nsim |
number of simulated dataset, default is 2 |
returns a list with original data called originalData and a data with imputed missing values dataMissing
demo_df <- simulateCovariateData(100, nCov=6)
simulated_df <- simulateMissDfYorX(demo_df, nsim=2)
testMissData <- simulated_df$dataMissing
head(testMissData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.