Dear Statalists,
I have an excel file with dates like 29.02.1980, 30.03.1980 and etc... I have appended Y in front of every date in the excel file and then imported it to the STATA. I had to appended Y in front of dates since i have to reshape the data (from wide to long) in the STATA.
I have used codes like: gen year = year(date) - 60 // Getting YEAR from the date
gen month = month(date) // Getting MONTH from the date
With year everything worked fine but with month i am getting wrong values, what can be possible reason for that and how can i fix it?
Related Posts with extracting data from numbers
Computing spatial weights for Moran's I #spmap #shp2dta #spatwmatDear Statalist, I am doing district level analysis (640 districts) on various health related indica…
Writing a program with specific line alternatingHi everyone, I wish to write a program that can be applied to multiple scenarios. For example, cons…
Trying to Plot Coefficients of Interactions with Event Study IndicatorsHi all, I am plotting event study coefficients by running coefplot after reghdfe. Coefplot is a ver…
Looping without removing local macroI am looping over multiple sheets in an Excel with some macros. Within the loop, I need to add a pre…
Interpreting rescaled variables in PPMLI rescaled my dependent variable and main covariate by dividing both by 1 million while carrying out…
Subscribe to:
Post Comments (Atom)
0 Response to extracting data from numbers
Post a Comment