Hi all, I'm doing Multiple linear regression for a data set. However, it takes a lot of time, as I would like to check every possible combination of factors, evalute the results based for instance on their p values, and then choose the best regression model. So, I wonder if anyone might have a script for that? Or if not, do you have some suggestions how to create such a script? I've been told there is a similar function in SAS, but I'm not sure how it works. Furthermore, I'm not sure how to deal with the evaluation of the results, are there any other factors I should consider, such as R square etc? All the best, Joel _________________________________________________________________ Hitta kärleken i vinter! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 [[alternative HTML version deleted]]
Joel F?rstenberg-H?gg said: "Multiple linear regression [...] I would like to check every possible combination of factors, evalute the results based for instance on their p values, and then choose the best regression model." By "every possible combination of factors", I assume you mean that for k factors, you want to consider all 2^k models where each factor is either present in the model or absent from it as a main effect, (or do you mean to include interactions as well?), selected by p-value? Speaking from a statistical practice point of view, this is probably not a good idea. If you really want to do a "best subset" type regression, there's the package bestglm at CRAN. http://cran.r-project.org/web/packages/bestglm/index.html - it doesn't do it by p-values and if your factors have more than two levels it does it via complete enumeration rather than using something efficient like the leaps and bounds algorithm, but it's close to the sort of thing you want. Doubtless there are other packages that also implement this sort of exhaustive model selection. -- View this message in context: http://n4.nabble.com/Multiple-regression-script-tp954567p954940.html Sent from the R help mailing list archive at Nabble.com.