Hello, I am just starting to use Stata, so excuse me in advance if my question is a bit sketchy. I am using an annual database with a binary variable column "x"; I wish to create another column "y", which will take values 1 for the 10 previous years for which x is equal to 1. (e.g.: If x = 1 in 2011, then "y" will take values of 1 from 2001:2010). Thank you for your help.
Related Posts with Logical test involving two columns
Replace odd commas by spaces in a variableHi, Thanks in advance for your help. Maybe, what I am going to ask is an easy question for many of y…
Panel regression model / Multiple regression model?Hi everyone, I have a dataset available which links the the Covid-19 situation to the change in por…
Omitted interaction terms in the fixed effect due to collinearityHi all, I have a question when I am running a fixed effect regression which is used to investigate …
Regressing a variable recorded in 2018 on a variable of 2011Hello everybody, I'm a beginner of Stata and I'm already facing the first issues. I have a panel dat…
why I need to run the command keep twice to delete some observations? Code: ---------------------------------------------------------------------------------------------…
Subscribe to:
Post Comments (Atom)
0 Response to Logical test involving two columns
Post a Comment