linearERRfit: Fit linear ERR model

Description Usage Arguments Details Value See Also Examples

View source: R/linearERRfit.R

Description

Fits the linear ERR model on a dataset

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
linearERRfit(
  data,
  doses,
  set,
  status,
  loc,
  corrvars = NULL,
  repar = FALSE,
  ccmethod = "CCAL",
  initpars = rep(0, length(doses) + length(corrvars)),
  fitopt = list(maxit = 5000),
  fitNull = TRUE,
  useOld = FALSE,
  uplimBeta = 5
)

Arguments

data

data frame containing matched case-control data, with a number of columns for doses to different locations, a column containing matched set numbers, a column containing the case's tumor location (value between 1 and the number of locations, with location x corresponding to the x-th column index in doses) and a column serving as a case-control indicator. Other covariates can also be included, in this case a parameter for each covariate column will be estimated. Hence factor variables need to be converted to dummy variables using model.matrix. If using ccmethod='meandose', a column for tumor location is still required but in this case the column can be a vector of ones.

doses

vector containing the indices of columns containing dose information.

set

column index containing matched set numbers.

status

column index containing case status.

loc

column index containing the location of the matched set's case's second tumor.

corrvars

vector containing the indices of columns containing variables to be corrected for.

repar

reparametrize to β=exp(ξ)? Defaults to FALSE

ccmethod

choice of method of analysis: one of meandose, CCML, CCAL or CL. Defaults to CCAL

initpars

initial values for parameters, default is 0 for all parameters. If supplying a different vector, use a vector with an initial value for β or ξ, one for all of the other location effects and one for each other covariate (in that order). Note that if repar=TRUE, the initial value is used for ξ.

fitopt

list with options to pass to control argument of optimizer

fitNull

boolean: also fit model without dose effect? Defaults to TRUE. Note: the same optimization algorithm that was used for the MLE will be used for the null model, even if the null model only has one parameter (see details)

useOld

if TRUE, a previous (slower) implementation of the log-likelihood function will be used. Defaults to FALSE

uplimBeta

upper limit for β=exp(ξ), default value 5. This is used for constraining the MLE estimation in some settings and for the jackknife inclusion criteria, and can be infinite except when Brent optimization is used (see help for linearERR)

Details

This is a stripped down version of linearERR, and should only be used when that function does not suffice. For more details refer to the help of linearERR.

Value

Object with components:

fit

object produced by mle2

nullfit

fit without dose effect produced by mle2

proflik

profile likelihood: one-dimensional function of β or ξ. Note that the optimization used is the same as for the MLE, leading to one-dimensional Nelder-Mead optimization in certain cases (see details of linearERR)

See Also

linearERR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(linearERRdata1)

fitmeandose <- linearERRfit(data=linearERRdata1, set=1, doses=2:6,
status=8, loc=7, corrvars=9, repar=FALSE, ccmethod="meandose")

fitCCML <- linearERRfit(data=linearERRdata1, set=1, doses=2:6,
status=8, loc=7, corrvars=9, repar=FALSE, ccmethod="CCML")

fitCCAL <- linearERRfit(data=linearERRdata1, set=1, doses=2:6,
status=8, loc=7, corrvars=9, repar=FALSE, ccmethod="CCAL")

fitCL <- linearERRfit(data=linearERRdata1, set=1, doses=2:6,
status=8, loc=7, corrvars=NULL, repar=FALSE, ccmethod="CL")

fitmeandose$fit$par
fitCCML$fit$par
fitCCAL$fit$par
fitCL$fit$par

sanderroberti/linearERRfit documentation built on Nov. 8, 2021, 12:23 a.m.