Closed esther1262 closed 1 year ago
Not sure what you mean by "scale is forced to be 1". Do you mean if the covariates all have values of zero, then you know that the scale parameter is 1? I would just implement a model with a scale and a shape parameter, define the location parameter to be the scale, and then use a fixedpars
argument in your flexsurvreg
call to fix the baseline scale to 1.
Assuming covariates Z include the intercept, there are two major parameters in standard log-logistic distribution. Z can only affect the scale parameter, scale = exp(-shape * gamma'Z)
.
shape = a
baseline hazard = scale * a * t^(a-1) / (1 + scale * t^a)
, while scale = exp(-shape*gamma0)
,
scale cannot be 1 unless we remove the intercept as well.
If we force scale = 1, the hazard given Z is the same for all Z right? In other words, Z won't affect the hazard anymore.
For my case, I want to take out the scale parameter and modify the log-logistic distribution to have only one parameter (shape). The hazard function is still affected by covariates but no longer via scale.
baseline hazard = a * t^(a-1) / (1 + t^a)
hazard | Z = a * t^(a-1) / (1 + t^a) * exp(b'Z)
Thanks
Is the example in Section 1.1 of the Supplementary Examples vignette https://cran.r-project.org/web/packages/flexsurv/vignettes/flexsurv-examples.pdf anything like what you want? A proportional hazards version of a model (generalized gamma) that is normally defined as an AFT model?
That might be the one. Thanks
Hi again I have been struggling with the package for my simulation and just found out this forum. I appreciate if you can help with all my questions.
In the standard accelerated failure time model with log-logistic distribution, covariates are wrapped inside the scale parameter. If I remember correctly, flexsurvreg outputs AFT estimates for log-logistic. Say the parameters: shape=a, scale, coefficients=gamma
The customized hazard for log-logistic, with covariates, would like to be
baseline_hazard exp(X'beta) = a t^(a-1) / (1+t^a) * exp(X'beta)
a = shape scale is forced to be 1 beta = odds ratios of covariates, should equal to -a * gamma
How can I create this hazard function and use it with flexsurvreg? I recoded the following function but didnt seem right.
Best Regards