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
When I try to use a factor variable for the status in as_ped, the code errors out. I tested this only with competing risk data where using factor or character variables for the status can make the data easier to understand.
While I think this makes some sense (eg to avoid considering the wrong factor level as censoring), the error message is not especially clear and it is somewhat unexpected because the survival package allows for factors (and I guess this is the package most users are familiar with).
Error in if (!any(1L * (unique(data[[outcome_vars[length(outcome_vars)]]])) == :
missing value where TRUE/FALSE needed
In addition: Warning message:
In Ops.factor(1L, (unique(data[[outcome_vars[length(outcome_vars)]]]))) :
‘*’ not meaningful for factors
I think a more helpful error message would already improve the situation, but maybe adding the functionality would make it more intuitive to use.
The text was updated successfully, but these errors were encountered:
jonas-schropp
changed the title
as_ped: status variable can not be of type factoras_ped: status variable can not be of type factor
May 6, 2022
When I try to use a factor variable for the status in
as_ped
, the code errors out. I tested this only with competing risk data where using factor or character variables for the status can make the data easier to understand.While I think this makes some sense (eg to avoid considering the wrong factor level as censoring), the error message is not especially clear and it is somewhat unexpected because the
survival
package allows for factors (and I guess this is the package most users are familiar with).Below is an example:
and this is the result:
I think a more helpful error message would already improve the situation, but maybe adding the functionality would make it more intuitive to use.
The text was updated successfully, but these errors were encountered: