Learn R Programming

PerFit (version 1.4.6)

plot PerFit: Plot method for objects of class "PerFit"

Description

Plot method for objects of class "PerFit".

Usage

# S3 method for PerFit
plot(x, cutoff.obj=NULL, 
       ModelFit="NonParametric", Nreps=1000, 
       IP=x$IP, IRT.PModel=x$IRT.PModel, Ability=x$Ability, 
       Ability.PModel=x$Ability.PModel, mu=0, sigma=1, 
       Blvl = 0.05, Breps = 1000, CIlvl = 0.95, 
       UDlvl = NA, 
       Type="Density", Both.scale=TRUE, Cutoff=TRUE, Cutoff.int=TRUE,
       Flagged.ticks = TRUE, 
       Xlabel=NA, Xcex=1.5, title=NA, Tcex=1.5,
       col.area="lightpink", col.hist="lightblue", col.int="darkgreen",
       col.ticks="red", ...)

Arguments

x

Object of class "PerFit".

cutoff.obj

Object of class "PerFit.cutoff".

ModelFit

Method required to compute model-fitting item score patterns. The options available are "NonParametric" (default) and "Parametric".

Nreps

Number of model-fitting item score patterns generated. Default is 1000.

IP

Matrix with previously estimated item parameters. Default is x$IP.

IRT.PModel

Parametric IRT model (required if "ModelFit=Parametric" or if the person fit statistic is parametric). Default is x$IRT.PModel.

Ability

Matrix with previously estimated item parameters. Default is x$Ability.

Ability.PModel

Method to use in order to estimate the latent ability parameters (required if "ModelFit=Parametric" or if the person fit statistic is parametric). Default is x$Ability.PModel.

mu

Mean of the apriori distribution. Only used when method="BM". Default is 0.

sigma

Standard deviation of the apriori distribution. Only used when method="BM". Default is 1.

Blvl

Significance level for bootstrap distribution (value between 0 and 1). Default is 0.05.

Breps

Number of bootstrap resamples. Default is 1000.

CIlvl

Level of bootstrap percentile confidence interval for the cutoff statistic.

UDlvl

User-defined cutoff level.

Type

Type of plot: "Histogram", "Density" (default), "Both".

Both.scale

Logical: Should the y-axis be adjusted so that both the histogram and the density graphics are completely visible? Default is TRUE.

Cutoff

Logical: Should the estimated cutoff be added to the plot? Default is TRUE.

Cutoff.int

Logical: Should an approximated (1-Blvl)% bootstrap confidence interval be added to the plot? Default is TRUE.

Flagged.ticks

Logical: Should ticks representing the flagged respondents be added to the plot? Default is TRUE.

Xlabel

Label of x-axis, otherwise a default label is shown.

Xcex

Font size of the label of x-axis.

title

Title of the plot, otherwise a default title is shown.

Tcex

Font size of the title of the plot.

col.area

Color of "flagging region".

col.hist

Color of histogram.

col.int

Color of bootstrap confidence interval.

col.ticks

Color of the ticks marking the flagged respondents.

...

Extra graphical parameters to be passed to plot.

Details

This function plots the empirical distribution of the scores of the person-fit statistic specified by the "PerFit" class object x. A histogram, density, or a combination of both displays is possible.

The cutoff score may be provided by means of the cutoff.obj object, otherwise it is internally computed (for which the function parameters ModelFit through CIlvl are required; see cutoff for more details). The value of the cutoff is superimposed to the plot when Cutoff=TRUE. In this case, the adequate "flagging region" is colored, thus indicating the range of values for which the person-fit statistic flags respondents as potentially displaying aberrant behavior. The option Both.scale was introduced to help to better tune the scale of the y-axis. Furthermore, the percentile confidence interval for the cutoff value (with confidence level defined by the cutoff.obj) is displayed in the x-axis, and ticks marking the flagged respondents are display on the top of the plot.

See Also

cutoff, flagged.resp, PRFplot

Examples

Run this code
# NOT RUN {
# Load the inadequacy scale data (dichotomous item scores):
data(InadequacyData)

# Compute the ZU3 scores:
ZU3.out <- ZU3(InadequacyData)

# Plot the sampling distribution of the ZU3 scores, with cutoff value based on a nominal 5% level,
# and 90% confidence interval:
plot(ZU3.out, Type="Both", Blvl=.05, CIlvl = 0.90)
# }

Run the code above in your browser using DataLab