Learn R Programming

TAM (version 1.6-0)

plot.tam: 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, 
                   wle=NULL, export=TRUE, export.type="png", 
                   export.args=list(), observed=TRUE, overlay=FALSE , 
                   ask=FALSE, package="lattice" , ...)
	
## S3 method for class 'tam.mml':
plot(x, items=1:x$nitems, type="expected", low=-3, high=3, ngroups=6, 
                       wle=NULL, export=TRUE, export.type="png", 
                       export.args=list(), observed=TRUE, overlay=FALSE , 
                       ask=FALSE,  package="lattice" , ...)
     
## S3 method for class 'tam.jml':
plot(x, items=1:x$nitems, type="expected", low=-3, high=3, ngroups=6, 
                       wle=NULL, export=TRUE, export.type="png", 
                       export.args=list(), observed=TRUE, overlay=FALSE , 
                       ask=FALSE,  package="lattice" , ...)

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.
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 subfolder 'Plots' of the working directory.
export.type
A string which indicates the type of the graphics export. For currently supported file types, see 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 Rpackage for plot. Can be "lattice" or "graphics".
...
Further arguments to be passed

Details

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

See Also

See IRT.irfprobPlot (CDM) for a general plot method.

Examples

Run this code
#############################################################################
# EXAMPLE 1: Dichotomous data
#############################################################################

data(sim.rasch)
mod <- tam.mml(sim.rasch)
# expected response curves
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.mml( dat )
# plot item response curves and expected response curves
plot(mod1, type="items", export=FALSE)
plot(mod1, type="expected", export=FALSE )

Run the code above in your browser using DataLab