GetER_1chain: Calculating the exposure response function for one MCMC...

Description Usage Arguments

Description

Function that takes the posterior samples of cutoffs, inclusion indicators and coefficients of the outcome model and returns the posterior mean response for multiple values of the exposure.

Usage

1
2
GetER_1chain(dta, cutoffs, coefs, predict_at = NULL, grid_length = 100,
  mean_only = FALSE, other_function = NULL)

Arguments

dta

The dataset including columns X (treatment), Y (outcome), and potential confounders named as C1, C2, ...

cutoffs

A list of length equal to the number of posterior samples. Each element of the list is a vector including the current set of cutoff values.

coefs

A list of length equal to the number of posterior samples. Each element of the list is a matrix of the outcome coefficients. The dimension of each matrix is (number of experiments at current iteration) x (number of potential confounders). Confounders with inclusion indicators equal to 0, have coefficients equal to 0. The first two elements of each row of the matrix correspond to intercept and slope of the exposure.

predict_at

A vector of the exposure values we wish to predict ER at. If left NULL, a grid of length grid_length over the exposure values will be created.

grid_length

The number of locations we will predict the ER. Defaults to 100.

mean_only

Logical. Set to FALSE if we want the individual ER predictions. Set to TRUE if we are only interested in the posterior samples of the mean ER. Defaults to FALSE.

other_function

Whether we want to apply a different function to the predictions. Defaults to NULL. Examples include exp(x), log(x).


gpapadog/LERCA documentation built on June 4, 2019, 11:40 a.m.