R Users- I have been trying to automate a manual code that I have developed for calling in a .csv file, isolating certain rows and columns that correspond to specified months: something to the effect i=name.csv N=length(i$month) iphos1=0 iphos2=0 isphos3=0 for i=1,N if month=1 iphos1=iphos+1 iphos1(iphos1)=i
an so on to call out the months into there own arrays (unless there is a way I can wrap it into the next automation) Next: I would like to run a simple linear regression combining each of the months 1 by 1: for instance I want to run a regression on a combined model from months 1 and 2 and a dummy model for 1 and 2, compare them using a Chi-sq distribution, if Chi-sq is less than the Critical value, we accept and go on to test another set of models with both 1 and 2. If it rejects, then we proceed to months 2 and 3. If we move on to the second set on months 1 and 2, and the critical value is accepted, I want to print an accept or reject and move on to months 2 and 3, until finally comparing months 12-1 at the end. Is there a way to loop or automate this in R? Thanks Meredith -- View this message in context: http://r.789695.n4.nabble.com/Automating-R-for-Hypothesis-Testing-tp4618653.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.