-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error versus warning on interactions without main effects #205
Comments
The real issue is three fold: in this situation survfit can create a curve that is nonsense, doing otherwise would require a a level of artificial intelligence in the routine far beyond my skills, and many users think the survival package is infallible. Consider the following small change in your example: A possible solution, which I will think on a bit, is to make the error message go away for someone who uses the newdata argument. I would be more willing to state "caveat emptor" in that case. What do you think? I'm currently on a trip, and won't do anything till I return. The code in noweb/coxsurv*.Rnw that deals with all these cases is dammably complex, so it is mandatory that any change be accompanied by a new test case to verify that nothing go mucked up. Not a job I will attempt on this little laptop screen. |
thanks for following up I see the potential ways in which this may go wrong and I get that 'human-error'-safety is valuable. Regarding the fix with supplying Whether or not it is better to protect people from unknowingly doing things that are mathematically meaningless, or to not block researchers who may know the math but are not coding-knowledgeable enough to change the source code of an R package, is something you probably have a better idea of then me. Another idea: would it be possible to add a global |
Hi,
Let's say there is a sound reason to fit a cox model conditional on some categorical variable (e.g. age group), and an interaction of a course-grained version of this categorical variable (e.g. age over 50) with another variable, like below:
Currently,
survfit
throws an error:However, given that the model conditions on the more fine-grained
age_cat
I cannot come up with any mathematical reason why this survfit would not be meaningful.Should this error be replaced by a warning? Or is there a reason that such models should never be allowed?
The text was updated successfully, but these errors were encountered: