Hello,
I am quite new to Stata and am trying to analyse some time series data but am having some issues with getting Stata to understand what i am asking
I have a variable - "Year" - which i generated from another variable - "Y" - using command: generate Year = date(Y, "Y"), after(Y)
This gave a list of days from Stata's base year as expected, but i could only format it into looking like's original form (which was a 4 digit year, e.x. 1988) by using command: format Year %tdcY,
which seemed odd but worked.
Now my problem is, when trying to list the observations if i use command: list Year if Year>2000 , it gives me all years from 1966 to 2015, so i guess Stata is still understanding 2000 as the days from January 1st 1960. Is there a way to change this so when i list observations from 2000 it will show them from the year 2000 not the days?
Any help would be much appreciated
Many thanks, Archie
Related Posts with Problem with specifying a range of year or listing years
How to select a specific part in a string variable?Greetings, I am cleaning data in a very large dataset, and would want to drop all records in a speci…
Problem with macro in forvaluesHi! I'm trying to construct the variables for exporter-time and importer-time fixed effects for our …
Comparing data among two string columnsDear Statalist members, I want to identify the political connections of the firms. For this I have c…
2SLS in non-linear models with count endogenous explanatory variableGreetings everyone, I specify two models in my study with two different dependent variables; one of…
How to get sum of categoryHi everyone, I use id and type to generate dummy_1~dummy_5 My data looks like this: id type dumm…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with specifying a range of year or listing years
Post a Comment