Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: desmat and Stata 8


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: desmat and Stata 8
Date   Sat, 27 Sep 2003 11:59:45 +0900

Michael Rosenfeld responded to a posting from Veit Grote, who is having 
difficulty with -desmat- under Stata Release 8:

--------------------------------------------------------------------------------

On July 16, the following message was posted to Statalist:

. . .

"desmat" under Stata8 does not work as under Stata7. The nice feature of 
displaying labels of categorical variables disappeared somehow. Maybe 
someone has a clue how to fix it?!
Thanks
Veit Grote

As far as I can tell, Mr. Grote's question has not previously been 
answered.  I initially ran into the same problem with desmat and Stata 
8.  The problem was that I was using an out-of-date version of -desmat-.

. . .

version 3.1 and after of -desmat- appear to work fine with Stata 8.  I run 
Stata 8.1 on Windows 2K and Windows 98 machines.

I should add that -desmat- is a very helpful program that is capable of 
building higher order interactions than -xi- or -xi3-, and -desmat- also 
produces much nicer looking output.

. . .

--------------------------------------------------------------------------------

I don't know about displaying value labels with -desmat-, never having paid 
attention to value labels in the past with -desmat-, but I also couldn't see 
them in the printout, just as Veit mentioned, even with the latest update 
(2003-09-25) of -desmat- from SSC.

There is another a minor glitch with -desmat- and Stata Release 8.X, but I've 
only noticed it with -xtgee-.  The attached do-file shows where it will crop up 
and how to work around it.  The workaround (include -nomodinfo- in the option 
-desrep()-) is so easy that I haven't bothered to contact the author about bug. 
 -desmat- appearently has trouble finding the model P-value associated with the 
overall Wald chi-square test for -xtgee-.

Joseph Coveney

P.S. I agree that -desmat- is a fabulous command.  It's become the default for 
production work in any situation where interactions are evaluated or where 
there are more than two categories to a predictor.  It's been a godsend where 
the categories of a predictor have a natural ordering.  Congratulations and 
appreciation go to John Hendrickx for adding a very valuable capability to 
Stata and for continuing to support it.

--------------------------------------------------------------------------------

clear
set more off
set seed 20030927
set obs 210
generate int pid = _n
generate byte dos = mod(_n, 3) + 1
generate float bas = invnorm(uniform())
forvalues t = 1/3 {
    generate float res`t' = bas * sqrt(0.7) + ///
     (1 - 0.7) * invnorm(uniform())
    quietly replace res`t' = res`t' * 0.5 * dos * (`t' - 1) / 2
}
reshape long res, i(pid) j(tim)
char tim[pzat] orp(2)
char bas[pzat] dir
char dos[pzat] hel(b)
// No problem with the following line . . .
desmat: xtreg res dos*tim*bas, verbose desrep(all) i(pid) fe
// . . . but the following line will produce an error.
* desmat: xtgee res dos*tim*bas, desrep(all) i(pid)
// The following line works, however.
desmat: xtgee res dos*tim*bas, verbose desrep(nomodinfo all) i(pid)
exit

--------------------------------------------------------------------------------



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