traditional_regression_functions function

Traditional regression approaches.

Traditional regression approaches.

Functions to fit traditional regression approaches for a quantitative normally-distributed primary outcome (setting = "GLM") and a censoredtime-to-event primary outcome (setting = "AFT"). mult_reg fits the multiple regression approach and res_reg computes the regression of residuals approach.

mult_reg(setting = "GLM", Y = NULL, X = NULL, K = NULL, L = NULL, C = NULL) res_reg(Y = NULL, X = NULL, K = NULL, L = NULL)

Arguments

  • setting: String with value "GLM" or "AFT" indicating whether the approaches are fitted for a normally-distributed primary outcome Y ("GLM") or a censored time-to-event primary outcome Y ("AFT"). Under the "AFT" setting, only mult_reg is available.
  • Y: Numeric input vector of the primary outcome.
  • X: Numeric input vector of the exposure variable.
  • K: Numeric input vector of the intermediate outcome.
  • L: Numeric input vector of the observed confounding factor.
  • C: Numeric input vector of the censoring indicator under the AFT setting (must be coded 0 = censored, 1 = uncensored).

Returns

Returns a list with point estimates of the parameters point_estimates, standard error estimates SE_estimates

and p-values pvalues.

Details

In more detail, for a quantitative normally-distributed primary outcome Y, mult_reg fits the model

Y=α0+α1K+αXYX+α2L+\epsilonY=α0+α1K+\alphaXYX+α2L+ϵ Y = \alpha_0 + \alpha_1 \cdot K + \alpha_{XY} \cdot X + \alpha_2 \cdot L + \epsilonY = \alpha0 + \alpha1*K + \alphaXY*X + \alpha2*L + \epsilon

and obtains point and standard error estimates for the parameters α0,α1,\alphaXY,α2\alpha0, \alpha1, \alphaXY, \alpha2. res_reg obtains point and standard error estimates for the parameters α0,α1,α2,α3,\alphaXY\alpha0, \alpha1, \alpha2, \alpha3, \alphaXY

by fitting the models

Y=α0+α1K+α2L+ϵ1Y=α0+α1K+α2L+ϵ1, Y = \alpha_0 + \alpha_1 \cdot K + \alpha_2 \cdot L + \epsilon_1Y = \alpha0 + \alpha1*K + \alpha2*L + \epsilon1, ϵ^1=α3+αXYX+ϵ2hat(ϵ1)=α3+\alphaXYX+ϵ2. \widehat{\epsilon}_1 = \alpha_3 + \alpha_{XY} \cdot X + \epsilon_2hat(\epsilon1) = \alpha3 + \alphaXY*X + \epsilon2.

Both functions use the lm function and also report the provided p-values from t-tests that each parameter equals 0. For the analysis of a censored time-to-event primary outcome Y, only the multiple regression approach is implemented. Here, mult_reg fits the according censored regression model to obtain coefficient and standard error estimates as well as p-values from large-sample Wald-type tests by using the survreg function. See the vignette for more details.

Examples

dat_GLM <- generate_data(setting = "GLM") mult_reg(setting = "GLM", Y = dat_GLM$Y, X = dat_GLM$X, K = dat_GLM$K, L = dat_GLM$L) res_reg(Y = dat_GLM$Y, X = dat_GLM$X, K = dat_GLM$K, L = dat_GLM$L) dat_AFT <- generate_data(setting = "AFT", a = 0.2, b = 4.75) mult_reg(setting = "AFT", Y = dat_AFT$Y, X = dat_AFT$X, K = dat_AFT$K, L = dat_AFT$L, C = dat_AFT$C)
  • Maintainer: Stefan Konigorski
  • License: GPL-2
  • Last published: 2018-03-19

Useful links