Learn R Programming

IRTest (version 2.1.0)

plot.IRTest: Plot of the estimated latent distribution

Description

This function draws a plot of the estimated latent distribution (the population distribution of the latent variable).

Usage

# S3 method for IRTest
plot(x, ...)

Value

A plot of estimated latent distribution.

Arguments

x

An object of "IRTest"-class obtained from either IRTest_Dich, IRTest_Poly, IRTest_Cont, or IRTest_Mix.

...

Other aesthetic argument(s) for drawing the plot. Arguments are passed on to ggplot2::stat_function, if the distribution estimation method is 2NM, KDE, or DC. Otherwise, they are passed on to ggplot2::geom_line.

Author

Seewoo Li cu@yonsei.ac.kr

Examples

Run this code
# \donttest{
# Data generation and model fitting

data <- DataGeneration(N=1000,
                       nitem_D = 15,
                       latent_dist = "2NM",
                       d = 1.664,
                       sd_ratio = 2,
                       prob = 0.3)$data_D

M1 <- IRTest_Dich(data = data, latent_dist = "KDE")

# Plotting the latent distribution

plot(x = M1, linewidth = 1, color = 'red') +
  ggplot2::lims(x = c(-6, 6), y = c(0, .5))
# }

Run the code above in your browser using DataLab