Estimate probability of receiving each level of treatment

estimate_treat_prob(treat, covar, treat_form, return_models)

Arguments

treat

A numeric vector containing treatment status. 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.

covar

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

treat_form

The right-hand side of a regression formula for the working model of treatment probability as a function of covariates

return_models

If TRUE the fitted working proportional odds models and treatment probability models are returned.

Value

A list where the first element is estimate of Pr(treat = 1 | covar) for covar equal to inputted values of covar and second element is estimate of Pr(treat = 0 | covar) for covar equal to inputted values of covar