plotDensity | R Documentation |
This function plots density curves based on the regression model against the raw scores. It supports both traditional continuous norming models and beta-binomial models. The function allows for customization of the plot range and groups to be displayed.
plotDensity(
model,
minRaw = NULL,
maxRaw = NULL,
minNorm = NULL,
maxNorm = NULL,
group = NULL
)
model |
The model from the bestModel function, a cnorm object, or a cnormBetaBinomial or cnormBetaBinomial2 object. |
minRaw |
Lower bound of the raw score. If NULL, it's automatically determined based on the model type. |
maxRaw |
Upper bound of the raw score. If NULL, it's automatically determined based on the model type. |
minNorm |
Lower bound of the norm score. If NULL, it's automatically determined based on the model type. |
maxNorm |
Upper bound of the norm score. If NULL, it's automatically determined based on the model type. |
group |
Numeric vector specifying the age groups to plot. If NULL, groups are automatically selected. |
The function generates density curves for specified age groups, allowing for easy comparison of score distributions across different ages.
For beta-binomial models, the density is based on the probability mass function, while for traditional models, it uses a normal distribution based on the norm scores.
A ggplot object representing the density functions.
Please check for inconsistent curves, especially those showing implausible shapes such as violations of biuniqueness in the cnorm models.
plotNormCurves
, plotPercentiles
Other plot:
compare()
,
plot.cnorm()
,
plot.cnormBetaBinomial()
,
plot.cnormBetaBinomial2()
,
plotDerivative()
,
plotNorm()
,
plotNormCurves()
,
plotPercentileSeries()
,
plotPercentiles()
,
plotRaw()
,
plotSubset()
## Not run:
# For traditional continuous norming model
result <- cnorm(raw = elfe$raw, group = elfe$group)
plotDensity(result, group = c(2, 4, 6))
# For beta-binomial model
bb_model <- cnorm.betabinomial(age = ppvt$age, score = ppvt$raw, n = 228)
plotDensity(bb_model)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.