Many thanks! Never used lists before, but it’s a great solution! It works
very well!
Although, I have a next question concerning this.
I want to know for which value (column) I have the maximal Rsquared.
Therefore, I unlist the LIST so that it’s written like a vector.
The columns were always na
I just saw a little mistake in my last post: Totally in the end, last line of
the last loop, results$depth[,u] [t-1] should be results$newdepth[,u] [t-1].
My apologies.
for (u in 1:91)
{
results$newdepth [,u]<- results$depth [,u]
for (t in 2:60)
{
results$newdepth[,u][t] <- results$newdepth[,u] [t
Lists are the answer.
LIST<-list()
for(i in 1:ncol(results6))
{
LIST[[i]]<-lm(results6[,i]~data$observed)
}
You'll now have a 91 entry list of lm(). You can then do something like
this:
LIST2<-list()
for(i in 1:length(LIST))
{
LIST2[[i]]<-LIST[[i]]$r.squared
}
This should now be a li
3 matches
Mail list logo