Hello! I have not been able to figure out this question with the relevant Stata guides and would greatly appreciate if you can point me in the right direction!
I am trying to complete a regression as follows: regress rate fraction occnumber, where rate and fraction provide discrete, quantitative data related to 40 occupations and occupations are numbered from 1 to 40 (occnumber).
Since occnumber is a categorical variable, I am not certain as to how to incorporate it into the regression to produce desired results. (I could use 39 dummies, but clearly that would be undesirable!) From what I have read, it seems that a factor variable might be used for this purpose? But when I use regress rate fraction i.occnumber, I am given a separate line with separate results for each occupation in the regression. I would like instead to see the aggregate effect of occnumber in my regression, such that my regression only gives me 3 coefficients: one for fraction, one for the aggregate effect of occnumber and the constant.
Is this possible? If so, how can I do it? Thank you!
I am trying to complete a regression as follows: regress rate fraction occnumber, where rate and fraction provide discrete, quantitative data related to 40 occupations and occupations are numbered from 1 to 40 (occnumber).
Since occnumber is a categorical variable, I am not certain as to how to incorporate it into the regression to produce desired results. (I could use 39 dummies, but clearly that would be undesirable!) From what I have read, it seems that a factor variable might be used for this purpose? But when I use regress rate fraction i.occnumber, I am given a separate line with separate results for each occupation in the regression. I would like instead to see the aggregate effect of occnumber in my regression, such that my regression only gives me 3 coefficients: one for fraction, one for the aggregate effect of occnumber and the constant.
Is this possible? If so, how can I do it? Thank you!
Comment