summarizeNA {LMMstar} | R Documentation |
Summarize missing data patterns
Description
Summarize missing data patterns.
Usage
summarizeNA(
data,
repetition = NULL,
sep = "",
newnames = c("variable", "frequency", "missing.pattern", "n.missing"),
keep.data = TRUE
)
Arguments
data |
[data.frame] dataset containing the observations. |
repetition |
[formula] Specify the structure of the data when in the long format: the time/repetition variable and the grouping variable, e.g. ~ time|id. When specified the missing data pattern is specific to each variable not present in the formula. |
sep |
[character] character used to separate the missing data indicator (0/1) when naming the missing data patterns. |
newnames |
[character vector of length 4] additional column containing the variable name (only when argument |
keep.data |
[logical] should the indicator of missing data per variable in the original dataset per pattern be output. |
Value
a data frame
See Also
autoplot.summarizeNA
for a graphical display.
Examples
#### display missing data pattern (wide format) ####
data(gastricbypassW, package = "LMMstar")
e.SNA <- summarizeNA(gastricbypassW)
plot(e.SNA)
summarizeNA(gastricbypassW, keep.data = FALSE)
#### display missing data pattern (long format) ####
## example 1
data(gastricbypassL, package = "LMMstar")
e.SNAL <- summarizeNA(gastricbypassL, repetition = ~time|id)
plot(e.SNAL, variable = "glucagonAUC")
## example 2
data(calciumL, package = "LMMstar")
mp <- summarizeNA(calciumL, repetition = ~visit|girl)
plot(mp, variable = "bmd")
summarizeNA(calciumL[,c("visit","girl","bmd")], repetition = ~visit|girl)
## example 3
data(vasscoresW, package = "LMMstar")
summarizeNA(vasscoresW)