4
The vector below indicates the regressions I circled.
regression_pairs=c("A~B", "C~D", "E~F", "G~H","I~J","K~L","M~N","O~P","Q~R")
regression_pairs
Below is the list where I saved the residuals of each regression residuals.new
:
residuals.new <- list()
a=c(1,2,3,4,5)
b=c(6,7,8,9,10)
c=c(11,12,13,14,15)
d=c(16, 17, 18, 19, 20)
e=c(21,22,23,24,25)
f=c(26,27,28,29,30)
g=c(31,32,33,34,35)
h=c(36,37,38,39,40)
i=c(41,42,43,44,45)
residuals.new[[1]]=a
residuals.new[[2]]=b
residuals.new[[3]]=c
residuals.new[[4]]=d
residuals.new[[5]]=e
residuals.new[[6]]=f
residuals.new[[7]]=g
residuals.new[[8]]=h
residuals.new[[9]]=i
residuals.new
That is, the residues of regression A~B
sane 1,2,3,4,5
, C~D regression residues are 6,7,8,9,10
and so on.
After a certain criterio saw that the best pairs are those represented by the list below:
bestresults<-list()
best_pairs=c("A~B", "G~H", "Q~R")
Now I need to figure out a way to create a list that takes the residuals referring to the regressions presented by the list best_pairs
.
Someone could help me?
Below is the result I seek:
the.bestresiduals<-list()
the.bestresiduals[[1]]=c(1,2,3,4,5)
the.bestresiduals[[2]]=c(16, 17, 18, 19, 20)
the.bestresiduals[[3]]=c(41,42,43,44,45)
the.bestresiduals
[[1]]
[1] 1 2 3 4 5
[[2]]
[1] 16 17 18 19 20
[[3]]
[1] 41 42 43 44 45
Some help?