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

RE: st: a beginner graph help


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: a beginner graph help
Date   Tue, 6 May 2003 09:28:00 +0100

Giulio Rizzoli 

> > I have stata7.
> > I have this table with the yearly frequence of use of the 
> variable drug= 1
> > or 2 or 3 (labelled AA BB CC)
> > .label value drug drugf
> > .table opy drug
> > year	AA	BB	CC
> > ____________________
> > 1970	8
> > 1971	4
> > 1973	1
> > 1997		1	56
> > 1998			65
> > 1999			24
> > 2000		1	5
> > 2001			20
> > 2002			36
> > _________________________
> >
> > Question: how can I produce a line plot of the frequences 
> of AA BB CC
> > across years with a different line  for each ?

Ulrich Kohler
> 
> What about:
> 
> . contract year drug, freq(n)
> . separate n, by(drug)
> . graph n1 n2 n3 year, c(lll) sort
> 
> (not tested)

Note that this would overwrite the current data 
set, so -save- it first if necessary. 

The -zero- option of contract may also 
be useful. 

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