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

Re: st: RE: ltable and plot


From   josemaria <jmpsouza@usp.br>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: ltable and plot
Date   Sun, 30 Nov 2003 05:41:11 -0200

A long time ago (four, five years?) I had the same problem.
The solution presented to me (by Bill Gould, by Nick Cox?), which I still use, was (for my data):

. program define wander

  1. gph open
  2. ltable  anos censura [freq=numero] if origem==0,graph  interval(0,1,2,3,4,
5,6,7,8,9,10,11,12)xlabel(0,1,2,3,4,5,6,7,8,9,10,11,12)xline(0,2,4,6,8,10,12)
ylabel(0,.2,.4,.6,.8,1)yline(0,.2,.4,.6,.8,1) pen(2) noconf notab t1(azul=par
ticular/vermelho=IAPC)
  3. ltable  anos censura [freq=numero] if origem==1,graph  interval(0,1,2,3,4,
5,6,7,8,9,10,11,12)xlabel(0,1,2,3,4,5,6,7,8,9,10,11,12)xline(0,2,4,6,8,10,12)
ylabel(0,.2,.4,.6,.8,1)yline(0,.2,.4,.6,.8,1) pen(3) noconf notab t1(azul=par
ticular/vermelho=IAPC)
  4. gph close
  5. end

. wander

Nick Cox wrote:
Here's a silly example of how to use -plot()-.
r so I guess.

Another handle which would be useful is for -ltable- to generate as variables the quantities it tabulates; then you could knit your own graph.
Nick n.j.cox@durham.ac.uk
Dear Nick:
could you show how to do this other handle?


Has anyone had experience using the -plot- function with -ltable-?
To be specific:
. ltable time censor, graph by(treat)
works fine and it gives me two graphs side by side, each with a single
line--treat takes on two values: 0 & 1.
What I want is the two lines on a *single* graph.
Marcelo


--
Jose Maria Pacheco de Souza, Professor Titular
Departamento de Epidemiologia
Faculdade de Saude Publica/Universidade de Sao Paulo
Av. Dr. Arnaldo, 715	cep 01246-904
Sao Paulo	Brasil
fones (11)3082-3886  (11)3714-2403  (11)3768-8612
fax   (11)3082-2920  (11)3714-2403
www.fsp.usp.br/~jmpsouza
jmpsouza@usp.br


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index