margins: Fit of the model on the margins

marginsR Documentation

Fit of the model on the margins

Description

Checks the fit on the two- and three-way margins for grm, ltm, rasch and tpm objects.

Usage


margins(object, ...)

## S3 method for class 'gpcm'
margins(object, type = c("two-way", "three-way"), rule = 3.5, ...)

## S3 method for class 'grm'
margins(object, type = c("two-way", "three-way"), rule = 3.5, ...)

## S3 method for class 'ltm'
margins(object, type = c("two-way", "three-way"), rule = 3.5, 
        nprint = 3, ...)

## S3 method for class 'rasch'
margins(object, type = c("two-way", "three-way"), rule = 3.5, 
        nprint = 3, ...)

## S3 method for class 'tpm'
margins(object, type = c("two-way", "three-way"), rule = 3.5, 
        nprint = 3, ...)

Arguments

object

an object inheriting either from class gpcm, class grm, class ltm or class rasch.

type

the type of margins to be used. See Details for more info.

rule

the rule of thumb used in determining the indicative goodness-of-fit.

nprint

a numeric value determining the number of margins with the largest Chi-squared residuals to be printed; only for ltm and rasch objects.

...

additional argument; currently none is used.

Details

Rather than looking at the whole set of response patterns, we can look at the two- and three-way margins. For the former, we construct the 2 by 2 contingency tables obtained by taking the variables two at a time. Comparing the observed and expected two-way margins is analogous to comparing the observed and expected correlations when judging the fit of a factor analysis model. For Bernoulli and Ordinal variates, the comparison is made using the so called Chi-squared residuals. As a rule of thumb residuals greater than 3.5 are indicative of poor fit. For a more strict rule of thumb use the rule argument. The analogous procedure is followed for the three-way margins.

Value

An object of either class margins.ltm if object inherits from class ltm, class rasch or class tpm, or an object of class margins.grm if object inherits from class grm, with components,

margins

for margins.ltm is an array containing the values of chi-squared residuals; for margins.gpcm and margins.grm is a list of length either the number of all possible pairs or all possible triplets of items, containing the observed and expected frequencies, the values of chi-squared residuals, the value of the total residual and the value of the rule of thumb times the product of the number of categories of the items under consideration.

type

the type of margins that were calculated.

nprint

the value of the nprint argument; returned only from margins.ltm.

combs

all possible two- or three-way combinations of the items; returned only from margins.ltm.

rule

the value of the rule argument; returned only from margins.ltm.

nitems

the number of items in object; returned only from margins.grm.

names

the names of items in object; returned only from margins.grm.

call

a copy of the matched call of object.

Author(s)

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

References

Bartholomew, D. (1998) Scaling unobservable constructs in social science. Applied Statistics, 47, 1–13.

Bartholomew, D. and Knott, M. (1999) Latent Variable Models and Factor Analysis, 2nd ed. London: Arnold.

Bartholomew, D., Steel, F., Moustaki, I. and Galbraith, J. (2002) The Analysis and Interpretation of Multivariate Data for Social Scientists. London: Chapman and Hall.

Rizopoulos, D. (2006) ltm: An R package for latent variable modelling and item response theory analyses. Journal of Statistical Software, 17(5), 1–25. URL doi: 10.18637/jss.v017.i05

See Also

person.fit, item.fit, GoF.rasch,

Examples


## Two- and Three-way residuals for the Rasch model
fit <- rasch(LSAT)
margins(fit)
margins(fit, "three")


## Two- and Three-way residuals for the one-factor model
fit <- ltm(WIRS ~ z1)
margins(fit)
margins(fit, "three")


## Two- and Three-way residuals for the graded response model
fit <- grm(Science[c(1,3,4,7)])
margins(fit)
margins(fit, "three")


ltm documentation built on March 18, 2022, 6:36 p.m.