View source: R/Kernel Equating Functions.R
optPEN1 | R Documentation |
This function minimises a defined penalty term for a given bandwidth against a given distribution. The definition of PEN1 can be found in Liang and von Davier (2014). The values of PEN1 are not of much interest in their own right. Finding the bandwidth that minimises this penalty (using optPEN1) can potentially be useful as identifying a plausible bandwidth to use in subsequent kernel equating.
optPEN1(scores, fX)
scores |
Vector of possible scores. |
fX |
Number of people achieving each score (weighted numbers, probabilities or proportions also acceptable). Must be same length as scores. |
Note that although this is a typical method of determining the bandwidth it is widely considered to undersmooth. For this reason it is more commonly used when fX has been pre-smoothed with a log-linear model or when the sample size is very large.
The function returns a single value (labelled "minimum") representing bandwidth (between 0.05 and 30) that minimises PEN1 and the value on PEN1 (objective) at that value.
Liang, T., & von Davier, A. A. (2014). Cross-validation: An alternative bandwidth-selection method in kernel equating. Applied Psychological Measurement, 38(4), 281-295.
x1=rowSums(mathsdata)#make some scores
tab=tabulate(x1+1)#count how many people got each integer score
cbind(0:max(x1),tab)#look at the table
PEN1(0.5,0:max(x1),tab)#calculate PEN1 for a given bandwidth
optPEN1(0:max(x1),tab)#optimise PEN1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.