Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Vargranger
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Vargranger
Date
Mon, 8 Jul 2013 13:44:13 +0100
The syntax of -display- is defined in the help as
display [display_directive [display_directive [...]]]
which is to be interpreted as the command -display- followed by zero
or more display_directives. The term display_directive is defined
immediately. (Asking to -display- zero display_directives makes sense,
as -display- by itself yields a blank line.)
The examples of -display- given in the help include
. display as text "mean of mpg = " as result r(mean)
showing in this case that literal text and a saved result can be
shown. Use of formats is indicated as a possibility in the help. It's
to be expected that you'd need to look at other sections of the help
and/or the manuals to find out more.
In my recent example R was explained to be a matrix. Earlier in the
thread I gave an example of putting saved results into a matrix.
Nick
[email protected]
On 8 July 2013 13:18, Ioannis Bournakis <[email protected]> wrote:
> Sorry Nick, I know...this question might look basic but it is quite
> confusing indeed. I could not find any explicit example in the help display.
>
> In you example below, what does R[1,1] declare? Is it the name of a matrix
> previously defined or just stands from return.
Nick Cox
> Your reply was sent in HTML. See
>
> http://hsphsun3.harvard.edu/cgi-bin/lwgate/STATALIST/archives/statalist.1307/date/article-225.html
>
> for how your email will appear to the majority of the members of this
> list The FAQ explains that you should not send formatted posts.
>
> As before, why not read the help to find out what you need? -help
> display- makes it quite explicit that you can use -display- to display
> two or more things.
>
> For example, if a statistic were held in the first column and a
> P-value in the third column of a matrix R then something like
>
> . di %9.3f R[1,1] " " %05.3f R[1,3]
> 0.065 0.978
>
> shows some possibilities. In general, you will need to specify (a)
> literal text (b) numeric results (c) display formats for a decent
> display. (The numbers here have no bearing on your example,
> naturally.)
On 8 July 2013 11:55, Ioannis Bournakis <[email protected]> wrote:
>> That was helpful, thanks. Is there any possibility to report two
>> statistics
>> in the same row suing the di [a,b] command.
>>
>> For instance, I am given this output after the vargranger command:
>>
>> Granger causality Wald tests
>> +------------------------------------------------------------------+
>> Equation Excluded chi2 df Prob > chi2
>> --------------------------------------+---------------------------
>> D_trade D.ind_share 13.282 4 0.010
>> D_trade D.ser_share 18.164 4 0.001
>> D_trade ALL 27.893 8 0.000
>> --------------------------------------+---------------------------
>> D_ind_share D.trade 3.5946 4 0.464
>> D_ind_share D.ser_share 150.71 4 0.000
>> D_ind_share ALL 175.65 8 0.000
>> --------------------------------------+---------------------------
>> D_ser_share D.trade 8.2083 4 0.084
>> D_ser_share D.ind_share 41.003 4 0.000
>> D_ser_share ALL 54.064 8 0.000
>> +------------------------------------------------------------------+
>>
>> I want chi2 and p-value of the first equation to appear together (or to be
>> reported with a single command) and likewise for the rest equations.
>> Typing
>> di [a,b] provides only only statistic value as a scalar.
>
> Nick Cox
>
>> It is a good idea to read the help when using any command.
>>
>> http://www.stata.com/help.cgi?vargranger documents that -vargranger-
>> leaves r-class results in its wake. After running -vargranger-
>>
>> mat results = r(gstats)
>>
>> will copy the set of statistics to a matrix, after which you can
>> display or use one or more elements as desired, e.g.
>>
>> di results[1,1]
>
> On 8 July 2013 10:04, Ioannis Bournakis <[email protected]> wrote:
>
>>> I estimate a VAR model for a panel of countries and after the var
>>> command,
>>> I perform a granger causality test using the vargranger command.
>>> My question is how to save the chi-square value of the vargranger
>>> command.
>>> When I type ereturn list, it gives me all the information associated with
>>> the var estimation but not the chi2 value for vargranger.
>>>
>>> I want to save the results from vargranger and then report them in a
>>> table.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/