linERRloglikold: Negative log-likelihood

Description Usage Arguments Value Examples

View source: R/linERRloglikold.R

Description

Compute the negative log-likelihood for the linear ERR model in a matched case-control dataset. This is an outdated function, replaced by the substantially faster linERRloglik

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
linERRloglikold(
  params,
  data,
  doses,
  set,
  status,
  loc,
  corrvars = NULL,
  ccmethod = "CCAL"
)

Arguments

params

vector of parameter values (β, α_2, ... , α_L, γ_1, ... , γ_p) to evaluate the log-likelihood at

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, in the desired order.

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.

ccmethod

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

Value

Minus log likelihood in params

Examples

1
2
3
4
5
6
7
8
9
data(linearERRdata1)

#log-likelihood in the truth
-linERRloglikold(params=c(.3,rep(log(.25),4),log(2)),
data=linearERRdata1,set=1, doses=2:6, status=8, loc=7, corrvars=9)

#log-likelihood in 0
-linERRloglikold(params=c(0,rep(0,4),0),
data=linearERRdata1,set=1, doses=2:6, status=8, loc=7, corrvars=9)

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