Stratified Covariate Balancing Using R Farrokh Alemi, PhD
Download Stratified Balancing Note Capital Letters
Load Package into Library
Remove Impossible Values Prepare Your Data Remove Impossible Values Visit after Death Negative ID Zero Blood Pressure Pregnant Males
Predict from Other Variables Prepare Your Data Impute Missing Values Predict from Other Variables Use Mode Use Average No Report No Diagnosis
Prepare Your Data Binary Indicators Initial Analysis Binary Indicators More cases match to controls Use R discretization software Above or below average Worst category vs. all others No report then no diagnosis
Prepare Your Data Binary Indicators Initial Analysis Binary Indicators More cases match to controls Use R discretization software Above or below average Worst category vs. all others No report then no diagnosis
Read Simulated Data Download from Read into directory http://openonlinecourses.com/causalanalysis/simulated%20bundled%20data.csv Read into directory
Look at Data Using fix(data)
Select Subset of Data for Analysis Data should list only treatment and covariates to be balanced
Don’t Stratify Variables on Causal Path Examine sequence of events Avoid complications of treatment Don’t stratify mediators Conduct Collider Tests
Balance Data > balanced=stratadisc(4,5,subset)
Common Odds Ratio does not include one so it is significant Balance Data Common Odds Ratio does not include one so it is significant
In large data, effect size should at least doubling Balance Data In large data, effect size should at least doubling
60% of cases matched to controls Balance Data 60% of cases matched to controls
Check the Strata You Created # Check the strata you have created fix(balanced)
Check Balance
Conduct Sensitivity Analysis # Sensitivity analysis of treatment in column 4 # Outcome in column 5 # In data set called subset revised=sensdisc(4,5,subset) revised