Learn R Programming

PSsurvival (version 0.2.0)

validate_PSsurvdiff_inputs: Validate All Inputs for PSsurvdiff

Description

Umbrella function that calls all validation functions and returns the cleaned dataset with complete cases ready for model fitting.

Usage

validate_PSsurvdiff_inputs(
  data,
  ps_formula,
  censor_formula,
  weight_method,
  censor_method,
  trim_alpha,
  trim_q,
  time_points,
  conf_level,
  ps_control,
  censor_control,
  bootstrap_control
)

Value

A list containing:

data_clean

Data frame with complete cases only

treatment_var

Character string of treatment variable name

time_var

Character string of time variable name (possibly an expression)

event_var

Character string of event variable name (possibly an expression)

censor_formula

The validated censoring formula, or NULL if no censoring adjustment was requested (i.e., original formula had RHS of 0)

n_complete

Integer, number of complete cases used in analysis

Arguments

data

A data.frame containing the analysis data.

ps_formula

Formula object for propensity score model.

censor_formula

Formula object for censoring model.

weight_method

Character string specifying weighting method.

censor_method

Character string specifying censoring method.

trim_alpha

Numeric, symmetric trimming threshold.

trim_q

Numeric, asymmetric trimming quantile.

time_points

Numeric vector or NULL.

conf_level

Numeric, confidence level.

ps_control

List of PS model control parameters.

censor_control

List of censoring model control parameters.

bootstrap_control

List of bootstrap control parameters or NULL.