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: - xtlogit- and predictnl and -xtreg-
From
Christoph Engel <[email protected]>
To
[email protected]
Subject
Re: st: - xtlogit- and predictnl and -xtreg-
Date
Thu, 18 Aug 2011 09:47:42 +0200
Dear Ricardo,
You can always create such a table by hand, although with some more
coding. The following has worked with one of my datasets
xtreg pungto i.trt2 per bft*
predict prpungto, xb
gen id = _n
gen pr5 = .
gen sepr5 = .
gen pr10 = .
gen sepr10 = .
forvalues i = 1/4 {
qui su prpungto if trt2 == `i' & per == 5
replace pr5 = r(mean) if id == `i'
replace sepr5 = r(sd) if id == `i'
qui su prpungto if trt2 == `i' & per == 10
replace pr10 = r(mean) if id == `i'
replace sepr10 = r(sd) if id == `i'
}
table id in 1/4 , c(mean pr5 mean sepr5 mean pr10 mean sepr10)
Best
Christoph
Am 18.08.2011 01:10, schrieb Ricardo Ovaldia:
Thank you Christoph. But what I want is the yhat estimates, not the change.
What I want to show is something like this:
Predicted MEANS (sd)
group=1 group=2 group=3 p-value
time
5 100(xx) 110 (ff) 105 0.239
10 200 150 109 0.244
...
Thank you,
Ricardo
Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK
--- On Wed, 8/17/11, Christoph Engel<[email protected]> wrote:
From: Christoph Engel<[email protected]>
Subject: Re: st: - xtlogit- and predictnl and -xtreg-
To: [email protected]
Date: Wednesday, August 17, 2011, 4:29 PM
Ricardo,
xtreg dv ivs period
margins, dydx(*) over(period)
might do what you want
Christoph Engel
Am 17.08.2011 22:39, schrieb Ricardo Ovaldia:
I wold like to get XB estimates from -xtreg- at fixed
points in time. I used a command similar to the one that
Maarten suggested for -xtlogit-:
predictnl or = exp(_b[1.group]
+_b[1.group#c.year]*c.year), ci(lb ub)
of course, I do not want the eform and my group
variable has 3 levels instead of two so I used:
predictnl xbeta = _b[1.group]
+_b[1.group#c.year]*c.year +_b[2.group]
+_b[2.group#c.year]*c.year, ci(lb ub)
I do not get the correct estimates.
Thank you,
Ricardo
Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK
--- On Wed, 8/17/11, Ricardo Ovaldia<[email protected]>
wrote:
From: Ricardo Ovaldia<[email protected]>
Subject: Re: st: - xtlogit- and predictnl
To: [email protected]
Date: Wednesday, August 17, 2011, 9:05 AM
My mistake, you are correct Maarten,
they should be symmetric, and they are, in the or
scale.
Okay, I think I got it. If I do not exp() the
expression in
-predictnl-, I will get the corret p-values.
Thank you again,
Ricardo
Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK
Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK
--- On Wed, 8/17/11, Maarten Buis<[email protected]>
wrote:
From: Maarten Buis<[email protected]>
Subject: Re: st: - xtlogit- and predictnl
To: [email protected]
Date: Wednesday, August 17, 2011, 8:49 AM
On Wed, Aug 17, 2011 at 3:34 PM,
Ricardo Ovaldia wrote:
predictnl or = exp(_b[1.group] +
_b[1.group#c.year]*c.year), ci(lb ub) p(pval)
but included the extra optiop -p()- to
obtain
p-values
My question is why do the pvalues and the
CI do
not
agree?
It seems like the CI are incorrect. They
are not
symmetric in the log-scale.
I guess that the null-hypothesis is that the
odds
ratio
equals 0,
which does not make sense in this case, but
how is
Stata
supposed to
know that our expression happens to be an odds
ratio?
The
confidence
interval is symmetric in the or scale rather
than the
log(or) scale
because -predictnl- just applies the delta
method on
our
expression to
get the standard errors and than moves on to
use these
to
compute
confidence intervals.
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/
*
* 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/
--
_________________________________________________________________
Prof. Dr. Christoph Engel
Max-Planck-Institut zur
Erforschung von Gemeinschaftsgütern
Max Planck Institute for Research on Collective Goods
Kurt-Schumacher-Strasse 10
D 53113 Bonn
Tel. +49/228/91416-10
Fax +49/228/91416-11
e-mail: [email protected]
http://www.coll.mpg.de
http://www.coll.mpg.de/engel.html
http://ideas.repec.org/e/pen22.html
http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=251559
_________________________________________________________________
*
* 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/
--
_________________________________________________________________
Prof. Dr. Christoph Engel
Max-Planck-Institut zur
Erforschung von Gemeinschaftsgütern
Max Planck Institute for Research on Collective Goods
Kurt-Schumacher-Strasse 10
D 53113 Bonn
Tel. +49/228/91416-10
Fax +49/228/91416-11
e-mail: [email protected]
http://www.coll.mpg.de
http://www.coll.mpg.de/engel.html
http://ideas.repec.org/e/pen22.html
http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=251559
_________________________________________________________________
*
* 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/