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

st: how to -tsset- this data?


From   [email protected]
To   [email protected]
Subject   st: how to -tsset- this data?
Date   Thu, 26 Aug 2004 12:38:26 +0200

Dear all,

it's the first time I analyse time series data in Stata. My quarterly date variable looks like this:

. list date in 1/12, separator(4)

    +---------+
    |    date |
    |---------|
 1. |    1960 |
 2. | 1960.25 |
 3. |  1960.5 |
 4. | 1960.75 |
    |---------|
 5. |    1961 |
 6. | 1961.25 |
 7. |  1961.5 |
 8. | 1961.75 |
    |---------|
 9. |    1962 |
10. | 1962.25 |
11. |  1962.5 |
12. | 1962.75 |
    +---------+

That ist, first quarter is indicated by the plain year, second quarter by year.25, third quarter by year.5, and fourth quarter by year.75 . I want to -tsset- the data and tried

- gen mydate = quarterly(date, "yq") -

but it gave only missing values.
Before I start fiddling around with string replacement, I wanted to ask if there is some easy way to do this.

Thanks a lot and best wishes,
Eva




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index