TrueER: Calculating the true ER of simulated data set.

Description Usage Arguments Value

Description

Based on a simulated data set and known experiment configuration and outcome model coefficients calculate the exposure response curve.

Usage

1
2
3
TrueER(dta, true_cutoffs, out_coefs, predict_at = NULL,
  grid_length = 100, XY_function = c("linear", "other"),
  XY_spec = NULL)

Arguments

dta

Data frame. Includes exposure as 'X', outcome as 'Y' and covariates as C1, C2, ...

true_cutoffs

Numeric vector. The true points of the experiment configuration.

out_coefs

Matrix. Rows correspond to experiments and columns to coefficients (intercept, slope, covariates) in the outcome model.

predict_at

The values of the exposure we want to predict the response at. If left NULL, specify grid_length.

grid_length

The number of exposure points we want to estimate the mean response at. If predict_at is left NULL, an equally-distanced grid of values of length grid_length over the observed exposure range will be used. Defaults to 100.

XY_function

The true ER shape. Options are 'linear' and 'other'. Defaults to 'linear'.

XY_spec

Function. If XY_function is set to 'other' specify the true ER shape in XY_spec. Leave NULL otherwise.

Value

List of two elements. The first one named 'x' is a vector of the exposure values at which we evaluated the true ER. The second one named 'y' is a matrix of rows equal to the number of exposure values in 'x', and columns equal to the number of observations, including the expected response of an observation at a specific exposure value.


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