Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Truncating x-axis in kernel density graphs


From   philippe.vankerm@ceps.lu
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: Truncating x-axis in kernel density graphs
Date   Thu, 27 Nov 2003 19:10:06 +0100

An alternative to working in log and back-transform the density might here 
be to use an adaptive kernel density estimate (-findit akdensity- for 
files and material).

The following lines should get you near what you want:

* 1/ get -akdensity-
net from  http://www.stata-journal.com/software/sj3-2/
net install st0037
* 2/ estimate the density and save the coordinates
akdensity XXX , nograph gen(x fx)
* plot in the range you want
tw line fx x if x<ZZZ

Hope this helps,

Philippe


<<<<<<<<<<<>>>>>>>>>><<<<<<<<<>>>>>>>>>>
Philippe Van Kerm
 CEPS/INSTEAD
 BP48, L-4501 Differdange
 G.-D. Luxembourg
 philippe.vankerm@ceps.lu
<<<<<<<<<<<>>>>>>>>>><<<<<<<<<>>>>>>>>>>

>>>>>>>>

st: RE: Truncating x-axis in kernel density graphs


Ramani Gunatilaka

> I am plotting kernel density functions of per capita 
> household consumption for three years on the same graph.
> All three distributions are skewed to the left and have 
> very long tails extending to the right.
> I would like to truncate the x axis at a certain 
> consumption value so that the long tail is dropped and the 
> area where all the action is, stretched across so that the 
> changes are more visible.
> I have explored the graph scale options and Stata list 
> archives but couldn't find anything that related to my 
> particular problem. 
> If I were to specify a shorter range of consumption values 
> than the entire data set, wouldn't it distort results?
> Would anyone be able to advise of any alternative?




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept for the presence of computer viruses.

**********************************************************************

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index