Learn R Programming

SCCS (version 1.7)

lrtsccs: Likelihood ratio test for SCCS models

Description

The function performs the likelihood ratio test for SCCS models that are nested (up to combining of multinomial categories).

Usage

lrtsccs(model1, model2)

Value

likelihood ratio test statistic, degrees of freedom and p-value.

Arguments

model1

an object fitted by the SCCS method e.g standardsccs to be compared with model2.

model2

an object fitted by the SCCS method e.g standardsccs to be compared with model1.

Author

Yonas Ghebremichael-Weldeselassie, Heather Whitaker, Paddy Farrington.

References

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.

Examples

Run this code

 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
   
   

Run the code above in your browser using DataLab