sub-.PanelBalance function

Subset PanelBalance objects

Subset PanelBalance objects

## S3 method for class 'PanelBalance' x[i, ...]

Arguments

  • x: PanelBalance object
  • i: numeric. Specifies which element to extract. Substantively, it specifies which PanelMatch configuration data to extract.
  • ...: Not used

Returns

Returns balance information for specified PanelMatch configuration. Note that results are still returned as a PanelBalance object. In order to return a list, use the [[ operator

Examples

dem$rdata <- runif(runif(nrow(dem))) dem.panel <- PanelData(dem, "wbcode2", "year", "dem", "y") pm.obj <- PanelMatch(lead = 0:3, lag = 4, refinement.method = "mahalanobis", panel.data = dem.panel, match.missing = TRUE, covs.formula = ~ tradewb + rdata + I(lag(tradewb, 1:4)) + I(lag(y, 1:4)), size.match = 5, qoi = "att") # create multiple configurations to compare pm2 <- PanelMatch(lead = 0:3, lag = 4, refinement.method = "ps.match", panel.data = dem.panel, match.missing = TRUE, covs.formula = ~ tradewb + rdata + I(lag(tradewb, 1:4)) + I(lag(y, 1:4)), size.match = 5, qoi = "att") pb <- get_covariate_balance(pm.obj, pm2, include.unrefined = TRUE, panel.data = dem.panel, covariates = c("tradewb", "rdata")) bal.maha <- pb[1] bal.ps <- pb[2]
  • Maintainer: In Song Kim
  • License: GPL (>= 3)
  • Last published: 2025-03-03

Useful links