Description Usage Arguments Value Examples
View source: R/estimate_scores.R
Estimate propensity and prognostic scores.
1 2 3 4 5 6 7 8 | estimate_scores(
this_data,
outcome_fm,
outcome_fam = gaussian,
ps_fm,
ps_fam = binomial,
wt = NULL
)
|
this_data |
data frame to estimate scores on. |
outcome_fm |
formula for the outcome model. |
outcome_fam |
distributional family for outcome model. |
ps_fm |
formula for the propensity score model. |
ps_fam |
distributional family for propensity score model. |
wt |
optional case weights. Default is NULL. |
data frame augmented with ps
, the propensity score, prog_score
, the prognostic score, pi
, the propensity score if treated or 1 minus the propensity score if control, and ps_strat
, a numeric value indicating the quintile of the propensity score that each individual falls in.
1 2 3 4 5 6 7 8 9 10 | gen_mod <- generate_data(n = 100,
dgp = 'ks',
correct_outcome = FALSE,
correct_ps = TRUE)
this_data <- gen_mod$data
this_data <- estimate_scores(this_data, outcome_fm = outcome_fm,
ps_fm = ps_fm,
ps_fam = ps_fam,
outcome_fam = outcome_fam)
this_data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.