MATLAB: How to calculate AIC in glmfit aicfitglmglmglmfitStatistics and Machine Learning Toolbox Please help me with this! How to calculate AIC in glmfit? I use gamma and log as link function. Thanks a lot! Best Answer It is recommended to use fitglm instead of the older glmfit. Depending on the release of MATLAB (> R2012a) you can use either of the two:http://www.mathworks.com/help/stats/fitglm.htmlhttp://www.mathworks.com/help/stats/generalizedlinearmodel.fit.htmlYou can access AIC, BIC etc as follows:load hospitalmodelspec = 'Smoker ~ Age*Weight*Sex - Age:Weight:Sex';mdl = fitglm(hospital,modelspec,'Distribution','binomial')mdl.ModelCriterionans = AIC: 137.141380948166 AICc: 138.358772252513 BIC: 155.377572250082 CAIC: 162.377572250082 Related SolutionsMATLAB: Multiple regression with categorical variables In "fitlm" function you can specify which variables are categorical. For more information on how to achieve this, I would suggest to refer the documentation example given in the link below:https://www.mathworks.com/help/stats/fitlm.html#bt0clcj-1 MATLAB: Where is the pvalue of the model stored in fitlm or fitglm I had the same question. While looking for the answer online, I found the answer to this from here: StackOverflow.This would work for fitlm as well:p = coefTest(mdl);I'm using Matlab 2018a. Not sure if the function is available in previous versions.Best. Related QuestionPrinting output of fitglm as table to fileCompare 2 regression modelsHow does plotslice used to analyze generalized linear models generate simultaneous confidence bounds
Best Answer