plot_SMD_matching {debiasedTrialEmulation}R Documentation

Plot Standardized Mean Differences (SMD) for Matching

Description

Generates a plot of standardized mean differences before and after propensity score matching.

Generates a plot showing the distribution of preference scores to assess equipoise after matching.

Generates an SMD plot to compare balance before and after stratification.

Generates a plot showing the distribution of preference scores to assess equipoise after stratification.

Generates an SMD plot to compare balance before and after propensity score weighting.

Generates a plot showing the distribution of preference scores to assess equipoise after weighting.

Creates a plot of propensity score distributions using density or histogram visualization.

Creates a plot showing the top covariates with the largest standardized mean differences before and after matching.

Usage

plot_SMD_matching(m.out)

plot_Equipoise_matching(data, m.out)

plot_SMD_stratification(stratifiedPop, xvars)

plot_Equipoise_stratification(data)

plot_SMD_weighting(data)

plot_Equipoise_weighting(data)

plotPs(
  data,
  unfilteredData = NULL,
  scale = "preference",
  type = "density",
  binWidth = 0.05,
  targetLabel = "Target",
  comparatorLabel = "Comparator",
  showCountsLabel = FALSE,
  showAucLabel = FALSE,
  showEquiposeLabel = FALSE,
  equipoiseBounds = c(0.3, 0.7),
  unitOfAnalysis = "subjects",
  title = NULL,
  fileName = NULL
)

plotCovariateBalanceOfTopVariables(
  balance,
  n = 20,
  maxNameWidth = 100,
  title = NULL,
  fileName = NULL,
  beforeLabel = "before matching",
  afterLabel = "after matching"
)

Arguments

unfilteredData

A logical indicating whether to include unfiltered data in the plot.

maxNameWidth

An integer specifying the maximum width for variable names.

m.out

The output from 'MatchIt', containing matched data.

data

A dataset containing treatment and propensity scores.

stratifiedPop

The dataset containing stratified propensity scores.

xvars

The covariate names to assess balance.

scale

The scale to use: "preference" or "propensity".

type

The type of plot: "density", "histogramCount", or "histogramProportion".

binWidth

The bin width for histograms (default = 0.05).

targetLabel

Label for the treated group.

comparatorLabel

Label for the control group.

showCountsLabel

Logical; whether to show sample counts.

showAucLabel

Logical; whether to show AUC.

showEquiposeLabel

Logical; whether to indicate equipoise range.

equipoiseBounds

A numeric vector of two values defining the equipoise range (default = c(0.3, 0.7)).

unitOfAnalysis

Unit label for counts (e.g., "subjects").

title

Optional title for the plot.

fileName

Optional file name to save the plot.

balance

A data frame containing standardized mean differences.

n

Number of top covariates to display.

beforeLabel

Label for pre-matching imbalance.

afterLabel

Label for post-matching balance.

Value

A 'ggplot2' object showing balance improvement after matching.


[Package debiasedTrialEmulation version 0.1.0 Index]