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
Need Help Appending a Column Using AsdocDear all, I am using Stata 16, on mac and have provided a sample of my dataset using dataex at the …
Vertically truncating Kaplan-Meir survival curve upon reaching specified minimum threshold.I am trying to vertically truncate Kaplan-Meier survival curves when they reach a certain threshold …
Simple Binary Outcome QuestionHello, I am having a problem understanding a simple statement that I need to code in Stata. Define…
Measurement invariance MGCFA: correct approach and issue with identification of configural modelDear Statalist members, I have a question about measurement invariance testing for multigroup confi…
Need help with creating first difference operator for regression - econometricsHi There Everyone. I hope you're all well. I had a question, I'm really lost - i need to create a f…
Subscribe to:
Post Comments (Atom)
0 Response to Logic operations with generate
Post a Comment