[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Frapoly

From   Maarten buis <>
Subject   Re: st: Frapoly
Date   Mon, 11 Feb 2008 09:46:24 +0000 (GMT)

--- mai mai <> wrote:
> Is there a why to find out the inflection points, trough and top of
> the fracpoly or fracplot graph?

You are basically asking when the first and second derivative are zero.
I find a graph of the first or second derivative with confidence
intervals against your explanatory variable instructive as it also
gives some sense of the precision of the estimate. These are pretty
subtle features of the curve so you can expect quite a bit of
uncertainty which just a point estimate tends to hide. -fracpoly- fits
a polynomial, so the first and second derivatives are pretty easy to
derive (though as I am lazy and sloppy I find a page like this
invaluable: ). Once you have derived the
first and second derivative you can use -predictnl- to get predictions
of the first and second derivative with their confidence intervals,
which you can than graph. In the example below I illustrate this
procedure with the first derivative.

Hope this helps,

*------------------- begin example ---------------------
sysuse nlsw88, clear
gen ln_w = ln(wage)
fracpoly reg ln_w ttl_exp
return list

local x "(`e(fp_x1)'-`e(fp_shft)')/`e(fp_sfac)'"

predictnl dydx = _b[Ittl___1]*2*`x' +                ///
                 _b[Ittl___2]*(2*ln(`x')*`x' + `x'), ///
	         ci(lb ub)

sort ttl_exp
twoway rarea lb ub ttl_exp || ///
       line dydx ttl_exp,     ///
       yline(0) legend(off)
*--------------------------- end example --------------------
(For more on how to use examples I sent to the Statalist, see )

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Sent from Yahoo! Mail - a smarter inbox

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index