You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have a good minimal working example or anything, but I'm going to try my best to describe what's going on.
After calling gg_survival with either type "kaplan" or type "nelson" and supplying a factor for 'by', survfit with strata on 'by' is called. The default is na.group = FALSE, so it stratifies only on the other levels of the factor.
A little further down in the code, we have this bit:
Unique also returns 'NA' as an option, but NA was not included as a stratum level, so if you have a situation where NA occurs before at least one of your levels, it will take its place and you'll drop a factor level you potentially cared about.
I solved it myself by editing in na.group = TRUE to the call to strata in the kaplan and nelson functions because I wanted that information anyway, but I guess this might be something encountered by others as well!
The text was updated successfully, but these errors were encountered:
I don't have a good minimal working example or anything, but I'm going to try my best to describe what's going on.
After calling gg_survival with either type "kaplan" or type "nelson" and supplying a factor for 'by', survfit with strata on 'by' is called. The default is na.group = FALSE, so it stratifies only on the other levels of the factor.
A little further down in the code, we have this bit:
Unique also returns 'NA' as an option, but NA was not included as a stratum level, so if you have a situation where NA occurs before at least one of your levels, it will take its place and you'll drop a factor level you potentially cared about.
I solved it myself by editing in na.group = TRUE to the call to strata in the kaplan and nelson functions because I wanted that information anyway, but I guess this might be something encountered by others as well!
The text was updated successfully, but these errors were encountered: