PREp | R Documentation |
Calculates the percent relative error (PRE) between an equated distribution and the reference distribution for the first ten moments.
PREp(eq, obs, r, s)
eq |
A numeric vector containing the equated values from X to Y or Y to X. |
obs |
The score vector of test Y or X. |
r |
A vector of probabilities corresponding to the equated values. |
s |
A vector of probabilities corresponding to the score values of test Y or X. |
If we equate test X to test Y, then we have equated values eYx with estimated probabilities r and estimated probabilities s for the score values on Y. To compare the moments between these two distributions, we can calculate the percent relative error (PRE) between them. If we denote the p:th moment of Y and eYx by μ(Y) and μ(eYx) respectively, the PRE for moment p is defined as
PRE(p) = 100*(μ(eYx)-μ(Y))/μ(Y).
A numeric vector containing the percentage relative error for the first ten moments.
bjorn.andersson@statistik.uu.se
kenny.branberg@stat.umu.se
marie.wiberg@stat.umu.se
Andersson, B., Branberg, K., Wiberg, M. (2013). Performing the Kernel Method of Test Equating with the Package kequate. Journal of Statistical Software, 55(6), 1–25. <doi: 10.18637/jss.v055.i06>
von Davier, A.A., Holland, P.W., Thayer, D.T. (2004). The Kernel Method of Test Equating. Springer-Verlag New York.
glm
kequate
P<-c(5, 20, 35, 25, 15) Q<-c(10, 30, 30, 20, 10) x<-0:4 glmx<-glm(P~I(x)+I(x^2), family="poisson", x=TRUE) glmy<-glm(Q~I(x)+I(x^2), family="poisson", x=TRUE) keEG<-kequate("EG", 0:4, 0:4, glmx, glmy) PREp(getEq(keEG), 0:4, glmx$fitted.values/100, glmy$fitted.values/100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.