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 at the end of May, and its replacement, statalist.org is already up and running.


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

RE: Re: st: modify axis range in scatter graphs


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   RE: Re: st: modify axis range in scatter graphs
Date   Tue, 23 Mar 2010 17:41:10 +0000 (GMT)

--- On Tue, 23/3/10, Klink, Andrew wrote:
> There is one caveat: when I graphed the curve using the
> post-estimation variables as you suggest, it generates
> the same shape curve, but on a different scale on the
> y-axis. The initial -fpfitci- I ran generated a curve
> whose y-axis range is within 0-1 (or as a percent: 0-100,
> as it will be labeled). When I graph the curve from the
> generated variables as you describe, the y-axis range is
> from 0.5-3 

I thought your problem was only with the lower bound, so I
suggested the log-link as more people are familiar and 
comfortable with it. But these new results show that that
model won't fit well. The alternative is to fit a 
fractional polynomial within a fractional logit model (I
couldn't resist that one, but it is a lot less complicated
than it sounds). The fractional logit model is just a 
-glm- with the options -link(logit)-, -family(binomial)-,
and -vce(robust)-. The inverse of the logit link is 
pre-programmed in Stata as the appropriately named 
-invlogit()- function. So, applying this to the tricks
from my previous post leads to:

*----------------- begin example ----------------------
use http://fmwww.bc.edu/repec/bocode/c/citybudget.dta, clear
fracpoly : glm urbanplanning houseval, /// 
           link(logit) family(binomial) vce(robust)
predict xb , xb
predict se , stdp
gen lb = 100*invlogit(xb - invnormal(0.975)*se)
gen ub = 100*invlogit(xb + invnormal(0.975)*se)
gen mu = 100*invlogit(xb)
twoway rarea lb ub houseval, sort astyle(ci) || ///
       line mu houseval, sort lpattern(solid)   ///
	   ylab(0(25)100)                           ///
	   ytitle(percent of budget spent on urban planning)
*------------- end example ----------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index