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

RE: st: RE: Box plots of z-scores


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Box plots of z-scores
Date   Mon, 3 Feb 2003 21:51:31 -0000

Rod Hunter

> Is there an easy way of modifying the whiskers so that they 
> range from, 
> say, 0% to 80% (and preferably without other percentile 
> values in between)?
> 
> My intention is to align the zscores at their zero 
> percentiles, and thus 
> to illustrate the diffrence in the relative locations of the 80th 
> percentiles.
 
I think this refers to -hbox- on SSC. 

That -hbox- is for version 6 and is 
superseded by -graph hbox- in Stata 8.0.
It is a dead duck as far as I am concerned. 

You could copy it and hack at the inside,  
but it would seem easier to write some 
code and call up -hplot-. Say you want 
the minimum and the 80% percentile. 

local j = 1 
gen str1 what = "" 
gen minimum = . 
gen p80 = . 

qui foreach v of var length turn displacement headroom { 
	su `v', meanonly 
	replace minimum = r(min) in `j' 
	_pctile `v' , p(80)  
	replace p80 = r(r1) in `j' 
	replace what = "`v'" in `j' 
	local j = `j' + 1
} 

hplot minimum p80, l(what) s(||) line


Nick 
[email protected] 
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index