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: RE: rearrange table
From
Muhammad Anees <[email protected]>
To
[email protected]
Subject
Re: st: RE: rearrange table
Date
Fri, 10 Feb 2012 20:31:13 +0500
First Comment: You need to ask in a new thread.
Second. check -help varstable- and read till the end where you can see
the following:
r(Re) real part of the eigenvalues of A
r(Im) imaginary part of the eigenvalues of A
r(Modulus) modulus of the eigenvalues of A
Hope this helps.
Anees
On Fri, Feb 10, 2012 at 8:18 PM, Muhammad Akram <[email protected]> wrote:
>
> Hi all,
>
> I want to know the procedure of how eigenvalue's companion matrix is generated in stata when using varstable command.
>
>
>
> Thanks
>
> aasim
>
>
>> From: [email protected]
>> To: [email protected]
>> Date: Fri, 10 Feb 2012 12:24:56 +0000
>> Subject: RE: st: RE: rearrange table
>>
>> This is shorter than my original (quoted below) and the same length at 10 lines as my second solution.
>>
>> I am sure that Phil and I would both be pleased to see shorter solutions.
>>
>> The bitter-sweet principle is that there is a syntax to produce any table you want: it's just called Stata.
>>
>> Nick
>> [email protected]
>>
>> Phil Clayton
>>
>> -statsby- is very nifty, but in this case you can of course get away with something a little simpler for constructing the results dataset:
>>
>> sysuse auto, clear
>> collapse (mean) mean=mpg (sd) sd=mpg (count) n=mpg, by(foreign)
>> gen ub=mean + invttail((n-1), 0.025) * sd/sqrt(n)
>> gen lb=mean - invttail((n-1), 0.025) * sd/sqrt(n)
>>
>> Followed by Nick's:
>> rename (sd mean lb ub) (statsd statmean statlb statub)
>> reshape long stat, i(foreign) string
>> label def which 1 mean 2 sd 3 lb 4 ub
>> encode _j , label(which) gen(which)
>> label def which 3 "95% limit: lower" 4 "upper", modify
>> tabdisp which foreign, c(stat) format(%3.2f)
>>
>> On 10/02/2012, at 10:21 PM, Nick Cox wrote:
>>
>> > sysuse auto, clear
>> > statsby mean=r(mean) ub=r(ub) lb=r(lb), by(foreign) : ci mpg
>> > save bystat, replace
>> > sysuse auto, clear
>> > statsby sd=r(sd), by(foreign) : su mpg
>> > merge 1:1 foreign using bystat
>> > drop _merge
>> > rename (sd mean lb ub) (statsd statmean statlb statub)
>> > reshape long stat, i(foreign) string
>> > label def which 1 mean 2 sd 3 lb 4 ub
>> > encode _j , label(which) gen(which)
>> > label def which 3 "95% limit: lower" 4 "upper", modify
>> > tabdisp which foreign, c(stat) format(%3.2f)
>>
>>
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/statalist/faq
>> * http://www.ats.ucla.edu/stat/stata/
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
--
Best
---------------------------
Muhammad Anees
Assistant Professor/Programme Coordinator
COMSATS Institute of Information Technology
Attock 43600, Pakistan
http://www.aneconomist.com
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/