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
3SLS and GMM (error correlation)??Dear Statalist users I am having a problem in my research between 2-step GMM and 3sls. I have a sys…
Putting labels for different variables in one line of code or loop?Hello, I would like to add labels for a set of different variables, i have around 15, and would lik…
Base Level of Factor Variable in Probit with InteractionStatalist: I am running the following Probit model on pooled panel data: \[ P(y_{it} = 1 \vert x_{i…
New packages cprdonsutil and cprdlsoautil on SSCThanks as always to Kit Baum, 2 new packages cprdonsutil and cprdlsoautil are now available for down…
Test for sufficient sample size in linear probability modelHi, I run the following linear probability model: Code: reg nodad k1sex i.meduc i.state i.mdecade…
Subscribe to:
Post Comments (Atom)
0 Response to Logical operation using generate
Post a Comment