Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: xtgee , corr( fixed ??)

 From Joerg Luedicke To statalist@hsphsun2.harvard.edu Subject Re: st: xtgee , corr( fixed ??) Date Sat, 12 May 2012 19:58:25 -0700

```Please disregard my last message, I was on the wrong page here. So
this is indeed weird, your matrix should be legit.

When looking at the trace right before the error message (using your
example with matrix D):

= if D[2,2] != 1.0 {
- noi di in red "`cmat' not a correlation matrix"
= noi di in red "D not a correlation matrix"
D not a correlation matrix

we can see that the check whether the diagonal is 1 fails at D[2,2]
which looks like there is some precision problem involved.

J.

On Sat, May 12, 2012 at 7:14 PM, Joerg Luedicke
<joerg.luedicke@gmail.com> wrote:
> I believe -xtgee- wants to see a full matrix, not just a triangle. For example:
>
> xtgee ln_w grade age c.age#c.age, corr(exchange)
> mat c=e(R)
> xtgee ln_w grade age c.age#c.age, corr(fixed c)
>
>
> J.
>
>
> On Sat, May 12, 2012 at 5:20 AM, Stas Kolenikov <skolenik@gmail.com> 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 = syminv(sqrt(diag(C))) * C * syminv(sqrt(diag(C)))
>> 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/

*
*   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/
```