Dear statalist,
I am trying to solve the following problem:
I have 105 dummy variables for 105 months spanning Janury 2010 – September 2018, each taking the value 1 if something happened that month. They’re named mat201001, mat201002 … mat201809.
I need to generate a new variable, that will give me the month and year in which the event first occured, that is when a dummy variable first took the value 1. For example if the first dummy to take the value 1 was mat201202, the new variable would be 201202, if the first dummy to be 1 is mat201801, the new variable will be 201801.
Thank you!
Zuzana
Related Posts with Generate variable that takes the name of one of a list of dummy variables
Loop for moving rangeGoodafternoon, I have a file which includes a significant amount of cusips (S&P1500) and dates …
Confusing behavior by ustrregexs()I'm trying to use ustrregexs to extract substrings from a string. With the data below: Code: clear…
Creating new outcome variable - invalid syntax r(198) problemI have twelve disease variables in my dataset. I want to to create an outcome variable "multimorbidi…
How to change a line pattern within a same graph? Hi, I would like to plot a graph using Code: twoway line and draw a different graph pattern after …
Panel data: xtoverid rejects RE for model with only time controls; odd result or information?Dear Statalisters, I am using interrupted time series methods on household panel data. I have month…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable that takes the name of one of a list of dummy variables
Post a Comment