SumStat_sga: Calculate summary statistics for propensity score weighting...

View source: R/SumStat_sga.R

SumStat_sgaR Documentation

Calculate summary statistics for propensity score weighting in the subgroups

Description

SumStat_sga is used to generate distributional plots of the estimated propensity scores and balance diagnostics after propensity score weighting.

Usage

SumStat_sga(
  subgroup = NULL,
  xname = NULL,
  ps.formula = NULL,
  ps.estimate = NULL,
  trtgrp = NULL,
  zname = NULL,
  yname = NULL,
  data = NULL,
  weight = "overlap",
  method = "glm"
)

Arguments

subgroup

a vector to specify name of subgroup variables by column index or column names

xname

an optional character vector specifying the name of the covariates (confounders) in data. Only continuous and factors are accepted.

ps.formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the propensity score model to be fitted. Additional details of model specification are given under "Details". This argument is optional if ps.estimate is not NULL.

ps.estimate

an optional matrix or data frame containing estimated (generalized) propensity scores for each observation. Typically, this is an N by J matrix, where N is the number of observations and J is the total number of treatment levels. Preferably, the column names of this matrix should match the names of treatment level, if column names are missing or there is a mismatch, the column names would be assigned according to the alphabatic order of treatment levels. A vector of propensity score estimates is also allowed in ps.estimate, in which case a binary treatment is implied and the input is regarded as the propensity to receive the last category of treatment by alphabatic order, unless otherwise stated by trtgrp.

trtgrp

an optional character defining the "treated" population for estimating the average treatment effect among the treated (ATT). Only necessary if weight = "ATT". This option can also be used to specify the treatment (in a two-treatment setting) when a vector argument is supplied for ps.estimate. Default value is the last group in the alphebatic order.

zname

an optional character specifying the name of the treatment variable in data.

yname

an optional vector of characters including the names of outcome in data.

data

an optional data frame containing the variables in the propensity score model. If not found in data, the variables are taken from environment(formula).

weight

a character or vector of characters including the types of weights to be used. "ATE" specifies the inverse probability weights for estimating the average treatment effect among the combined population. "ATT" specifies the weights for estimating the average treatment effect among the treated. "ATO" specifies the (generalized) overlap weights for estimating the average treatment effect among the overlap population, or population at clinical equipoise. Default is "ATO".

method

a character to specify the method for propensity model. When ps.formula is given, "glm" is the default; When cov is given, "LASSO" is the default.

Details

A typical form for ps.formula is treatment ~ terms where treatment is the treatment variable (identical to the variable name used to specify zname) and terms is a series of terms which specifies a linear predictor for treatment. ps.formula specifies logistic or more flexible models for estimating the propensity scores, when ps.estimate is NULL.

When comparing two treatments, ps.estimate can either be a vector or a two-column matrix of estimated propensity scores. If a vector is supplied, it is assumed to be the propensity scores to receive the treatment, and the treatment group corresponds to the last group in the alphabetic order, unless otherwise specified by trtgrp. In general, ps.estimate should have column names that indicate the level of the treatment variable, which should match the levels given in Z. If column names are empty or there is a mismatch, the column names will be created following the alphabetic order of values in Z, and the rightmost column of ps.estimate is assumed to be the treatment group, when estimating ATT. trtgrp can also be used to specify the treatment group for estimating ATT.

The argument zname and/or yname is required when ps.estimate is not NULL.

Current version of PSweight_sga allows for three types of propensity score weights used to estimate ATE, ATT and ATO. These weights are members of larger class of balancing weights defined in Li, Morgan, and Zaslavsky (2018). The overlap weights can also be considered as a data-driven continuous trimming strategy without specifying trimming rules, see Li, Thomas and Li (2019). Additional details on balancing weights and generalized overlap weights for multiple treatment groups are provided in Li and Li (2019).

The variance will be calculated by nonparametric bootstrap, with R bootstrap replications. The default of R is 50.

Value

SumStat_sga returns a SumStat_sga object including a list of the following value: treatment group, propensity scores, propensity score weights, effective sample sizes, and balance statistics.

trtgrp

a character indicating the treatment group.

propensity

a data frame of estimated propensity scores.

ps.weight

a data frame of propensity score weights.

ASD

a table including absolute standardized mean differences in the overall sample and subgroups after weighting.

ASD_bs

a table including absolute standardized mean differences in the overall sample and subgroups before weighting.

vif

a vector indicating the approximated variance inflation in the overall sample and subgroups after weighting, see Yang et al. (2021)

nsubg

a vector indicating the subgroup sample sizes.

ess

a table of effective sample sizes. This serves as a conservative measure to characterize the variance inflation or precision loss due to weighting, see Yang et al. (2021).

subgoup

a vector indicating name of the specified subgroups.

method

a character indicating the propensity score method used.

nonzero_coef

a vector indicating the terms selected by LASSO. Only available when method is LASSO.

References

Yang, S., Lorenzi, E., Papadogeorgou, G., Wojdyla, D. M., Li, F., & Thomas, L. E. (2021). Propensity score weighting for causal subgroup analysis. Statistics in medicine, 40(19), 4294-4309.

Li, F., Morgan, K. L., Zaslavsky, A. M. (2018). Balancing covariates via propensity score weighting. Journal of the American Statistical Association, 113(521), 390-400.

Li, F., Thomas, L. E., Li, F. (2019). Addressing extreme propensity scores via the overlap weights. American Journal of Epidemiology, 188(1), 250-257.


siyunyang/PSweight.sga documentation built on Aug. 16, 2022, 5:23 a.m.