Generate Marginal Distributions for a given data frame
get_marginal_distributions.Rd
Generate Marginal Distributions from a given data frame with options to specify which variables to use.
Usage
get_marginal_distributions(df, variables = c(), print = FALSE)
Details
A function to generate marginal distributions from a given data frame, depending on the variable type the marginals will differ, for binary variables a mean and number of missing is generated for continuous variables, they are first transformed and both mean and sd of the transformed variables are stored along with the quantile mapping for back transformation. For categorical variables, the number of each category is stored, missing values are categorise as "missing".
Examples
marginal_distributions <- get_marginal_distributions(
IST,
variables <- c(
"SEX",
"AGE",
"ID14",
"RSBP",
"RATRIAL"
)
)