Closed dwfncar closed 10 years ago
The following R code can be used to compute BCGSS:
calcBCGSS = function(d){
if( 0 == d$total ){ return (NA); }
dblF = d$fy_oy + d$fy_on;
dblO = d$fy_oy + d$fn_oy;
dblLf = log(dblO / d$fn_oy);
dblHa = dblO - (d$fy_on / dblLf) lambert_W0(dblO / d$fy_on dblLf);
return( (dblHa - (dblO^2 / d$total)) / (2*dblO - dblHa - (dblO^2 / d$total)) );
}
by johnhg
Committed a whole bunch of changes to the repository to add these statistics. However, I'm keeping the ticket open for now, because I want to check the computed values against what R produces one more time before resolving. by johnhg
Added several output columns to the end of the CTS line type: LODDS, ORSS, EDS, SEDS, EDI, SEDI, and BCGSS plus confidence intervals. Tested by comparing to the output of the R verification package. by johnhg
Add several new scores and their standard error values to the contingency table statistics line type. Compare to values produced by Matt Pocernich's R code in the package "verification".
Once complete, add new JIRA issues to add to METViewer, handle appropriately in stat_analysis, and incorporate into regression testing.
Statistics include: add in output columns for stat, stat_ncl, stat_ncu, stat_bcl, stat_bcu
theta - Odds Ratio (already in CTS line)
log.theta - Log Odds Ratio
LOR.se - Standard Error for Log Odds Ratio (for use in computing normal confidence limits)
n.h - Degrees of freedom for log.theta (for computing confidence limits)
orss - Odds ratio skill score, aka Yules's Q
ORSS.se - Standard Error for Odds ratio skill score (CI's)
eds - Extreme Dependency Score
esd.se - Standard Error for EDS (CI's)
seds - Symmetric Extreme Dependency Score
seds.se - Standard Error for Symmetric Extreme Dependency Score (CI's)
EDI - Extreme Dependency Index
EDI.se - Standard Error for EDI
SEDI - Symmetric EDI
SEDI.se - Standard Error for SEDI
Bias-Corrected Gilbert Skill Score (not in Matt's verification package)
Matt's R code for these and other stats are included below: