resplab / epicR

R package for the Evaluation Platform in COPD (EPIC), an agent-based whole-disease model for projection of health and economic outcomes and COPD interventions.
11 stars 11 forks source link

Prevalence of gold stages are wrong #16

Closed aminadibi closed 7 years ago

aminadibi commented 7 years ago

report_copd_by_ctime() returns this: image

Which is almost the opposite of what it should be. Gold IV should have the lowest prevalence of all, and Gold I the highest.

aminadibi commented 7 years ago

This is how it looks in epicR v0.3.1, which shows slightly higher prevalence of GOLD II compared to Gold I. image

Here are calculated GOLD stages for incidence cases:
> run(1000000)
[1] 0
> all_events_raw <- Cget_all_events_matrix()
> all_events <- as.data.frame(all_events_raw)
> COPD_events <- subset(all_events, event==4)
> 
> 
> table(COPD_events[,"gold"])/sum(table(COPD_events[,"gold"]))

         1          2          3          4 
0.39599318 0.50639386 0.07757886 0.02003410 

And same for prevalent cases:

> table(start_events[,"gold"])/sum(table(start_events[,"gold"]))

         1          2          3          4 
0.39910979 0.47873393 0.09000989 0.03214639 

To put it in perspective, these are CanCOLD GOLD stages for prevalent COPD cases: image

and CanCOLD GOLD stages for incidence cases: image

Mohsen believes that epicR numbers for GOLD stages are coherent, and the difference between CanCOLD and epicR are not significant, most likely due to a difference in population.

So, we're good!

aminadibi commented 7 years ago

``