Hi,
I want to count the number of observations within a certain range of another variable. For example, I want to count number of individuals in my data set with a taxable income between 380 000 and 420 000 in a certain year.
My count value is 72272. I now would like to save that value as a variable, no be able to use it in a calculation in the next line of code even if I switch data set.
My code so far is:
count if z>=380000 & z<=420000 & year==2
//= 72272
gen H = ?
How can i replace H = 72272 without doing it manually?
Thank you for your time!
/Oskar
I want to count the number of observations within a certain range of another variable. For example, I want to count number of individuals in my data set with a taxable income between 380 000 and 420 000 in a certain year.
My count value is 72272. I now would like to save that value as a variable, no be able to use it in a calculation in the next line of code even if I switch data set.
My code so far is:
count if z>=380000 & z<=420000 & year==2
//= 72272
gen H = ?
How can i replace H = 72272 without doing it manually?
Thank you for your time!
/Oskar
Comment