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
Creating an indicator variable from multiple, non-mutually exclusive, dummy variablesHi! I'm trying to create an indicator variable from several dummy variables (which are not mutually …
fuzzy matchI am new to using the matchit command and finding it challenging to understand what the different op…
How to make it as a program?Hi All, I am trying to make this as a program. Any help? Below is my code. Thanks clear set seed 12…
Collapse by a variable, while preserving others and creating new variablesHi, I have a dataset on property transactions (a sample below, for those of you from the UK, this i…
smcl and putpdf textIs it possible to somehow use math symbols with putpdf? I tried various versions of this with approx…
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