At their core, objects produced by frair_fit are named lists (of class ‘frfit’ and ‘list’). It sounds like you want to operate on the underlying bbmle object, in which case you should try:
residuals(frair_fit$fit)
This is a general rule of thumb if you want to operate directly on the underlying model.
This specific example (extracting residuals) might not work because FRAIR does not fit models using the formula interface, which BBMLE (seems to) require for it’s residuals method. This is fair enough (from BBMLE’s perspective) as it has no knowledge of the underlying objective function (it is only ever passed the negative log-likihood functions to optimise).
We could develop a residuals method for a ‘frfit’ object… In the mean time you might need to DIY your own approach. This shouldn’t be hard, here is an example:
At their core, objects produced by frair_fit are named lists (of class ‘frfit’ and ‘list’). It sounds like you want to operate on the underlying bbmle object, in which case you should try:
This is a general rule of thumb if you want to operate directly on the underlying model.
This specific example (extracting residuals) might not work because FRAIR does not fit models using the formula interface, which BBMLE (seems to) require for it’s residuals method. This is fair enough (from BBMLE’s perspective) as it has no knowledge of the underlying objective function (it is only ever passed the negative log-likihood functions to optimise).
We could develop a residuals method for a ‘frfit’ object… In the mean time you might need to DIY your own approach. This shouldn’t be hard, here is an example: