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

Re: st: Year to start 1st April


From   Richard Williams <Richard.A.Williams.5@nd.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Year to start 1st April
Date   Fri, 05 Mar 2004 19:53:19 -0500

At 12:19 AM 3/6/2004 +0000, Paul O'Brien wrote:
Hi,

gen year= year( datevisit) gives me the calendar year of the clinic visit. How do I get the financial year of the visit, starting on the 1st April each year?
Not sure, but how about

gen year = year(datevisit - 91)

91 corresponds to April 1, 1960.

When I try this with a few #s, I get

    +-----------------------------------------+
     | datevi~t   month   day   year   finyear |
     |-----------------------------------------|
  1. |       89       3    30   1960      1959 |
  2. |       90       3    31   1960      1959 |
  3. |       91       4     1   1960      1960 |
     +-----------------------------------------+

*
*   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