lrtsccs | R Documentation |
The function performs the likelihood ratio test for SCCS models that are nested (up to combining of multinomial categories).
lrtsccs(model1, model2)
model1 |
an object fitted by the SCCS method e.g |
model2 |
an object fitted by the SCCS method e.g |
likelihood ratio test statistic, degrees of freedom and p-value.
Yonas Ghebremichael-Weldeselassie, Heather Whitaker, Paddy Farrington.
Farrington P., Whitaker H., and Ghebremichael-Weldeselassie Y. (2018). Self-controlled Case Series Studies: A modelling Guide with R. Boca Raton: Chapman & Hall/CRC Press.
itp.mod1 <- standardsccs(event~mmr+age, indiv=case, astart=sta,aend=end,
aevent=itp, adrug=mmr, aedrug=mmr+42, expogrp=c(0,15,29),
agegrp=c(427,488,549,610,671), data=itpdat)
itp.mod2 <- standardsccs(event~age, indiv=case, astart=sta,
aend=end, aevent=itp, adrug=mmr, aedrug=mmr+42,
expogrp=c(0,15,29), agegrp=c(427,488,549,610,671),
data=itpdat)
itp.mod3 <- standardsccs(event~mmr + age, indiv=case, astart=sta,
aend=end, aevent=itp, adrug=mmr, aedrug=mmr+42,
agegrp=c(427,488,549,610,671), data=itpdat)
# Compare itp.mod1 a model with both age and exposure (mmr) and itpmod2 a model
# with only age effect
lrtsccs(itp.mod1,itp.mod2)
# Compare itp.mod1 a model with both age and 3 exposure categories and itpmod3
# a model with age and only one exposure category
lrtsccs(itp.mod3,itp.mod1) # order of the objects doesn't matter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.