Bookmark and Share

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: xtgee , corr( fixed ??)


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: xtgee , corr( fixed ??)
Date   Tue, 15 May 2012 17:18:35 -0400

For those interested: I received a suggestion off the list to use mata
-corr()- function which is more accurate than the matrix inversions
that I have shown in the quoted code below: they failed to produce 1's
on the diagonal, while -corr()- specifically enforces that. So the
code should rather be

D = corr(C)

And of course I forgot to mention that I have been using one of the
-xt- examples data set, -webuse nlswork2-.

On Sat, May 12, 2012 at 8:20 AM, Stas Kolenikov <[email protected]> wrote:
> Folks,
>
> what exactly does the -corr(fixed matrix)- option of -xtgee- consider
> a valid matrix? It seems to have its own weird ideas as to what it
> will and will not work with:
>
> . drawnorm x1-x9, cov( D ) cst(full)
>
> . xtgee ln_w grade age c.age#c.age, corr(fixed D)
> D not a correlation matrix
> r(198);
>
> for some matrix D that I have at hand:
>
> mata
> A = runiform( 9, 9 )
> B = A + A'
> C = B + 2*max(B)*I(9)
> D = invsym(sqrt(diag(C))) * C * invsym(sqrt(diag(C)))
> st_matrix( "D", D )
> end
>


-- 
---- Stas Kolenikov
-- http://stas.kolenikov.name
---- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index