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, 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 <>
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, 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: )

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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