Announcement

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

  • Combine Two Variables using Stata

    How do I combine two variables to create a new variable? Thanks in advance!

  • #2
    Define combine: add, subtract, multiply, divide, concatenate, ...

    Please give a example of your data and what you want to do.

    Comment


    • #3
      Code: reg lwage educ iq exper tenure meduc feduc age.
      looking to combine the "meduc+feduc" to a new variable.


      Comment


      • #4
        looking to combine the "meduc+feduc" to a new variable.
        Well, you don't explain what any of these variables actually are, but let me surmise that meduc and feduc are mother's and father's education. But how are those implemented? Number of years of formal schooling the parent has completed? Or perhaps just an ordinal variable with categories like some secondary education, high school graduate or equivalent, some college, college graduate, some graduate/professional school, graduate/professional degree? Or something else?

        And in what sense do you want to "combine" them? It depends on what you think is relevant and linearly related to the variable lwage. Would that be the sum, i.e., the total number of years of education between the parents? (N.B. This is only even possible meduc and feduc are the numbers of years?) If so, that's just -egen parental_educ = rowtotal(meduc feduc)-.

        Or maybe it matters more what the maximum education level in the family was. Or maybe the minimum. Or the median. Or some weighted average. The choice among these is neither a Stata question nor a statistical question. It's a substantive question in your discipline: in what way do the educational levels of mother and father influence their offsprings' lwage? Perhaps there is a literature on this. If not, and if you are not sure what the best specification of this combined variable should be, then you should discuss with colleagues in your field. If nothing is known, then perhaps you should explore several possibilities: it is, after all, an interesting question in its own right.

        Comment

        Working...
        X