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]
st: RE: How to implement ranktest of matrix
From
"Schaffer, Mark E" <[email protected]>
To
<[email protected]>
Subject
st: RE: How to implement ranktest of matrix
Date
Thu, 8 Jul 2010 00:39:53 +0100
Komi,
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Komi Agbemavi Mati
> Sent: 07 July 2010 20:43
> To: [email protected]
> Subject: st: How to implement ranktest of matrix
>
> I need to test whether the following matrix have rank 0, 1
> or 2. I am trying to use ranktest in stata but i don't
> know what to put in Y and what
> to put in Z as described in the help file.
>
> dqdZ1 dqdz2
> .0002178 .0000277
> .0003644 .0000637
> .0022189 -.0004827
> .0012441 .0000804
> -.0182371 -.0013471
> .0026022 .0008305
>
> When I try the following command
> ranktest dqdZ1 dqdz2,
If you want to know the rank of a Stata matrix like the one above, you
can use, say, the Mata function rank() (see help mf_rank). You would
move the matrix from Stata into Mata and then use the rank() function.
-ranktest- is different. (Mea culpa - on re-reading the help file, I
think this could be clearer.) It is for testing the rank of a matrix of
correlations or regression parameters.
When you say
ranktest dqdZ1 dqdz2
what is happening is basically the same thing as regressing dqdZ1 on
dqdz2 and testing whether the regression parameter is nonzero (i.e.,
rank>0). I suspect this isn't what you want, and instead you want the
rank of the Stata matrix above, but perhaps I'm wrong here.
Hope this helps.
Cheers,
Mark
> I obtain
>
> Kleibergen-Paap rk LM test of rank of matrix
> Test assumes homoskedasticity (Anderson canonical correlations test)
> Test of rank= 0 rk= 4.12 Chi-sq( 1) pvalue=0.042450
>
> And when I try ranktest dqdZ1 dqdz2, allrank,
>
> I obtain the same result. So I would like to know how to
> test Ho: rank=1 or Ho:rank=2.
>
> Thanks
> *
> * 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/
>
--
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.
*
* 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/