View source: R/CSEM_scale_function.R
CSEM_scale_function | R Documentation |
The function is used to calculate the CSEM of some conversion of raw scores to a different reporting scale (e.g., coarse grades).
CSEM_scale_function(jointdist, my_scale_func)
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. |
The function returns a data.frame with the following columns
Value of abilit
Marginal distribution of theta
True score associated with value of ability on raw score scale
True score associated with value of ability on transformed reporting scale
CSEM on scale of raw scores
CSEM on scale of transformed scores on the reporting scale
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.