I am using Growthrate package in R to calculate maximum growth rate value. I used two models fit_easylinear and fit_spline models.
Now, I want to extract AIC value for each well after fitting two models. any help at this moment is highly appreciated.
dataset:
library(growthrates)
split_df <- split(bactgrowth,~strain+replicate+conc)
timeseries <- lapply(split_df, function(x) x$value)
Trying to use the AIC on e.g. one of the fit fit_splinemodel-s gives me an error message:
AIC(fit_splinemodel[[3]] )
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "c('smooth.spline_fit', 'growthrates_fit')"
Personally I prefer to use the map functions of the purrr package instead of lapply.
In the code below I extract the deviance value from the first six model results.
Do not know if that makes any sense to you. ?`rsquared,growthrates_fit-method ` shows which results can be accessed
Thank you for your help. It's not giving the actual AIC value but giving RSS. I can use that but what I need is to get AIC which I am not sure how to get it.