Exemplary data:
I have the following problem: My intention is to compute summary statistics for certain observations in my dataset using combined if-conditions. In order to do this I tried the following line of code:
However, I get an empty table:
Moreover, I get the same result changing the status variable. What am I missing here? For the above mentioned code snippet, I expected to get the summary table of wealth for the observation with id number 2. How can this be computed?
Code:
input id wave status 1 1 0 1 2 1 2 1 0 2 2 0 3 1 1 3 2 0 4 1 1 4 2 1 end gen wealth = runiform()
Code:
sum wealth if (wave == 1 & status == 0) & (wave == 2 & status == 0)
Code:
Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- wealth | 0
Comment