anova: Anova method for fitted nested models

Description Usage Arguments Value Warning Author(s) See Also Examples

Description

A generic function to conduct a likelihood ratio test between two nested models.

Usage

1
2
## S3 method for class 'flirt'
anova(object, object2, ...)

Arguments

object

an object inheriting from class flirt for the model under the null hypothesis.

object2

an object inheriting from class flirt for the model under the alternative hypothesis.

...

additional arguments; currently none is used.

Value

An object of either class anova.flirt with components,

name0

the name of object.

L0

the log-likelihood under the null hypothesis (object).

aic0

the AIC value for the model given by object.

bic0

the BIC value for the model given by object.

name1

the name of object2.

L1

the log-likelihood under the alternative hypothesis (object2).

aic1

the AIC value for the model given by object2.

bic1

the BIC value for the model given by object2.

LRT

the value of the Likelihood Ratio Test statistic.

df

the degrees of freedom for the test (i.e., the difference in the number of parameters).

p.value

the p-value of the test.

Warning

The code does not check if the models are nested. The user is responsible to supply nested models in order for the LRT to be valid.

Author(s)

Minjeong Jeon <jeon.117@osu.edu>

See Also

flirt, logLik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(flirt)

## verbal aggression data

data(verb2)

# 2-dimensional 2PL model for binary data: a(th+b) parameterization
model1 <- flirt(data=verb2, select=2:25, loading=list(on=TRUE, inside=TRUE),  
            mul=list(on=TRUE, dim_info=list(dim1=1:12, dim2=13:24))  )

#  2-dimensional Rasch model 
model2 <- flirt(data=verb2, select=2:25, 
            mul=list(on=TRUE, dim_info=list(dim1=1:12, dim2=13:24))  )

# LR test
anova(model2, model1) # model1 is nested within model2

seonghobae/flirt.x32 documentation built on May 29, 2019, 6:54 p.m.