From 4ec3675c96b9ae9ecaf988e544714396348b00af Mon Sep 17 00:00:00 2001 From: Gregory Chen Date: Fri, 21 Jul 2023 13:55:30 +0000 Subject: [PATCH] update Rd --- man/check_weights.Rd | 12 ++++++++---- man/plot_weights.Rd | 11 ++++++++++- man/process_agd.Rd | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/man/check_weights.Rd b/man/check_weights.Rd index b4bdf9be..c3e0c916 100644 --- a/man/check_weights.Rd +++ b/man/check_weights.Rd @@ -4,14 +4,18 @@ \alias{check_weights} \title{Check to see if weights are optimized correctly} \usage{ -check_weights(optimized, match_cov, digits = 2) +check_weights( + optimized, + processed_agd, + mean_digits = 2, + prop_digits = 2, + sd_digits = 3 +) } \arguments{ \item{optimized}{object returned after calculating weights using \code{\link{estimate_weights}}} -\item{match_cov}{covariates that should be checked to see if the IPD weighted average matches the aggregate data -average. This could be same set of variables that were used to match or it can include variables that were not -included to match (i.e. stratification variables)} +\item{processed_agd}{a data frame, object returned after using \code{\link{process_agd}} or aggregated data following the same naming convention} \item{digits}{number of digits for rounding summary table} } diff --git a/man/plot_weights.Rd b/man/plot_weights.Rd index 684faee3..822d59db 100644 --- a/man/plot_weights.Rd +++ b/man/plot_weights.Rd @@ -4,11 +4,20 @@ \alias{plot_weights} \title{Plot MAIC weights in a histogram with key statistics in legend} \usage{ -plot_weights(wt, main_title = "Unscaled Individual Weights") +plot_weights( + wt, + bin_col = "#6ECEB2", + vline_col = "#688CE8", + main_title = "Unscaled Individual Weights" +) } \arguments{ \item{wt}{a numeric vector of individual MAIC weights (derived using \code{\link{estimate_weights}})} +\item{bin_col}{a string, color for the bins of histogram} + +\item{vline_col}{a string, color for the vertical line in the histogram} + \item{main_title}{a character string, main title of the plot} } \value{ diff --git a/man/process_agd.Rd b/man/process_agd.Rd index 65fb9a3a..7dc640c4 100644 --- a/man/process_agd.Rd +++ b/man/process_agd.Rd @@ -18,11 +18,29 @@ This function checks the format of the aggregate data. Data is required to have three columns: STUDY, ARM, and N. Column names that do not have legal suffixes (MEAN, MEDIAN, SD, COUNT, or PROP) are dropped. If a variable is a count variable, it is converted to proportions by dividing the sample size (N). +Note, when the count is specified, proportion is always calculated based on the count, that is, +specified proportion will be ignored if applicable. If the aggregated data comes from multiple sources (i.e. different analysis population) and sample size differs for each variable, one option is to specify proportion directly instead of count by using suffix _PROP. } \examples{ +# example +target_pop <- read.csv(system.file("extdata", "aggregate_data_example_1.csv", + package = "maicplus", mustWork = TRUE +)) +target_pop2 <- read.csv(system.file("extdata", "aggregate_data_example_2.csv", + package = "maicplus", mustWork = TRUE +)) +target_pop3 <- read.csv(system.file("extdata", "aggregate_data_example_3.csv", + package = "maicplus", mustWork = TRUE +)) + +target_pop <- process_agd(target_pop) +target_pop2 <- process_agd(target_pop2) +target_pop3 <- process_agd(target_pop3) + +# another example target_pop <- data.frame( STUDY = "Study_XXXX", ARM = "Total",