fit_first_stage_price: Fit first stage price

Description Usage Arguments Value

Description

Fit first stage price

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
fit_first_stage_price(
  DT,
  keep_vars,
  cont_risk_var,
  n_quant_risk,
  atc_codes,
  rxcui_xwalk,
  price_by_drug,
  atc_ind,
  n_quant_price,
  x_main = "first_mo",
  x_int = c("pred_cut1", "hgih_risk_abs"),
  price_var,
  B = 100,
  return_data = FALSE,
  return_rxcui = FALSE,
  quiet = FALSE
)

Arguments

DT

a data.table

keep_vars

character vector, column names for the binary keep variables

cont_risk_var

character (default = NULL), name of the continuous predicted risk variable

n_quant_risk

integer, number of quantiles to break predicted risk in to

atc_codes

character vector, atc codes to run models on

rxcui_xwalk

data.table, xwalk of atc code to rxcui

price_by_drug

data.table, prices by drug and coverage arm

atc_ind

data.table, atc indicators for rxcui codes

n_quant_price

integer, number of quantiles to break price in to

x_main

character (default = "first_mo"), name of instrument

x_int

character vector, names of variables to interact instrument with

price_var

character, name of price variable to use

B

integer, number of bootstrap samples to use when calculating standard errors

return_data

logical (default = FALSE), if TRUE returns model data

return_rxcui

logical (default = TRUE), if TRUE then returns vector of rxcui codes that were sued in estimation.

quiet

logical (default = FALSE), if TRUE then does not print progress

Value

data.table


evanjflack/polypharmacy documentation built on Oct. 12, 2020, 10:45 a.m.