estimate_scores: Estimate propensity and prognostic scores.

Description Usage Arguments Value Examples

View source: R/estimate_scores.R

Description

Estimate propensity and prognostic scores.

Usage

1
2
3
4
5
6
7
8
estimate_scores(
  this_data,
  outcome_fm,
  outcome_fam = gaussian,
  ps_fm,
  ps_fam = binomial,
  wt = NULL
)

Arguments

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.

Value

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.

Examples

 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

denisagniel/synthate documentation built on April 16, 2020, 12:45 a.m.