Announcement

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

  • Linear Combination of Regression Coefficients

    Hi,

    I have conducted 6 regressions using regress, for each of which i have obtained the parameter estimates for 9 dummy variables (Post4, Post3,...,t,....Pre4). I have saved these to a combined dataset using parmest and dsconcat. A reduced example of this dataset is shown below for the Pre4 variable.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte idnum str11 parm double(estimate stderr t p) long parm2 float invse
    1 "Pre4"   5.09280645973824  .9437865367161815   5.396142307198184 .0029514683694526135 54 1.0595616
    2 "Pre4"  .7066338150589562  .8846509819314182   .7987713001981807   .48281281201533227 54 1.1303893
    3 "Pre4" 1.1170242378310937 2.2346338383132207  .49986902492905166    .6515300059381982 54  .4475006
    4 "Pre4" -8.992687861124724  4.982496104647165 -1.8048559742449692     .212858698506142 54 .20070262
    5 "Pre4" -1.803313361273864 3.8596306302453467 -.46722433673898794    .6862993233251755 54 .25909215
    6 "Pre4"  4.493797243812523   .567529932019984   7.918167818599365  .004199578371004655 54 1.7620217
    end
    My issue is that I want to obtain a sum of these estimates, weighted by the inverse of their standard error, whilst also obtaining a new standard error for the linear combination. I have been trying to use lincom and lincomest but if I just use Pre4 as the variable to sum, I do not get the same number as if I manually calculate this sum. I have tried reshaping my data to get an individual variable name for each parameter estimate but when i try and sum these Stata tells me that it doesn't find these variables.

    Thanks.

  • #2
    If you want to use lincom, you need to put these together using sureg or suest. Then you can use lincom etc. Once you put them into a data set, then you can do calculations but can't use the test facilities (you'd have to program them yourself).

    I don't fully understand your calculation problem. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    Comment

    Working...
    X