fitCaseControlModel: Fit the case-control model

View source: R/ModelFitting.R

fitCaseControlModelR Documentation

Fit the case-control model

Description

Fit the case-control model

Usage

fitCaseControlModel(
  caseControlData,
  useCovariates = FALSE,
  excludeCovariateIds = c(),
  includeCovariateIds = c(),
  caseControlsExposure = NULL,
  profileGrid = NULL,
  profileBounds = c(log(0.1), log(10)),
  prior = createPrior("laplace", useCrossValidation = TRUE),
  control = createControl(cvType = "auto", startingVariance = 0.01, tolerance = 2e-07,
    cvRepetitions = 10, selectorType = "byPid", noiseLevel = "quiet")
)

Arguments

caseControlData

A data frame as generated by the createCaseControlData function.

useCovariates

Whether to use the covariates in the caseControlsExposure.

excludeCovariateIds

Exclude these covariates from the model.

includeCovariateIds

Include only these covariates in the model.

caseControlsExposure

An object of type caseControlsExposure as created using the getDbExposureData function.

profileGrid

A one-dimensional grid of points on the log(relative risk) scale where the likelihood for coefficient of variables is sampled. See details.

profileBounds

The bounds (on the log relative risk scale) for the adaptive sampling of the likelihood function.

prior

The prior used to fit the model. See createPrior for details.

control

The control object used to control the cross-validation used to determine the hyperparameters of the prior (if applicable). See createControl for details.

Details

Fits the model using a conditional logistic regression.

For likelihood profiling, either specify the 'profileGrid' for a completely user- defined grid, or 'profileBounds' for an adaptive grid. Both should be defined on the log IRR scale. When both 'profileGrid' and 'profileGrid' are 'NULL' likelihood profiling is disabled.

Value

An object of type outcomeModel.


OHDSI/CaseControl documentation built on July 15, 2022, 6:33 a.m.