[R] Extracting results from the VAR output
ruipbarradas at sapo.pt
Fri Jul 27 13:34:28 CEST 2012
I'm not familiar with package urca but your problem seems to be in the
access of a list member.
The operator '$' is an alternative to '[[', and you are right, the
latter is recommended programmatically.
Try something along the lines of the following.
VARrow[[ "varresult" ]][[ "Liabilities" ]]
And note that you can use numbers instead of the members' names.
str(VARrow) would give the structure of the variable and the appropriate
numbers to use (just count).
Hope this helps,
Em 27-07-2012 09:57, Rmillan escreveu:
> 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. ,
> 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
> It would be nice if I could type in e.g. colnames(data) instead of
> Liabilities (because colnames(data) 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.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help