% ' class.asp FUNCTION area (zz) ' From Hastings, c. Jr. (1955). Approximations for Digital Computers ' Princeton, NJ: Princeton University Press. z = ABS(zz) c1 = .196854 c2 = .115194 c3 = .000344 c4 = .019527 ph = .5 / (1 + c1 * z + c2 * z ^ 2 + c3 * z ^ 3 + c4 * z ^ 4) ^ 4 IF zz > 0 THEN ph = 1 - ph area = ph END FUNCTION FUNCTION bell (ath) IF ABS(ath) > 20 THEN b1 = 0 ELSE b1 = EXP(-1*ath * ath / 2.0) / (SQR(2 * 4 * ATN(1)*sd)) ' note: 4 * ATN(1)= pi END IF bell = b1 END FUNCTION FUNCTION probt (j, th) ' probability of a correct repsonse on item j for examine of ability th dem = 1 + EXP(-1.7 * a(j) * (th - b(j))) pr = c(j) + ((1 - c(j)) / dem) IF pr < .00001 THEN pr = .00001 IF pr > .99999 THEN pr = .99999 probt = pr END FUNCTION FUNCTION reliab ' computes average standard error ' weighted by bell curve frequency see = 0 FOR th = -5 TO 5 STEP .1 ff = bell((th-am)/sd) ' se = ff / SQR(tinfo(th)) se=ff*tinfo(th) sff = sff + ff see = see + se NEXT ' average info see = see / sff see=1/sqr(see) if see>=1 then see=.99999999 ' convert see to reliability reliab = SQR(1 - see * see) END FUNCTION FUNCTION tinfo (th) t = 0 FOR i = 1 TO ni pr = probt(i, th) ainfo = a(i) * a(i) * (1 - pr) * (pr - c(i)) * (pr - c(i)) / (pr * (1 - c(i)) * (1 - c(i))) t = t + ainfo NEXT tinfo = t END FUNCTION ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' DIM a(150), b(150), c(150), result(2, 2) del = .05 ' make smaller for finer accuracy (takes longer) idebug = 0 wh=request("wh")+" " wh=lcase(trim(wh)) response.write "
"
response.write "Use this to check the expected accuracy of various tests using different cut scores
"
response.write "and distributions. If you want it, here is the ASP (old) source code.
"
response.write "code and executable for this.
"
response.write " - Lawrence Rudner (lmrudner@X edres.org (remove the spam-foiling X and space))
" response.write "
" response.write "paper | PARE" case else thc=request("thc") thca=request("thca") am=request("am") s=request("s") if thc="" then thc=0 IF thca <> "" THEN thca = thca ELSE thca = thc IF s = "" THEN sd = 1 ELSE sd = s thc=cdbl(thc) thca=cdbl(thca) am=cdbl(am) SELECT CASE wh CASE "a" ifl="pcsap5.txt" CASE "b" ifl="pnaep8.txt" CASE "c" ifl="param0.txt" END SELECT ifl="g:\www\pare\misclass\" & ifl Dim fs,a1 Set fs = CreateObject("Scripting.FileSystemObject") Set a1 = fs.OpenTextFile(ifl, 1, FALSE) ni = 0 Do While a1.AtEndOfStream <> True ' read #1, a(ni), b(ni), c(ni) alin=a1.readline alin=trim(alin) if left(alin,1)<>";" then aa=split(alin, ",", 3) ni = ni + 1 a(ni)=cdbl(aa(0)) b(ni)=cdbl(aa(1)) c(ni)=cdbl(aa(2)) xa = xa + a(ni) xb = xb + b(ni) xc = xc + c(ni) end if LOOP a1.close set a1 = nothing set fs = nothing xa = xa / ni xb = xb / ni xc = xc / ni response.write "Expected Misclassification Analysis
"
select case wh
case "a"
response.write "Colorado Assessment dataset"
case "b"
response.write "State NAEP dataset"
case "c"
response.write "Generated dataset"
end select
response.write "
"
response.write ni & " items
"
rr = reliab
response.write "Reliability = " & round(rr,3) & "
"
response.write "Mean a, b, c: " & round(xa,3) &", "& round(xb,3) &", " & round(xc,3) &"
"
' initialize
FOR i = 1 TO 2
FOR j = 1 TO 2
result(i, j) = 0
NEXT
NEXT
' compute observed and expected for 99.99% of the curve
FOR th = -5 TO 5 STEP del
th = CINT(1000 * th) / 1000.0
se = 1.0 / SQR(tinfo(th))
z = (th - am) / sd
fth = bell(z)
aa = area((thca - th) / se)
pltcut = aa * fth
pgtcut = (1.0 - aa) * fth
sbell = sbell + fth
IF th > thc THEN ' true master
result(1, 1) = result(1, 1) + pgtcut
result(1, 2) = result(1, 2) + pltcut
ELSE
result(2, 1) = result(2, 1) + pgtcut
result(2, 2) = result(2, 2) + pltcut
END IF
NEXT
' adjust for the tiny area at the tails
tail = (1.0 / del - sbell) / 2.0
result(1, 1) = result(1, 1) + tail
result(2, 2) = result(2, 2) + tail
sbell = sbell + 2 * tail
' rescale to proportions
FOR i = 1 TO 2
FOR j = 1 TO 2
result(i, j) = round((100*result(i, j) / sbell),1)
NEXT
NEXT
' present findings
response.write "Cut score: " & thc & "
"
response.write " adjusted cut score: " & thca & "
"
response.write "Group mean,sd: " & am & ", " & sd & "
"
response.write "
" response.write "
| Expected classification | |||
| Master | Non-Master | total | |
| True Master | " response.write ""& result(1, 1) & " | " & result(1, 2) & " | " & result(1, 1) + result(1, 2)&" |
| True Non-Mas | " response.write ""& result(2, 1) & " | " & result(2, 2) & " | " & result(2, 1) + result(2, 2)&" |
| Total | " response.write "" &result(1, 1) + result(2, 1) & " | " & result(1, 2) + result(2, 2) &" | |
| Accuracy = " & (result(1, 1) + result(2, 2)) & " percent | |||
"
response.write "Percent misclassifed true masters:
"
response.write " 100 * " & result(1, 2) & " / (" & result(1, 1) & " + " & result(1, 2) & ") = " & round(100*result(1, 2) / (result(1, 1) + result(1, 2)),1) & "%
"
response.write "Percent misclassifed true non-masters:
"
response.write " 100 * " & result(2,1) & " / (" & result(2,1) & " + " & result(2, 2) & ") = " & round(100*result(2,1) / (result(2, 1) + result(2, 2)),1) & "%
"
response.write "
Back | paper | PARE | ERIC/AE" end select response.write "" response.END %>