Closed krz closed 7 years ago
I believe coef returns the transformed parameters. Gen. gamma uses a log transformation of sigma. Ln(1.05173) ~= 0.05044.
thanks, that explains it, but I am unsure if this is intended.
It's maybe half-intended, but having thought about it, I think this behaviour is OK. It's consistent with other kinds of regression models in R where coef() returns both the intercept and the regression coefficients on the transformed scale, e.g. in glm(), baseline log odds and log odds ratios in a logistic regression. In flexsurv, every parameter can have a regression model on it, even auxiliary parameters like sigma in the generalized gamma.
I'm not sure where would be the best place to document this - as it just uses stats:::coef.default and returns the $coefficients component of the model object - I've added a note to help(flexsurvreg), section "Value" to explain this component.
One way to handle documenting it would be to write a coef generic (even if it simply calls coef.default) and document it from there.
That sounds reasonable - done in latest commit.
Note R CMD check currently doesn't work as it's awaiting an update to the mstate package (which in turn was broken by a major update to the survival package)
I found a strange behaviour in the coef() function of a flexsurvreg object. Here is a minimal example:
The output of m is:
When I use coef, I get a different estimate for sigma (all others are the same)
sigma estimate is 0.05 here, was 1.05 above.
This may be a bug.