CSEM_scale_function: Calculate the Conditional Standard Error of Measurement...

View source: R/CSEM_scale_function.R

CSEM_scale_functionR Documentation

Calculate the Conditional Standard Error of Measurement (CSEM) of scale scores

Description

The function is used to calculate the CSEM of some conversion of raw scores to a different reporting scale (e.g., coarse grades).

Usage

CSEM_scale_function(jointdist, my_scale_func)

Arguments

jointdist

A data.frame giving the joint distribution of true and observed raw scores into the format created by 'JointAbilityScoreDist'.

my_scale_func

A function that can taken any valid vector of raw scores and return the transformed scores on the reporting scale.

Value

The function returns a data.frame with the following columns

theta

Value of abilit

p_theta

Marginal distribution of theta

true_raw

True score associated with value of ability on raw score scale

true_scale

True score associated with value of ability on transformed reporting scale

csem_raw

CSEM on scale of raw scores

csem_scale

CSEM on scale of transformed scores on the reporting scale

Examples

## Not run: 
#library(unimirt)
mirtRasch=unimirt(mathsdata,"Rasch")
jdist=JointAbilityScoreDist(mirtRasch)
csem1=CSEM_scale_function(jdist,I)#if transformation is just the identity function
head(csem1)
ggplot(data=csem1,aes(x=true_raw,y=csem_raw))+geom_line()
ggplot(data=csem1,aes(x=true_scale,y=csem_scale))+geom_line()

#a more interesting example
#imagine raw scores are converted to grades from 0 to 5 according to some cut-scores
scale_func=stepfun(x=c(17,33,47,60,72),y=0:5)
csem2=CSEM_scale_function(jdist,scale_func)
ggplot(data=csem2,aes(x=true_raw,y=csem_raw))+geom_line()
ggplot(data=csem2,aes(x=true_raw,y=csem_scale))+geom_line()
ggplot(data=csem2,aes(x=true_scale,y=csem_scale))+geom_line()

## End(Not run)

CambridgeAssessmentResearch/unimirt documentation built on June 10, 2025, 6:03 a.m.