I have a database with three variables: 27 states, 10 years and a GDP for each year. I want to generate a variable with the resulting logical operation: if year=2017, then GDP*2 & if year=2018, then GDP*7 & if year=2019, then GDP*15, and so on.
How can I do that, please?
Related Posts with Logical operation using generate
Graphing InteractionsHi all, We are wondering how to graph a 3-way interaction on stata? It is a continuous x continuous…
Datepart/ClockpartHi everyone In my dataset I have a time variable. It is in format: %tcDay_Mon_DD_HH:MM:SS_CCYY (this…
Asdoc not applying weights in pwcorrI've been using asdoc to create a word document. I have several frequency and correlation tables tha…
count the number of string variableI was wondering if there exists a function or command that counts the number of string variables in …
Generate surrounding observations based on observations of another variableHi there, I am trying to create new observations of a variable based on the observations of other v…
Subscribe to:
Post Comments (Atom)
0 Response to Logical operation using generate
Post a Comment