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
inquire about rowtotal Code: gen s1 = x1+x2+x3+x4 replace s1 = 0 if s1 == . egen s2 = rowtotal(x*) assert s1==s2 Why it's …
looping over data filesHello Users, I have data of banks by id numbers. What I want to do is: (1) to merge 4 tables of one …
regression panel data: OLS / GEEhello! I have a panel dataset on which I would like to perform a regression. my dependent variable …
Thesis regressionGoodmorning all, For my masters thesis I have to do some cross-sectional regressions, using the mod…
ARIMA Modelling with Binary Independent VariableI am trying to fit an ARIMA model to my intervention analysis but when I use the syntax and add both…
Subscribe to:
Post Comments (Atom)
0 Response to Logical operation using generate
Post a Comment