Announcement

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

  • second stage regression.

    I am trying to apply following regression.
    bysort Country: regress bdr fam MTB
    this is my first stage regression for second stage I want to use another variable shtd as my dependent variable and use predicted value of bdr from first regression as independent variable. so second model will be like.
    bysort Country: regress shtd fam MTB
    Can anyone guide.

  • #2
    It does not make any sense to me what you are planning to do. If shtd contains the predicted values from your first-stage regression and you are regressing these predictions on exactly the same variables again, then your second-stage R² will be 1, the coefficients will be identical to those from the first stage, and the standard errors will be zero. There will be an exact linear relationship between your dependent and independent variables in your second stage.
    https://twitter.com/Kripfganz

    Comment


    • #3
      Click image for larger version

Name:	table.png
Views:	1
Size:	316.7 KB
ID:	1375353
      Sorry I made one mistake in my second stage regression model.
      bysort Country: regress bdr fam MTB lnTA
      this is my first stage regression for second stage I want to use another variable shtd as my dependent variable and use predicted value of bdr from first regression as independent variable. so second model will be like.
      bysort Country: regress shtd Predict(bdr) fam MTB lnTA lnTA2(square)
      for reference I am attaching a table from a Published Paper.

      Comment


      • #4
        What you want to accomplish cannot be done easily using bysort Country: regress because the predict command for each regression needs to be run while the regression results are available. You will instead want to us a foreach loop over the values of the Country variable. Something like the following is what I imagine will accomplish what you need. You do not tell us if country is a numeric or string variable; my code assumes it is a string. If not, replace "`c'" with `c' wherever the former appears.
        Code:
        levelsof Country, local(countrylist)
        generate float bdr_hat = .
        foreach c of local countrylist {
        regress bdr ... if Country=="`c'"
        predict temp if Country=="`c'"
        replace bdr_hat = temp if Country=="`c'"
        drop temp
        regress sgtd bdr_hat ... if Country=="`c'"
        }

        Comment


        • #5
          Yes right country is a string variable . But when i put these codes into stata it shows missing values.
          Attached Files

          Comment


          • #6
            Your picture of your work is not fully informative. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using CODE delimiters, and to use the dataex command to provide sample data, as described in section 12 of the FAQ.

            To present data, code, and results readably, copy them from the Results window or your log file into a code block in the Forum editor. For example, the following:

            [code]
            // sample code
            sysuse auto, clear
            describe
            [/code]

            will be presented in the post as the following:
            Code:
            // sample code
            sysuse auto, clear
            describe
            By copying the output from the Results window, you're not limited by the size of the screen on your computer as to how long the results can be.

            Your picture suggests that you did not submit to Stata the complete code in my post #4.

            Comment


            • #7
              When I use the given codes, I got the following type of results. In first table which shows first stage regression the coefficients are small and in accordance with the previous studies. But The second table which is a second stage regression in which the dependent variable is chaged and predictbdr is used as independent variable(obtained from first regression) the coefficients and standard error values are very big cannot be used and not accordance with previous studies can you guide.
              Click image for larger version

Name:	IMG_1648.JPG
Views:	1
Size:	272.8 KB
ID:	1376584

              Comment


              • #8
                I think you will find that previous studies did not include in the second stage regression the variables that were included in the first stage regression - or at least not most of them. Since predBdr is a linear combination of variables that all appear along with it in the second stage regression, you have perfect multicollinearity and your results are meaningless.

                Comment


                • #9
                  But previous studies use the same just difference of two variables that are LnTA2 and assmat only. I am applying the same only difference is they studies domestic and multinational firms. I am trying to apply the same on family and non-family firms. Can you understand the explanation in the above table which has some highlighted portion in yellow.
                  Last edited by Jahan zee; 03 Mar 2017, 00:49.

                  Comment


                  • #10
                    It appears that you are attempting to do two-stage least squares (2SLS) without using the Stata commands that support that.

                    If you read the 2SLS literature, you will see that the first stage model needs to include instrumental variables not part of the second stage model along with the explanatory variables used in the second stage model. I note that neither the material quoted in post #3 nor the full article from which it is drawn seem to address the issue of intrumentation.

                    Comment

                    Working...
                    X