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
Descriptive Statistics per Country - STATA to Work-OutputHi, I have started to work on my data do-file for my thesis I managed to run the commands I need a…
PCA for repeated measuresHello Statalist contributors, I am looking for a solution to a problem that seems unanswered on thi…
Print conditional statementI wrote this code to get Stata to print a conditional statement: Code: if p_value < alpha /// …
Help regarding panel categorical data analysis in Stata I am recently researching crises and the usefulness of different models in predicting them. It woul…
The trace plot creation after data imputationHello, I struggle with creating trace plots after data imputation. Imputation code has the followi…
Subscribe to:
Post Comments (Atom)
0 Response to Logical test involving two columns
Post a Comment