Estimation functions

estimate_ipwrisk()

Estimates the cumulative risk with time-varying predictors of censoring using inverse-probability weighted estimating functions

estimate_gcomprisk()

Estimates the cumulative risk of a right-censored outcome using a g-computation estimator.

estimate_aipwrisk()

Estimates the cumulative risk of a right-censored outcome using an augmented inverse probability weighted estimator.

estimate_ipwhr()

Estimates the hazard ratio of a treatment with time-varying predictors of censoring using inverse-probability weighted estimating functions

re_estimate()

A generic function to refit/re-estimate parameters described in a result object

compare_fits()

compare_fits: a function for computing the difference and 95% confidence interval between fit object point estimates using bootstrap estimates to generate a standard error

Table-making functions

make_table1()

Makes a unweighted or IP weighted Table 1

make_table2()

Create a table 2 displaying information such as the number of subjects, total amount of observed person-time, number of events, estimates and effect measures of interest, and confidence intervals.

make_wt_summary_table()

Summarizes weights from a set of objects that inherit from class ipw

extreme_weights()

Creates a table of the most extreme weights from an ipw object

Plotting functions

plot(<hr>) plot(<cumcount>) plot(<cumrisk>)

Plot a panel of (possibly overlayed) estimates of interest or effect measures and associated confidence intervals

hist(<ipw>)

Plots a panel of propensity score histograms

forest_plot(<cumrisk>)

Produces a forest plot of cumulative risks or measures of effect

forest_plot(<hr>)

Forest plot method for classes inheriting hr

Model specification functions

specify_models()

Specifies the data structure and models for a data set

identify_outcome()

Helper function for identifying an outcome variable for a model_specification object

identify_censoring()

Helper function for identifying a censoring variable for a model_specification object

identify_treatment()

Helper function for identifying a treatmement for a model_specification object

identify_competing_risk()

Helper function for adding a competing risk feature to a model_specification object

identify_subject()

Helper function for adding a subject identifier feature to a model_specification object

identify_interval()

Helper function for identifying start and stop times for observations in a longitudinal data structure

identify_missing()

Helper function for activating missing data weighting for a model_specification object

Functions to modify model specification in a result object

update_treatment()

Updates the treatment information in a result object for later re-estimation

update_censoring()

Updates the censoring information in a result object for later re-estimation

update_outcome()

Updates the outcome information in a result object for later re-estimation

update_missing()

Updates the missingness information in a result object for later re-estimation

subgroup()

Updates a result object with a subgroup for later re-estimation.

Miscellaneous functions used internally

StatStepribbon

ggplot2 geom to create stairstep confidence bands for cumulative risk estimates

boot_vector_create()

Function that creates a vector of bootstrap resampling weights

check_arguments()

Checks standard arguments to estimation functions

compare_protocols()

Estimating cumulative risk across a list of treatment protocols

compute_cumcount_ci()

Computes confidence intervals for cumulative count estimates

compute_cumcount_effect_ci()

Computes confidence intervals for functions of cumulative count estimates

compute_cumrisk_ci()

Computes confidence intervals for cumulative risk estimates

compute_cumrisk_effect_ci()

Computes confidence intervals for functions of cumulative risk estimates

create_censoring_indicators()

Builds a matrix of censoring indicators for a set of variables.

create_censoring_indicators_timevar_old()

Builds a matrix of censoring indicators for a set of variables.

cumriskdif_ci()

Computes cumulative risk differences and confidence intervals

cumriskrr_ci()

Computes cumulative risk differences and confidence intervals

estimate_aipwrisk_efficient()

Estimates the cumulative risk of a right-censored outcome using

estimate_censor_coxph()

estimate_censor_coxph: a function to estimate a censoring probability using coxph

estimate_censor_cph()

estimate_censor_cph: a function to estimate a censoring probability using cph

estimate_censoring_prob()

estimate_censoring_prob: a function to estimate a probability a patient will be uncensored

estimate_ipwcount()

Estimates the cumulative count with time-varying predictors of censoring using inverse-probability weighted estimating functions

estimate_ipweights()

Estimates the inverse_probability weights when no outcome is specified

estimate_missing_glmnet()

estimate_missing_glmnet: a function to estimate a missingness probability using logistic regression

estimate_missing_prob()

