Learn R Programming

kequate (version 1.5.0)

PREp: Percent Relative Error

Description

Calculates the percent relative error (PRE) between an equated distribution and the reference distribution for the first ten moments.

Usage

PREp(eq, obs, r, s)

Arguments

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.

Value

A numeric vector containing the percentage relative error for the first ten moments.

Details

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 $\mu(Y)$ and $\mu(eYx)$ respectively, the PRE for moment p is defined as

$$PRE(p) = \frac{100 \mu(eYx)-\mu(Y)}{\mu(Y)}.$$

References

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. URL http://www.jstatsoft.org/v55/i06/

von Davier, A.A., Holland, P.W., Thayer, D.T. (2004). The Kernel Method of Test Equating. Springer-Verlag New York.

See Also

glm kequate

Examples

Run this code
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)

Run the code above in your browser using DataLab