Announcement

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

  • Multiple regressions into one

    Good morning to everyone. I am working with IPUMS data to study some aspects about immigration. And now, I am facing an issue about ancestries.
    To simplify, imagine that the US has 400 counties and 4 regions.
    I basically count the number of ancestries in counties 1 -100 located in region 1 and then regress this dependent variable on the total number of immigrants located in regions 2,3,4 to overcome an endogeneity problem. Again, I do the same for ancestries located in counties 101…200 in region 2 and they regress it on the total number of regions 1,3,4 and so on for the other counties/regions.
    Of course each regression has its own coefficients.
    Now my question is whether is possible to aggregate these regressions into one regression and get one coefficient.

    This is the code to give an example:

    Code:
    *Ancestry construction in counties of region 1*
    egen ancestry1_1980 = count(id) if year==1980 & region==1, by(birthplace county)
    *Immigrants of other regions*
    egen outsiderimmigrants234_1980=count(id) if  region !=1 & year==1980, by(birthplace)
    *regression
    reg ancestry1_1980 outsiderimmigrants234_1980
    
    *Ancestry construction in counties of region 2*
    egen ancestry2_1980 = count(id) if year==1980  & region==2, by(birthplace county)
    *Immigrants of other regions*
    egen outsiderimmigrants134_1980=count(id) if  region !=2 & year==1980, by(birthplace)
    *regression
    reg ancestry2_1980 outsiderimmigrants134_1980
    Thank you.

  • #2
    Andrea:
    welcome to this forum.
    I'm not clear with what you're after; that said, this might be a job for -collapse-.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Professor Lazzaro, thank you.

      Basically, I want to perform a unique regression instead of four, but I am struggling with the code due to the different conditions (e.g ancestries must be located in counties within a region while the other immigrants are located in the other three regions). .




      Comment


      • #4
        Andrea:
        two comments, possibly off target:
        1) it seems kinda spatial econometrics problem (see -help sp intro-);
        2) on a more general level, if you have counties nested within regions, -regress- is not the way to go.
        As an aside, please call me Carlo, like all in (and many more out of) this forum do. Thanks.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Carlo:
          both comments are useful.

          Thank you for your help.
          Andrea

          Comment

          Working...
          X