fit_trt_spec_reg {drord}R Documentation

Helper function to fit a treatment specific outcome regression. If there are more than 2 observed levels of the outcome for the specified treatment arm, then polr is used from the MASS package. Otherwise logistic regression is used. In both cases, inverse probability of treatment weights are included in the regression. If there are levels of the outcome that are not observed in this treatment group, then 0's are added in. The function returns a matrix with named columns corresponding to each outcome (ordered numerically). The entries represent the estimated covariate-conditional treatment-specific PMF.

Description

Helper function to fit a treatment specific outcome regression. If there are more than 2 observed levels of the outcome for the specified treatment arm, then polr is used from the MASS package. Otherwise logistic regression is used. In both cases, inverse probability of treatment weights are included in the regression. If there are levels of the outcome that are not observed in this treatment group, then 0's are added in. The function returns a matrix with named columns corresponding to each outcome (ordered numerically). The entries represent the estimated covariate-conditional treatment-specific PMF.

Usage

fit_trt_spec_reg(
  trt_level,
  trt_spec_prob_est,
  out,
  treat,
  covar,
  out_levels,
  out_form = NULL,
  out_model,
  stratify,
  ...
)

Arguments

trt_level

Which level of treatment to fit the proportional odds model for

trt_spec_prob_est

A vector of estimates of Pr(treat = trt_level | covar).

out

A numeric vector containing the outcomes. Missing outcomes are allowed.

treat

A numeric vector containing treatment status. Missing values are not allowed unless the corresponding entry in out is also missing. Only values of 0 or 1 are treated as actual treatment levels. Any other value is assumed to encode a value for which the outcome is missing and the corresponding outcome value is ignored.

covar

A data.frame containing the covariates to include in the working proportional odds model.

out_levels

A numeric vector containing all ordered levels of the outcome.

out_form

The right-hand side of a regression formula for the working proportional odds model. NOTE: THIS FORMULA MUST NOT SUPPRESS THE INTERCEPT.

out_model

Which R function should be used to fit the proportional odds model. Options are "polr" (from the MASS package), "vglm" (from the VGAM package), or "clm" (from the ordinal package).

stratify

Boolean indicating whether to use nonparametric maximum likelihood (i.e., a stratified estimator). If out_form = "1", then a covariate-unadjusted estimate is computed.

...

Other options (not used).


[Package drord version 1.0.1 Index]