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

st: modifying added line length and location / modifying directionof jitter

From   "Juan Solon" <[email protected]>
To   <[email protected]>
Subject   st: modifying added line length and location / modifying directionof jitter
Date   Fri, 20 May 2005 11:03:30 +0100

 Instead of using  - gr box - in stata, I wanted to use stata's scatter
plot to produce a graph plotting a continuous variable against a
categorical variable, mainly because this is how this particular
laboratory assay is commonly presented.  
I am using Stata version 8.2 on a MacOSX.  Using the commands below:

sysuse auto, clear
scatter price foreign, jitter(20) msymbol(Oh) xlabel(0 1, valuelabel)
yline(4782, noextend) yline(5759, noextend) ///
xscale(noline) ///
xline(0 1, lpattern(dash)) ///
plotr(m(l=15 r=15))

I end up with a graph with :
1)  y  lines (which represent the median for each category) that are
too long for what I want - I would want to specify length and location
of the y- line along the x axis - 

How do I adjust the length of the added line to cover only the category
of interest ? I couldn't find any suboption in linestyle or added

2)  data points which appear to jitter to the right (for Domestic) or
to the left  (for Foreign) of the tick label, so the scatter points end
up havign a visual left or right margin.    

Is it possible to have the jittering occur randomly to the left or
right of a vertical reference line?

Is there another way of doing this type of graph without using


*   For searches and help try:

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