Re: [R] Looping through different groups of variables in models

2016-09-01 Thread Kai Mx
Thanks so much everybody, especially to Dennis. I didn't really occur to me that I could put the models into a list. I have used dplyr for simple data transformations and will definitely look into it. On Thu, Sep 1, 2016 at 8:10 AM, Dennis Murphy wrote: > Hi: > > See inline. > > On Wed, Aug 31,

Re: [R] Looping through different groups of variables in models

2016-08-31 Thread Jim Lemon
Hi Kai, Perhaps something like this: kmdf<-data.frame(group=rep(c("exp","cont"),each=50), time=factor(rep(1:5,20)), condition=rep(rep(c("hot","cold"),each=25),2), value=sample(100:200,100)) for(timeindx in levels(kmdf$time)) { for(condindx in levels(kmdf$condition)) { cat("Time",timeindx,"Co

Re: [R] Looping through different groups of variables in models

2016-08-31 Thread Bert Gunter
Kai: 1. I think that this is a very bad idea, statistically, if I understand you correctly. Generally, your model should incorporate all groups, time points, and conditions together, not individually. 2. But plotting results in "small multiples" -- aka "trellis plots" may be useful. This is done

[R] Looping through different groups of variables in models

2016-08-31 Thread Kai Mx
Hi all, I am having trouble wrapping my head around a probably simple issue: After using the reshape package, I have a melted dataframe with the columns group (factor), time (int), condition (factor), value(int). These are experimental data. The data were obtained from different treatment groups