I suggest that you check the mean(y) after you've put the data in stata.
maybe something went wrong. it should certainly be the case that the mean
of the data should be around the mean of the predicted values, and those
should be pretty close to (but not necessarily the same as) the expected
value of Y given the mean of x.
Gary King
On Sat, 1 Feb 2003, Karl DeRouen wrote:
> Prof King: greetings.
> i am trying to run clarify in conjnction with weibull regression.
> everything sees fine til i do 'simqi' then it generates an expected
> value of .11 (with setx mean).
> my duration variable is months of civil war and it average is 73 so an
> expected value of .11 doesnt seem to make sense. am i interpreting the
> E(Y) wrong? is there some sort of transformatin that must be done on the
> E(Y) so it can be interpreted in months?
> thanks in advance,
>
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.hmdc.harvard.edu/?info=clarify
Dear Ben,
Thanks for using Clarify. You are indeed correct; the code we give at the website is incomplete, and would have to be modified to get figure 1 from the paper. The actual code is available in our replication data set, available at http://gking.harvard.edu/data.shtml. For your convenience, I have included the Stata code that you are looking for below. As you will see, this code, in contrast with that on the web, produces 99% CI's. Sorry for the confusion.
Good luck with your research!
Best,
Jason Wittenberg
version 6.0
set mem 10m /* allocate RAM */
use turnout, clear /* load dataset */
estsimp logit turnout educate age agesqrd income white /* run logit */
setx (income white) mean /* hold inc,wt at means */
set more off /* let output scroll */
generate plo12 = . /* lower bound if ed=12 */
generate phi12 = . /* upper bound if ed=12 */
generate plo16 = . /* lower bound if ed=16 */
generate phi16 = . /* upper bound if ed=16 */
generate ageaxis = _n+17 in 1/78 /* contains 18,19,..,95 */
setx mean /* set all vars to mean */
local a = 18 /* begin with 18 ys old */
while `a' <= 95 { /* go to 95 years old */
display "Simulating for age = `a'" /* monitor our progress */
setx educate 12 age `a' agesqrd `a'^2*.01 /* set age, educ=12 ys */
simqi, prval(1) genpr(edis12) /* save Pr(Y=1|educ=12) */
_pctile edis12, p(.5,99.5) /* fetch percentiles */
replace plo12 = r(r1) if ageaxis==`a' /* save lo bound of ci */
replace phi12 = r(r2) if ageaxis==`a' /* save hi bound of ci */
setx educate 16 /* change educ to 16ys */
simqi, prval(1) genpr(edis16) /* save Pr(Y=1|educ=16) */
_pctile edis16, p(.5,99.5) /* fetch percentiles */
replace plo16 = r(r1) if ageaxis==`a' /* save lo bound of ci */
replace phi16 = r(r2) if ageaxis==`a' /* save hi bound of ci */
drop edis12 edis16 /* clean-up our mess */
local a = `a' + 1 /* advance age 1 year */
}
sort ageaxis
set textsize 130
graph plo12 phi12 plo16 phi16 ageaxis, s(iiii) c(||||) /*
*/ xlabel(18,24,30,36,42,48,54,60,66,72,78,84,90,95) /*
*/ ylabel(.2,.4,.6,.8,1) l1(Probability of Voting) /*
*/ gap(3) b2(Age of Respondent)
-----Original Message-----
From: Gary King [mailto:king@harvard.edu]
Sent: Wed 1/22/2003 6:33 PM
To: Ben Bishin
Cc: Mike Tomz; Jason Wittenberg
Subject: Re: A Clarify question
Thanks Ben. I'm CCing my coauthors who know more about the stata loops.
Gary
: Gary King, King(a)Harvard.Edu http://GKing.Harvard.Edu :
: Center for Basic Research Direct (617) 495-2027 :
: in the Social Sciences Assistant (617) 495-9271 :
: 34 Kirkland Street, Rm. 2 HU-MIT DC (617) 495-4734 :
: Harvard U, Cambridge, MA 02138 eFax (928) 832-7022 :
On Wed, 22 Jan 2003, Ben Bishin wrote:
> Hi Gary,
>
>
> I hope all is well in Boston.
>
> I write with a Clarify question. Well actually its about the documentation
> for the Figure 1 in the "Software for Interpreting and Presenting
> Statistical Results" handbook that goes with the software. Im probably
> missing something as I haven't graphed before in Stata, but looking at the
> code on page 21 (I also found the same discussion
> here: http://gking.harvard.edu/clarify/docs/node24.html ) it doesnt seem
> to provide the CI's or estimates for both groups depicted in the figure in
> the AJPS paper. From my reading, it only generates the predicted values
> and CI's for the High School group (the value for the education variable
> seems fixed at 12). It seems like there should be a loop for the College
> group too. Am I missing something? If not is it possible to get the actual
> code from the paper?
>
> Also, this is lint but it appears that this code produces 95% CIs while the
> paper reports 99%CIs (Figure 1 on page 355).
>
> One last question: Im working on this for a sociology paper Im writing
> with a colleague, and was wondering if you are aware of any papers using
> clarify in the sociology literature?
>
> Thanks!
>
> Ben
>
> PS: I love this program.
>
>
>
> Benjamin G. Bishin
>
> Assistant Professor
> Department of Political Science
> University of Miami
> 314 Jenkins Building
> Coral Gables, FL 33124-6534
>
> Phone: (305) 284-1737
> Fax: (305) 284-3636
> http://homer.bus.miami.edu/~bbishin/
>
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.hmdc.harvard.edu/?info=clarify