Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Writing output to a file


From   jean ries <[email protected]>
To   [email protected]
Subject   st: Re: Writing output to a file
Date   Tue, 28 Feb 2006 11:45:51 +0100

Paul Fenner wrote:
>I am using permute on a Kruskal-Wallis test;
>permute var z=r(chi2_adj), reps(10000) nodots nowarn: kwallis var if
>class==6|class==7,by(class)
>and I can obtain the probability from:
>
>.matrix list r(p)
>symmetric r(p)[1,1]
> z
>y1 .8759
>
>I would like to write this value to a file for subsequent processing but I
>am unable to display the matrix element:
>. display r(p)[1,1]
>invalid syntax
>r(198);
>Could somebody point me in the correct direction for displaying matrix
>elements.

To display an element of a matrix, you can do:

. display el(r(p),1,1)

Have a look at -help matrix_function-

If you want to write the information to a file you could do something like:

. file write whatever (el(r(p),1,1))

--jean

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index