Sunday, February 24, 2019

Logistic regression II, Conditional logistic regression 2018

Hi,

These are materials for logistic regression course II: Conditional logistic regression, academic year 2018 (calendar year 2019). This year I use R version 3.5.2 and the regression outputs are the same as that produced from the previous version of R.

Conditional logistic regression requires library survival that already exists on your R library folder. Just call library(survival) or require(survival) and you are ready to use clogit function.

agechd.dta
cca-match.dta

The module can be downloaded here.

logistic1702-2.pdf

The required modules for this course are ice and epid which can be installed into R by manually installing the two packages, "ice_3.4.0.1.zip" and "epid_3.4.0.1.zip".

In this session, we are going to use multilevel logistic regression (glmer) in dealing with data stratified by age group as if the stratification is a matching condition. This method is recently used by some authors. Then we need another package from CRAN called "lme4". You can install the package by typing the following line on your R console.

install.packages("lme4")

(Since the package is installed from CRAN or its mirror, a repos argument is not required.)

Finally, you can follow my R script file below. Don't forget to change working directory to yours.

conditional2.R

Additional reading:
The article "Medication risk factors associated with healthcare-associated Clostridium difficile infection: a multilevel model case–control study among 64 US academic medical centres" shows how to use multilevel logistic regression so that the effect of the variables at the contexual level can be identified. This method can be used to handle the matched analysis of a case-control study as well.

J. Antimicrob. Chemother.-2014-Pakyz-1127-31.pdf

No comments: