Hi everyone, I am writing this to get your help. I have a big data set and I wanted to do multiple regression and repeat this process several timesfor example (data)where y: dependent variables ; number of columns are 5, nrow = 1800y temp, preci, growing season days, max temp, min temp region4 23 0 127 35 14 NORTH AMER10 35 21 120 32 17 NORTH AMER1 18 1 90 27 12 EUROPE........... 1) here I wanted to do linear regression (simple regression) using each predictor (temp, preci, growing season days, max temp... etc), separatelyafter that, I want to second quadratic regression using each predictor, and third - polynomial (cubic)2) I wanted to compare the models (linear, quadratic and cubic) and chose the best model 3) I wanted to do multiple regression using the best model of each variable Further, I wanted to divide the data into groups by region. and, then perform the above analysis for each group (by region)and, I wanted to compare the residuals between the models where I have been using all data set and the models by region I was trying to do manually, but it is taking so much time. I think it is not difficult and does not take time to write script in R. I was trying to make loop but I could not succeedI would be very grateful if you help me how I can write script (loop function) and compute the analysis in R. Thanks for your support. Sincerely, Kristi GloverUniversity of Windsor, Windsor, Canada
[[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.