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 Logic operations with generate
for loopshello, im trying to split a huge data set into about 400 files so that i can run an analysis on the…
"too many base levels specified" after -suest-Hi all, I am using -suest- to compare coefficients of the same variable across two logit model (usi…
Mixed results of datas in normality testI have a data set with datas satisfying normality and for few of the variables, it doesn't. Please s…
Reshaping Long to Wide when the ID is Not UniqueHi Everyone, I have Stacked on how to manipulate my data to make the Reshape Command Works. In my c…
Mean of Predictions (Point Estimates)Hey guys, I was hoping you would help me clarify a post-estimation issue I am having in stata. Assum…
Subscribe to:
Post Comments (Atom)
0 Response to Logic operations with generate
Post a Comment