Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Developing Aggregate Multilevel Dummy (Factor Variables?)

    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!

  • #2
    Anna:
    welcome to this forum.
    As you stated, the recommended approach for plugging in discrete predictors is factor variable notation (see -help fvvarlis-),that would spare your time in creating dummies by hand..
    Conversely, it's rare that those predictors are considered as they were in fact continuous.รน
    That said, your first code:
    Code:
    regress rate fraction occnumber
    will give you what your after; however, I cannot say whether its results will be informative for your research purposes.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you!

      Comment

      Working...
      X