estimate_year_1_2_diff_pooled: Estimate pooled year 1 to 2 usage differencs

Description Usage Arguments Value

View source: R/year_1_2_diff.R

Description

Estimate the first stage of likelihood that people with a year 2 usage amount had a specific usage amount in year 1

Usage

1
2
3
4
5
6
7
8
9
estimate_year_1_2_diff_pooled(
  DT,
  diff_var,
  year2_var,
  u_diff_var,
  x_main,
  x_int,
  exclude = TRUE
)

Arguments

DT

data.table

diff_var

character, name of the column with the year 1 - year 2 amount

year2_var

character, name of the column of the year 2 usage amount

u_diff_var

numeric vecotr with all unique amounts of the year 1/2 difference

x_main

character,

x_int

character vector,

exclude

logical (default = TRUE), if TRUE, then excludes people with year 2 amoutns that are not compatible with the year 1 difference we are trying to estimate

Value

data.table with first stage estimates for each value in u_diff_var


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