LRT: Extract the log-likelihood ratio test (LRT) for writing

Description Usage Arguments Details Value Author(s) Examples

View source: R/functions.R

Description

Extract the log-likelihood ratio test (LRT) from an anova table and writes it in APA style

Usage

1
LRT(amod)

Arguments

amod

a object of class anova, comparing two models

Details

Returns the LRT value with degrees of freedom and p-value.

Value

a string

Author(s)

Marcello Gallucci

Examples

1
2
3
4
5
dat<-as.data.frame(cbind(y=rbinom(100,1,.5),x=rnorm(100,0,1),id=rep(1:20)))
mod0<-glmer(y~(1|id),dat,family=binomial())
mod1<-glmer(y~(1|id)+x,dat,family=binomial())
res<-anova(mod0,mod1,test="LRT")
LRT(res) 

mcfanda/StatWriter documentation built on May 22, 2017, 1:11 a.m.