Jay Ulfelder
2009-Oct-09 14:22 UTC
[R] Help producing plot for assessing forecasting accuracy
Dear colleagues, I'm trying (and failing) to write the script required to generate a chart that would help me assess the forecasting accuracy of a logistic regression model by plotting the cumulative proportion of observed events occurring in cases across the range of possible predicted probabilities. In other words, let: x = any value on 0-1 scale phat_i = predicted probability of event Y from logit model for case i y_i = observed outcome (0/1) for case i Y_cond = sum(y_i) conditional on phat_i <= x Y_tot = total number of events observed in sample What I'm trying to plot is (Y_cond)/(Y_tot) across all values of x. I would be grateful for any guidance you can offer, and I'm sorry if I've overlooked some really simple solution; I'm fairly new to R and learning by doing. Regards, Jay -- Jay Ulfelder, Ph.D. Research Director Political Instability Task Force Science Applications International Corp. (SAIC) jay_ulfelder at stanfordalumni.org (301) 588-8478 [home office] (301) 580-8736 [mobile]
Reasonably Related Threads
- Quantative procedure assessing if data is normal
- Assessing fit for non-nested models using clogit in survival package
- Assessing overdispersion and using quasi model with lmer, possible?
- Assessing standard errors of polynomial contrasts
- Assessing Customer Satisfaction and Agile Project Management - PhD Dissertation