Bookmark and Share

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

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

st: xtivreg2 with margins

From   Jacob Robbins <>
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 ...-

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:

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