Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: computing elasticities after using lpoly |
Date | Sat, 6 Oct 2012 12:21:21 +0100 |
Although I don't usually recommend this, it's possible that your data could be fitted well over the observed range by a low-order polynomial, say a quadratic or cubic. If that's true, then varying slopes can just be obtained by differentiating the polynomial analytically. Nick On Sat, Oct 6, 2012 at 11:21 AM, Nick Cox <njcoxstata@gmail.com> wrote: > That paper is not accessible to me at this time. > > You can differentiate numerically using -dydx-. > > But I wouldn't use -lpoly- for that purpose at all. I would use > -fracpoly- or a spline approach (e.g. -rcspline- (SSC)) to get smooths > before I tried to get slopes. The problem with all these approaches is > that estimates of slope are very sensitive to noise. > > Nick > > On Sat, Oct 6, 2012 at 11:07 AM, Arka Roy Chaudhuri <gabuisi@gmail.com> wrote: >> Thank you Nick for your advice. However my point in using lpoly is >> precisely its flexibility. But at the same time I want a measure of >> the slope of the curve that I get from using lpoly at different points >> of the curve-so I am not actually looking for one specific >> number.Rather I am trying to find the slope at different values of my >> independent variable-so that I can get an idea of the elasticities at >> different parts of the expenditure distribution. Basically I am trying >> to implement both Fig 2 and Fig 3 in the following paper (albeit in my >> context):Deaton, Angus S. and Subramanian, Shankar. "The Demand for >> Food and Calories," Journal of Political Economy, Feb. 1996,104(1), >> pp. 133-62 >> >> On Sat, Oct 6, 2012 at 2:19 AM, Nick Cox <njcoxstata@gmail.com> wrote: >>> It seems to me that the whole point of -lpoly- is to be flexible about >>> modelling a relationship. It has absolutely no sense of any idea of an >>> overall slope. If you want a number for the slope, -lpoly- is useless. >>> If you want an independent view of how far the relationship after some >>> smoothing really is (e.g.) linear or monotonic, then -lpoly- can be >>> useful, mostly by providing a graph. For what you want, any >>> appropriate regression method will be better, such as -regress- or >>> -qreg-. >>> >>> Nick >>> >>> On Sat, Oct 6, 2012 at 10:06 AM, Arka Roy Chaudhuri <gabuisi@gmail.com> wrote: >>> >>>> I am using Stata 11 on a Windows 7 machine. I am using lpoly to >>>> estimate nonparametric regressions of the form: >>>> >>>> log(y)=f(log(x)) + u >>>> >>>> where y= per capita expenditure on food >>>> x= total per capita expenditure >>>> >>>> Using lpoly, I can get a graph of per capita expenditure on food >>>> against total per capita expenditure. However I am also interested in >>>> obtaining expenditure elasticities of percapita expenditure on food at >>>> different levels of total per capita expenditure i.e in my context >>>> d(log(y)/d(log(x)) where x and y are as earlier defined.The problem is >>>> that lpoly does not give estimates of any slope coefficients so I am >>>> at a loss on how to compute these elasticities. I would really >>>> appreciate if anybody could give me advice in this regard. >>>> * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/