reportCovariates | R Documentation |
This function calculates the raw, target and achieved covariates given a set of weights. Note that for mean values, bootstrapped standard errors are used and so downstream values (such as p-values for difference) may differ from run to run if the random number stream is not consistent
reportCovariates( index, target, dictionary, matching.variables, weights, tidy = TRUE, var.method = c("ML", "unbiased") )
index |
A matrix or data.frame containing patient-level data |
target |
A list containing target summary data |
dictionary |
A data frame containing the columns "match.id", "target.variable", "index.variable" and "match.type" |
matching.variables |
A character vector indicating the match.id to use |
weights |
A numeric vector with weights corresponding to the index data rows |
tidy |
A boolean - return as a data frame (otherwise list) |
var.method |
Estimator type passed through to |
An object of class maic.covariates
target <- c("Air.Flow" = 60, "Water.Temp" = 21, "Prop.Acid.Conc.LT.90" = 0.7, "min.air.flow" = 55) stackloss$match.conc.lt.90 <- ifelse(stackloss$Acid.Conc. < 90, 1, 0) dict <- data.frame( "match.id" = c("airflow", "watertemp", "acidconc", "min.airflow"), "target.variable" = c("Air.Flow", "Water.Temp", "Prop.Acid.Conc.LT.90", "min.air.flow"), "index.variable" = c("Air.Flow", "Water.Temp", "match.conc.lt.90", "Air.Flow"), "match.type" = c("mean", "mean", "proportion", "min"), stringsAsFactors = FALSE) ipmat <- createMAICInput( index = stackloss, target = target, dictionary = dict, matching.variables = c("airflow", "watertemp", "acidconc", "min.airflow")) wts <- maicWeight(ipmat) rcv <- reportCovariates( stackloss, target, dict, matching.variables = c("airflow", "watertemp", "acidconc", "min.airflow"), wts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.