Skip to contents

Estimates the coefficients of a marginal structural model (MSM) using Target Aggregate Data Adjustment (TADA) Transportability Analysis in a transportability analysis.

Usage

transportTADA(
  msmFormula,
  propensityScoreModel = NULL,
  matchingCovariates = NULL,
  propensityWeights = NULL,
  participationWeights = NULL,
  treatment = NULL,
  response = NULL,
  family = stats::gaussian,
  method = c("logistic", "probit", "loglog", "cloglog", "cauchit"),
  exOpt = list(propensity = NULL, participation = NULL, final = NULL),
  studyData,
  aggregateTargetData,
  bootstrapNum = 100
)

Arguments

msmFormula

A formula for the MSM to be fitted, which usually includes the outcome, the treatment and any effect modifiers.

propensityScoreModel

Either a formula or a glm object representing the model for treatment assignment given covariates.

matchingCovariates

A vector of user-specified covariates which are used for the data matching to obtain participation weights when no custom weights provided.

propensityWeights

Vector of custom weights balancing covariates between treatments. Providing them will override the formula or model provided by propensityScoreModel. This vector should have as any entries as the sample size of the study data.

participationWeights

Vector of custom weights balancing effect modifiers between study and target populations. This vector should have as any entries as the sample size of the study data.

treatment

String indicating name of treatment variable. If NULL, it will be auto-detected from propensityScoreModel if provided; otherwise it will remain NULL. Note that when using custom weights, treatment should be provided so that summary.transportTADA and plot.transportTADA works.

response

String indicating name of response variable. If NULL, it will be auto-detected form msmFormula.

family

Either a family function as used for glm such as stats::gaussian(), or one of c("coxph", "survreg", "polr").

method

Link function used for polr, one of c("logistic", "probit", "loglog", "cloglog", "cauchit").

exOpt

A list with components propensity, participation and final. Each component specifies whether weights should be trimmed or truncated. Use the functions trim and trunc to specify trimming/truncation. Note that only truncation is supported for final weights.

studyData

The individual participant data (IPD) of study population.

aggregateTargetData

The aggregate-level data (AgD) of target population. Ensure that: 1. Name columns of mean of continuous variables or proportion of binary variable baselines exactly the same as the column names in the study (IPD) data; 2. Only continuous variables are allowed to consider matching standard deviation (SD) and name the SD column as "variable_SD" in the aggregateTargetData; 3. Use one of the following allowable suffixes: MEAN, MEDIAN, SD, PROP, COUNT. The column N should be included for the sample size.

bootstrapNum

Number of bootstrap datasets to simulate to obtain robust variance estimate.

Value

A transportTADA object containing the following components:

  • msm: Raw model fit object for MSM of class glm, survreg and coxph, with the correct variance estimators appropriately replaced. If of class glm, it will have an extra var component containing the correct variance estimates.

  • propensityScoreModel: Model of treatment assignment, NULL if not provided and custom propensity weights are used.

  • propensityWeights: Propensity weights used. When not NULL, it will be used as custom inputs from user. When NULL, it will be obtained by logistic regression.

  • participationWeights: Participation Weights used. When not NULL, it will be used as custom inputs from user. When NULL, it will be obtained by Method of Moments-based method.

  • participationWeightCalculation: The object contains participation weights calculation results.

  • participationWeightSummary: The summary results related to participation weights such as effect sample sizes and so on as the information for the visualization legend.

  • finalWeights: Weights used to fit MSM.

  • customPropensity: Boolean indicating whether custom propensity weights are used.

  • customParticipation: Boolean indicating whether custom participation weights are used.

  • treatment: String indicating the variable name of treatment.

  • response: String indicating the variable name of response.

  • studyData: The original individual participant data (IPD) of study population.

  • aggregateTargetData: The aggregate-level data (AgD) of target population.

  • processedIPD: The individual participant data (IPD) after analytically pre-processing in format and calibration. All the ordinal variables have been dummized. NULL when customParticipation is TRUE.

  • processedAgD: The aggregate-level data (AgD) after analytically pre-processing in format and calibration. NULL when customParticipation is TRUE.

  • matchingCovariates: A vector of user-specified covariates which are used for the data matching to obtain participation weights when no custom weights provided.

  • centeredStudyData: The data frame with both the processed study data and centered study data.

  • exOpt: Provided exOpt argument.

Details

The function fits models of treatment assignment and study participation in order to calculate the weights used to fit the MSM. For the propensity score model, if a formula is provided, logistic regression is used by default. If a glm object is provided, the function extracts the necessary weights from the object. The function does not support other weighting methods, so if they are required, provide custom weights. The weights that adjust for effect modifiers are calculated in a manner analogous to matching-adjusted indirect comparison (MAIC) (Phillipo et al., 2018); this is supported by helper functions based on those used in the maicplus package (Chen et al., 2024).

The MSM-fitting functions do not provide correct standard errors as-is. Bootstrap is used to calculate robust bootstrap variance estimators of the parameter estimators. The function replaces the variance component in summary.glm, coxph and survreg with the robust variance estimators directly. This does not seem to behave well with predict.glm yet, but prediction is not of primary interest in a transportability analysis.

Ensure the binary variables are labelled as 0-1 format.

References

Chen G, Seo M, Gravestock I (2024). maicplus: Matching Adjusted Indirect Comparison. R package version 0.1.1, https://CRAN.R-project.org/package=maicplus.

Phillippo DM, Ades AE, Dias S, Palmer S, Abrams KR, Welton NJ. Methods for Population-Adjusted Indirect Comparisons in Health Technology Appraisal. Medical Decision Making. 2018;38(2):200-211. doi:10.1177/0272989X17725740