center_ipd {maicplus} | R Documentation |
Center individual patient data (IPD) variables using aggregate data averages
Description
This function subtracts IPD variables (prognostic variables and/or effect modifiers) by the aggregate data averages. This centering is needed in order to calculate weights. IPD and aggregate data variable names should match.
Usage
center_ipd(ipd, agd)
Arguments
ipd |
IPD variable names should match the aggregate data names without the suffix. This would involve either changing the aggregate data name or the ipd name. For instance, if we binarize SEX variable with MALE as a reference using dummize_ipd, function names the new variable as SEX_MALE. In this case, SEX_MALE should also be available in the aggregate data. |
agd |
pre-processed aggregate data which contain STUDY, ARM, and N. Variable names should be followed by legal suffixes (i.e. MEAN, MEDIAN, SD, or PROP). Note that COUNT suffix is no longer accepted. |
Value
centered ipd using aggregate level data averages
Examples
data(adsl_sat)
data(agd)
agd <- process_agd(agd)
ipd_centered <- center_ipd(ipd = adsl_sat, agd = agd)