Displaying 1 result from an estimated 1 matches for "zongsplit".
Did you mean:
oggsplit
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
...time for each combination of ID and Variable.
I have tried several approaches and none of them seems to work as i
expected.
For example, i have tried:
theSplit<-split(theTestLineal, list(as.factor(theTestLineal $ids),
as.factor(theTestLineal $variable)))
I can then use
lm(value~seqMonth,data=zongSplit[[1]])
...
lm(value~seqMonth,data=zongSplit[[4]])
that works well, (it fails for some combinations of ID and variable where
there is one datapoint)
however when i try to use an lapply:
lapply(zongSplit,function(x)lm(value~seqMonth,data=x,na.action=na.exclude))
it fails, with error message:
Error...