Description Usage Arguments Details Value Author(s) See Also Examples
This function adds (or modifies) a "MISSING" flag to a dataset to simulate a missing completely at random behaviour.
1 2 3 4 5 | createMCAR(data,
prop = 0,
rule,
seed = .deriveFromMasterSeed(),
flagName = getEctdColName("Missing"))
|
data |
(Required) Data frame to which to add missingness |
prop |
(Optional) proportion of missingness between 0 and 1. The default is "0" (so no missingness is generated) |
rule |
(Optional) Only observations matching the rule can be flagged as missing. Be default, all observations are available to be missing |
seed |
(Optional) Random seed to use. Based on the current random seed by default |
flagName |
(Optional) name of the missing flag ("MISSING" by default) |
The missing data is either added to the dataset or modified if it already exist. In the latter case, the function only overwrites data that is not already missing.
the data
argument to which a MISSING flag is added or modified.
Mike K Smith mstoolkit@googlemail.com
createDropout
for drop out missingness.
parseRangeCode
to handle the rule
argument.
1 2 3 4 5 6 7 8 9 10 11 |
myData <- data.frame(
SUBJ = rep(1:3, each = 3),
TIME = rep(0:2, 3) )
createMCAR( myData, prop = 0.1, rule = "TIME > 0")
## Not run:
## more examples in the unit tests
file.show( system.file( "Runit", "runit.data.missing.R" , package = "MSToolkit") )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.