[R] Extracting results from the VAR output

Rmillan emiln_leifsson at hotmail.com
Fri Jul 27 10:57:41 CEST 2012


Hi everyone,

I'm working with the Vector Autoregressive Model (VAR), and it seems like
the ur.ca package provides the best 
function for this purpose. 
My problem is, that I don't know how to extract a certain value from the
output without using the variables names.
I was hoping that this could be done by using numerical value, e.g. [1],
instead of writing for instance $Liabilities. The reason why I want to do
this is, that this would help me to automize the process, since I may not
use the variable Liabilities next time.  

Here is an example when the process works, but I have to do it manually by
typing in $Liabilities

VARrow<-VAR(data,p=1,type="const")
row<-VARrow$varresult$Liabilities$coefficient
row[1]

Liabilities.l1 
    0.06898797 

It would be nice if I could type in e.g. colnames(data)[1] instead of
Liabilities (because colnames(data)[1] referes to Liabilites) but this
command just says the value is NULL instead 0.06898797....

Any help is much appriciated 



--
View this message in context: http://r.789695.n4.nabble.com/Extracting-results-from-the-VAR-output-tp4638072.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list