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
Errors using random slope on dummy variableHello, Thank you for reading my post. I am seeking advice about the following problem: I am estimat…
IVprobit with Cluster option and F testDear Statalist users, I have a panel dataset for 15 years and my dependent variable is binary in na…
How to select/specify variables to include in a table with descriptive statistics?Dear Stata Users, I run the following code to generate a table: Code: unab stubs : *_X local st…
For each i, calculate median value of observations in the dataset whose value falls within an interval defined by i's valueHello! I have 430 observations, each of whom declare a GOAL time (in seconds), and whose FINISH tim…
How to convert timing format MM:SS:MS into numeric?Hi. I have trouble converting a timing format in MM:SS:MS into a numeric? -For example converting it…
Subscribe to:
Post Comments (Atom)
0 Response to extracting data from numbers
Post a Comment