latent_trait_analysis {airt} | R Documentation |
Performs the latent trait analysis
Description
This function performs the latent trait analysis of the datasets/problems after fitting a continuous IRT model. It fits a smoothing spline to the points to compute the latent trait. The autoplot function plots the latent trait and the performance.
Usage
latent_trait_analysis(
df,
paras,
min_item = NULL,
max_item = NULL,
epsilon = 0.01
)
## S3 method for class 'latenttrait'
autoplot(
object,
xlab = "Problem Difficulty",
ylab = "Performance",
plottype = 1,
nrow = 2,
se = TRUE,
ratio = 3,
...
)
Arguments
df |
The performance data in a matrix or dataframe. |
paras |
The parameters from fitting |
min_item |
A vector with the minimum performance value for each algorithm. |
max_item |
A vector with the maximum performance value for each algorithm. |
epsilon |
A value defining good algorithm performance. If |
object |
For autoplot: the output of the function latent_trait_analysis. |
xlab |
For autoplot: the xlabel. |
ylab |
For autoplot: the ylabel. |
plottype |
For autoplot: plottype = 1 for all algorithm performances in a single plot, plottype = 2 for using facet_wrap to plot individual algorithms, plottype = 3 to plot the smoothing splines and plottype = 4 to plot strengths and weaknesses. |
nrow |
For autoplot: If |
se |
For autoplot: for plotting splines with standard errors. |
ratio |
For autoplot: for plotting strengths and weaknesses, ratio between x and y axis. |
... |
Other arguments currently ignored. |
Value
A list with the following components:
crmtheta |
The problem trait output computed from the R package EstCRM. |
strengths |
The strengths of each algorithm and positions on the latent trait that they performs well. |
longdf |
The dataset in long format of latent trait occupancy. |
plt |
The ggplot object showing the fitted smoothing splines. |
widedf |
The dataset in wide format with latent trait. |
thetas |
The easiness of the problem set instances. |
weakness |
The weaknesses of each algorithm and positions on the latent trait that they performs poorly. |
Examples
# This is a dummy example.
set.seed(1)
x1 <- runif(200)
x2 <- 2*x1 + rnorm(200, mean=0, sd=0.1)
x3 <- 1 - x1 + rnorm(200, mean=0, sd=0.1)
X <- cbind.data.frame(x1, x2, x3)
max_item <- rep(max(x1, x2, x3),3)
min_item <- rep(min(x1, x2, x3),3)
mod <- cirtmodel(X, max.item=max_item, min.item=min_item)
out <- latent_trait_analysis(X, mod$model$param, min_item= min_item, max_item = max_item)
out
# To plot performance against the problem difficulty
autoplot(out)
# To plot individual panels
autoplot(out, plottype = 2)
# To plot smoothing splines
autoplot(out, plottype = 3)
# To plot strengths and weaknesses
autoplot(out, plottype = 4)