plot.tam: Plot Function for Unidimensional Item Response Models

View source: R/plot.tam.R

plot.tamR Documentation

Plot Function for Unidimensional Item Response Models

Description

S3 plot method for objects of class tam, tam.mml or tam.mml.

Usage

## S3 method for class 'tam'
plot(x, items=1:x$nitems, type="expected", low=-3, high=3, ngroups=6,
                   groups_by_item=FALSE, wle=NULL, export=TRUE, export.type="png",
                   export.args=list(), observed=TRUE, overlay=FALSE,
                   ask=FALSE, package="lattice", fix.devices=TRUE, nnodes=100, ...)

## S3 method for class 'tam.mml'
plot(x, items=1:x$nitems, type="expected", low=-3, high=3, ngroups=6,
                       groups_by_item=FALSE, wle=NULL, export=TRUE, export.type="png",
                       export.args=list(), observed=TRUE, overlay=FALSE,
                       ask=FALSE,  package="lattice",  fix.devices=TRUE, nnodes=100, ...)

## S3 method for class 'tam.jml'
plot(x, items=1:x$nitems, type="expected", low=-3, high=3, ngroups=6,
                       groups_by_item=FALSE, wle=NULL, export=TRUE, export.type="png",
                       export.args=list(), observed=TRUE, overlay=FALSE,
                       ask=FALSE,  package="lattice", fix.devices=TRUE, nnodes=100, ...)

Arguments

x

Object of class tam, tam.mml or tam.mml.

items

An index vector giving the items to be visualized.

type

Plot type. type="expected" plot the expected item response curves while type="items" plots the response curves of all item categories.

low

Lowest \theta value to be displayed

high

Highest \theta value to be displayed

ngroups

Number of score groups to be displayed. The default are six groups.

groups_by_item

Logical indicating whether grouping of persons should be conducted item-wise. The groupings will differ from item to item in case of missing item responses.

wle

Use WLE estimate for displaying observed scores.

export

A logical which indicates whether all graphics should be separately exported in files of type export.type in a subdirectory 'Plots' of the working directory.

export.type

A string which indicates the type of the graphics export. For currently supported file types, see grDevices::dev.new.

export.args

A list of arguments that are passed to the export method can be specified. See the respective export device method for supported usage.

observed

A logical which indicates whether observed response curve should be displayed

overlay

A logical indicating whether expected score functions should overlay.

ask

A logical which asks for changing the graphic from item to item. The default is FALSE.

package

Used R package for plot. Can be "lattice" or "graphics".

fix.devices

Optional logical indicating whether old graphics devices should be saved.

nnodes

Number of \theta points at which item response functions are evaluated

...

Further arguments to be passed

Details

This plot method does not work for multidimensional item response models.

Value

A plot and list of computed values for plot (if saved as an object)

Author(s)

Margaret Wu, Thomas Kiefer, Alexander Robitzsch, Michal Modzelewski

See Also

See CDM::IRT.irfprobPlot for a general plot method.

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: Dichotomous data data.sim.rasch
#############################################################################

data(data.sim.rasch)
mod <- TAM::tam.mml(data.sim.rasch)
# expected response curves
plot(mod, items=1:5, export=FALSE)
# export computed values
out <- plot(mod, items=1:5, export=FALSE)
# item response curves
plot(mod, items=1:5, type="items", export=FALSE)
# plot with graphics package
plot(mod, items=1:5, type="items", export=FALSE, ask=TRUE, package="graphics")

#############################################################################
# EXAMPLE 2: Polytomous data
#############################################################################

data(data.Students, package="CDM")
dat <- data.Students[, c("sc3","sc4", "mj1", "mj2" )]
dat <- na.omit(dat)
dat[ dat[,1]==3, 1 ] <- 2   # modify data
dat[ 1:20, 2 ] <- 4

# estimate model
mod1 <- TAM::tam.mml( dat )
# plot item response curves and expected response curves
plot(mod1, type="items", export=FALSE)
plot(mod1, type="expected", export=FALSE )

## End(Not run)

alexanderrobitzsch/TAM documentation built on Feb. 21, 2024, 5:59 p.m.