MATLAB: How to calculate regression with dumthe variables MATLAB Hi, I am trying to use 2nd degree polynomial regression with dummy variables. Which function should I use? Thanks for any help! Best Answer If you have the Statistics and Machine Learning Toolbox, take a look at the fitlm function.You might also find the dummyvar command useful for creating dummy variables.Take a look at Regression with Categorical Covariates for an example. Related SolutionsMATLAB: How to calculate AIC in glmfit 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 MATLAB: Fitnlm and dumthe variables I haven't used the automatic creation of dummy variables, so I don't know the answer to your question. However, the dummyvar() function might also be helpful for you, so I thought I'd mention it. Related Question
Best Answer