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

Re: st: coding a categorical variable to a % continuous variable


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: coding a categorical variable to a % continuous variable
Date   Sat, 12 Jun 2004 02:53:07 +0100 (BST)

Suzy wrote:

> I have a dichotomous variable (0=no ; 1=yes) that I would like to use in
> a scatter plot on the y axis as a continuous variable  as a  % variable.
>
> For example:  the x axis could be age and the y axis could be % smokers.
>
> Can anyone help with this ?

You can achieve what you want with _two_ x-variables, but not one, if you
use:

. graph twoway scatter x1 x2, by(smokers)

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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