Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Scatter connection
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: Scatter connection
Date
Tue, 22 Feb 2011 17:35:56 +0000 (GMT)
--- On Tue, 22/2/11, Rilke Rainer Michael wrote:
> A subject has answered to two different question. I want to
> draw a scatter plot with points for every individual
> to both question. Now I want to connect the dots which
> correspond to one individual to follow the individual
> between both questions.
Is this what you are looking for:
*------------------ begin example -----------------
sysuse auto, clear
// put variables on the same scale
sum price, meanonly
replace price = (price - r(min)) /(r(max) - r(min))
sum mpg , meanonly
replace mpg = (mpg - r(min)) / (r(max)- r(min))
gen x1 = 1
gen x2 = 2
// create the graph
twoway pcscatter price x1 mpg x2 || ///
pcspike price x1 mpg x2, ///
xlab(1 "price" 2 "mpg")
// However, in this case I would prefer
twoway scatter price mpg
*------------------ end example ----------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/