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

st: RE: RE: histogramm and dates


From   Lee Sieswerda <Lee.Sieswerda@tbdhu.com>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: histogramm and dates
Date   Thu, 7 Aug 2003 16:38:20 -0400

A close alternative to -histogram- is -twoway bar-. You said that you had
unsuccessfully tried a bar graph, but I would guess that you used -graph
bar-, not -twoway bar-. -twoway bar- would fill in the missing months
(assuming that you have your month variable in date format).


Lee Sieswerda, Epidemiologist
Thunder Bay District Health Unit
Lee.Sieswerda@tbdhu.com



-----Original Message-----
From: Nick Cox [mailto:n.j.cox@durham.ac.uk] 
Sent: Thursday, August 07, 2003 10:55 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: histogramm and dates


Dr Veit Grote, MSc 

> I have cases that were detetcted between the 1st May 1997
> and the 19th June 2001 (d_onset). I like to have a 
> histogram of the distribution of the number of cases by 
> month, showing also the months with missing values, i.e. I 
> like to have a true time scale. I could not find out how I 
> could accomplish this. I tried (arbitrarily choosing 50 bins):
> 
> histogram d_onset, bin(50) frequency xlabel(#50,
> angle(vertical) format(%dmy))
> 
> This gives me an idea of the general distribution, but the
> bins are not months. If I create a new variable grouping 
> all cases per month and year, I could have a bar graph with 
> correct numbers per month, but time gaps would not show. 

I am not clear what the problem is. Did you convert 
to a month variable and try a histogram? I would 
go 

gen m_onset = mofd(d_onset) 
histogram m_onset, w(1) 

etc. 

Nick 
n.j.cox@durham.ac.uk 
*
*   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/
*
*   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