Learn R Programming

IRTest (version 2.1.0)

latent_distribution: Latent density function

Description

Density function of the estimated latent distribution with mean and standard deviation equal to 0 and 1, respectively.

Usage

latent_distribution(x, model.fit)

Value

The evaluated values of the PDF, a length of which equals to that of x.

Arguments

x

A numeric vector. Value(s) on the \(theta\) scale for evaluating the PDF.

model.fit

An object returned from an estimation function.

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
ggplot2::ggplot()+
  ggplot2::stat_function(fun=latent_distribution, args=list(M1))+
  ggplot2::lims(x=c(-6,6), y=c(0,0.5))
# }

Run the code above in your browser using DataLab