Dear Stata users,
In the following code, can we add an 'if' expression in mata command? Thank you.
For example, I want to caculate mean of ages only for urban respondents.
In the following code, can we add an 'if' expression in mata command? Thank you.
For example, I want to caculate mean of ages only for urban respondents.
Code:
mata : all = st_data(., "age1 age2 age3 age4") mata : mean(vec(all))
Comment