Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: xtivreg2 with margins


From   Jacob Robbins <jake.a.robbins@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: xtivreg2 with margins
Date   Mon, 9 Apr 2012 15:31:57 -0400

Good Afternoon,

I am having a problem running the margins command after running
xtivreg2. Interestingly enough, margins does seem to work after
xtivreg without giving an error. Here is some code that demonstrates
the problem.

                sysuse bplong, replace
                xtset patient
                gen random = runiform()
                gen random1 = runiform()
                xtivreg2 bp when (random1 = random), fe
                margins, atmeans eydx(random1)

Here I get the error message:
Warning: cannot perform check for estimable functions.
time variable not set, use -tsset varname ...-
r(111);

But if I use margins after xtivreg...
                xtivreg bp when (random1 = random), fe
                margins, atmeans eydx(random1)

I get the results and no error message. The reason I am using xtivreg2
is to use the better cluster options of xtivreg2.

Thanks for advance for your help!

Jake Robbins
Research Associate
Harvard School of Public Health

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index