estimate_missing_prob: a function to estimate a missingness probability

estimate_outcome_coxph()

estimate_outcome_coxph: a function to estimate outcome probabilities at times in new data using coxph

estimate_outcome_cph()

estimate_outcome_cph: a function to estimate an outcome risk using cph function in R

estimate_ps()

estimate_ps: a function to estimate a propensity score

estimate_ps_glm()

estimate_ps_glm: a function to estimate a propensity score using glm logistic regression

estimate_ps_glmnet()

estimate_ps_glmnet: a function to estimate a propensity score using logistic regression

estimate_rates()

Estimates crude event rates

inspect_ipw_weights()

Extract the weights from a fitted IP weighted risk object

find_covs()

find_covs: a function to identify covariates used in a model

find_empty()

find_empty: a function to identify factors that only have individuals in a single level

find_missing()

find_missing: a function to identify rows with missing data and variables that have missing values

fit_coxph()

fit_coxph: a function to fit a coxph model

forest_plot()

A generic function to produce of forest plot estimates from results objects

identify_count()

Helper function for identifying a count variable for a model_specification object

initializer()

Standard set-up needed by estimating functions

is.aipw()

is.aipw: a function for checking whether an object inherits from aipw

is.boot_est()

is.boot_est: a function for checking whether an object inherits from boot_est

is.cumcount()

is.cumcount: a function for checking whether an object inherits from cumcount

is.cumrisk()

is.cumrisk: a function for checking whether an object inherits from cumrisk

is.gcomp()

is.gcomp: a function for checking whether an object inherits from gcomp

is.ipw()

is.ipw: a function for checking whether an object inherits from ipw

is.hr()

is.hr: a function for checking whether an object inherits from hr

is.model_specification()

is.model_specification: a function for checking whether an object inherits from model_specification

logit_ps_est()

A function to estimate a propensity score using logistic regression

named_list()

Function to return a named list

plot(<hr>) plot(<cumcount>) plot(<cumrisk>)

Plot a panel of (possibly overlayed) estimates of interest or effect measures and associated confidence intervals

plot_boot_cumrisk()

Plots a panel of (possibly overlayed) cumulative risk functions or cumulative risk differences and confidence intervals.

predict(<survfit>)

Predict probabilities from a survfit object

print(<result>)

Provides a print method for result objects

re_estimate(<cumcount>)

Re-estimates a result object after elements of the model_specifaction have been modified.

re_estimate(<cumrisk>)

Re-estimates a result object after elements of the model_specifaction have been modified.

re_estimate(<no_outcome>)

Re-estimates a no_outcome object after elements of the model_specifaction have been modified.

sim()

Iterates a simulation function design to assess bias across different boostrap procedures

sim_eval()

Evaluates the result of a simulation study

sim_func1()

Simulates a simple data structure with potential confounding from two variables, dependent censoring, and a competing risk

smd()

Compute a standardized mean difference for two groups

stack_cumcount()

Stack cumulative count curves from each treatment group in a results object (or list of objects) in a matrix

stack_cumcount_boot()

Stack bootstrapped cumulative count curves from each treatment group in a results object (or list of objects) in a matrix

stack_cumrisk()

Stack cumulative risk curves from each treatment group in a results object (or list of objects) in a matrix

stack_cumrisk_boot()

Stack bootstrapped cumulative risk curves from each treatment group in a results object (or list of objects) in a matrix

table2_helper_cumcount()

Helper function for make_table2.cumcount

table2_helper_cumrisk()

Helper function for make_table2.cumrisk

trim_ps()

Function for symmetric trimming predicted probabilites

update_count()

Updates the count information in a result object for later re-estimation

update_label()

Updates the label in a result object

wt_comp()

Computes treatment weights

hr_data()

Extract hazard ratios, confidence intervals and subgroup labels

Datasets

actg

AIDS Clinical Trial Group (ACTG) Study Dataset

example1

Simulated example right censored data with confounding and dependant censoring.

example1_timevar

Simulated example right censored data with confounding, dependant censoring, and time-varying covariates.

example2

Simulated example data for ipwrisk

example3

Simulated example data for demonstration of the IPMW functionality of causalRisk

example4

Simulated example data for demonstration of the cumulative count functionality of causalRisk

leukemia

Leukemia Data Set

wihs

WIHS Data Set