glmCensRd: Maximum likelihood estimator (MLE) for censored predictor in...

View source: R/glmCensRd.R

glmCensRdR Documentation

Maximum likelihood estimator (MLE) for censored predictor in generalized linear models (GLM)

Description

Maximum likelihood estimator (MLE) for censored predictor in generalized linear models (GLM)

Usage

glmCensRd(
  Y,
  W,
  D,
  Z = NULL,
  data,
  distY = "normal",
  distX = "normal",
  rightCens = TRUE,
  robcov = TRUE,
  subdivisions = 100,
  steptol = 1e-06,
  iterlim = 100,
  verbose = FALSE
)

Arguments

Y

name of outcome variable.

W

name of observed (censored) version of X.

D

name of event indicator, defined to be = 1 if X was uncensored and 0 otherwise.

Z

(optional) name(s) of additional fully observed covariates. If none, Z = NULL (the default).

data

a dataframe containing at least columns Y, X, C, Z.

distY

distribution assumed for Y given X and Z. Default is "normal", but other options are "bernoulli", "lognormal", "gamma", "weibull", "exponential", or "poisson".

distX

distribution assumed for X given Z. Default is "normal", but other options are "lognormal", "gamma", "weibull", "exponential", or "poisson".

rightCens

logical. If TRUE (the default), right censoring is assumed. If FALSE, left censoring is assumed.

robcov

logical. If TRUE (the default), the robust sandwich covariance estimator of parameter standard errors is included in the output.

subdivisions

(fed to integrate) the maximum number of subintervals used to integrate over unobserved X for censored subjects. Default is 100.

steptol

(fed to nlm) a positive scalar providing the minimum allowable relative step length. Default is 1E-6.

iterlim

(fed to nlm) a positive integer specifying the maximum number of iterations to be performed before the program is terminated. Default is 100.

verbose

logical. If TRUE, text is printed to show progress. Default is FALSE.

Value

A list with the following elements:

outcome_model

a list containing details of the fitted model for the outcome.

predictor_model

a list containing details of the fitted model for the predictor.

code

an integer indicating why the optimization process terminated. See ?nlm for details on values.

vcov

variance-covariance matrix of the model parameters.

rvcov

robust sandwich variance-covariance matrix of the model parameters.


sarahlotspeich/glmCensRd documentation built on Aug. 19, 2024, 4:11 p.m.