runSimulation: Run a simulation with a specified caliper width, risk...

Description Usage Arguments Value

View source: R/runSimulation.R

Description

This runs a simulation that creates N data sets, each of size 10,000, that have a specified risk difference and covariate distribution. Propensity score matching with a caliper derived from the one given gamma is then conducted and the risk difference in the full and matched data sets is estimated. The average estimated risk difference for the full and matched data sets is reported, as well as the bias reduction of matching and the MSE of the matched estimator. The mean and variance of the time it took to generate 1 data set, match, and calculate risk differences is also reported.

Usage

1
2
3
4
5
6
7
8
9
runSimulation(
  gamma,
  N,
  true_risk_diff,
  cov_dist,
  alpha_0_treat,
  alpha_0_outcome,
  beta
)

Arguments

gamma

The caliper width in terms of pooled standard deviations

N

The number of data sets to generate within the simulation

true_risk_diff

The desired treated risk minus control risk

cov_dist

The covariate distribution. An integer 1-5 or one of the following: 'Ind Norm', 'Corr Norm', '5 Bern', '9 Bern', '10 Bern'

alpha_0_treat

The calculated value of alpha_0_treat, obtained from calcAlpha0()

alpha_0_outcome

The calculated value alpha_0_outcome, obtained from calcAlpha0()

beta

The calculated value of beta, obtained from calcBeta()

Value

A named vector containing the gamma value used, MSE of the matched estimator, the bias reduction of using the matched estimator, the average estimate from the full data, the average estimate from the matched data, the average time to go through one data set, and the variance of the times to go through one data set.


kkbrum/PSMOptimalCalipers documentation built on Dec. 21, 2021, 6:45 a.m.