Dear Community,

I have the following two variables, which I have split according to a
factor:

*y1*
 [1]

1
2
3  [2]

2
3
4

and

*y2*

A B  [1]


1 4
2 5
3 6  [2]


2 5
3 6
4 7

Now I need the following Vector Autoregressive Models:
VAR(cbind(y1[1],y2[1]$A)), VAR(cbind(y1[1],y2[1]$B)),
VAR(cbind(y1[2],y2[2]$A)), VAR(cbind(y1[2],y2[2]$B)). My problem is that
when using this argument: lapply(y2, function(x) VAR(cbind(x,y1),ic="SC",
lag.max=5), I receive these models: VAR(cbind(y1[1],y1[2],y2[1]$A)),
VAR(cbind(y1[1],y1[2],y2[1]$B)), VAR(cbind(y1[2],y1[1],y2[2]$A)),
VAR(cbind(y1[2],y1[1],y2[2]$B)). Can anybody help me?

Thank you

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to