R package for calculating Inverse Probability of Treatment Weights
- This package calculates various measures of association and helps understand and visualize the link between causal models such as Marginal Structural Models and Standerdized measures.
Loading the package
Pulling the help file
Using this package
r1 <- .9 # Risk of the treated subjects
r0 <- .5 # Risk of the untreated subjects
# Calculates risk measures
form.table.object <- form.table(Y1A1L1=150,
# Forms the crude, stratified tables suitable
# for using in other functions of this package.
ungrouped.data.object <- ungrouped.data(form.table.object)
# Creates ungrouped data suitable for performing regression on it
# Calculates measures of associations
# Calculates Standardized measures
iptw(form.table.object, type = "sw")
# Standardized measures are calculated by this function
# using inverse probability of treatment weights (IPTW).
iptw.regression(form.table.object, type = "sw")
# Calculates IPTW estimates from regression
# requires grid and survey package
graph(form.table.object, type = "sw")
# Maps probabilities and frequesncies
- Ehsan Karim Feel free to report any errors / update suggestions.