score_data {rollmatch}R Documentation

Create propensity scores using a logistic or probit regression model

Description

Create propensity scores using a logistic or probit regression model

Usage

score_data(reduced_data, model_type, match_on, fm, treat, tm, entry, id)

Arguments

reduced_data

Dataframe of reduced treatment and comparison data. See output of reduce_data().

model_type

Use logistic regression ("logistic") or "probit" regression ("probit") to estimate the predicted probability of participating

match_on

Match on estimated propensity score ("pscore") or logit of estimated propensity score ("logit").

fm

A formula in the form treat ~ x1 + x2 ... where treat is a binary treatment indicator (Treat = 1, Control = 0) and x1 and x2 are pre-treatment covariates. Both the treatment indicator and pre-treatment covariates must be contained in the input dataset.

treat

String for name of treatment variable in data.

tm

String for time period indicator variable name in data.

entry

String for name of time period in which the participant enrolled in the intervention (in the same units as the tm variable).

id

String for individual id variable name in data.

Value

A copy of reduced_data input with added propensity scores

Examples

## Not run: 
data(package="rollmatch", "rem_synthdata_small")
fm <- as.formula(treat ~ qtr_pmt + age + is_male + is_white)
reduced_data <- reduce_data(data = rem_synthdata_small, treat = "treat",
                            tm = "quarter", entry = "entry_q",
                            id = "indiv_id", lookback = 1)
scored_data <- score_data(reduced_data = reduced_data,
                          model_type = "logistic", match_on = "logit",
                          fm = fm, treat = "treat", tm = "quarter",
                          entry = "entry_q", id = "indiv_id")
head(scored_data)

## End(Not run)


[Package rollmatch version 2.0.3 Index]