Closed mikesweeting closed 1 month ago
Mike: my apologies for this very late reply.
There is a long-standing issue with using interactions between factor variables and splines in rstpm2 -- the design matrix is often not what you want. The simplest approach is to use indicator variables.
Sincerely, Mark.
Thank you Mark for informing me about issues with using factor variables in rstpm2. I'll bear this in mind and will use dummy variables when needed.
Best wishes Mike
Hi Mark, I think there may be a bug using stpm2 with factor variables. I get an error message when trying to change the degrees of freedom for a time-varying factor variable, but the error message goes if we use dummies instead. See example below