Hi!
I have a question on how to create fractions when using dummy variables. I would like to calculate a fraction, by district, consisting of the share of the dummy variable equal to 1 of the total (dummy equal to either 1 or 0). However, when I try to do this I end up with only 1's and a lot of missing values as a result of trying to divide 1/0. Is there any way to 'count' the total number of observations so that I can get the actual fraction of 1's in relation to the total amount by district?
Thank you in advance!
I have a question on how to create fractions when using dummy variables. I would like to calculate a fraction, by district, consisting of the share of the dummy variable equal to 1 of the total (dummy equal to either 1 or 0). However, when I try to do this I end up with only 1's and a lot of missing values as a result of trying to divide 1/0. Is there any way to 'count' the total number of observations so that I can get the actual fraction of 1's in relation to the total amount by district?
Thank you in advance!
Comment