Announcement

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

  • Problems with using coefplot after suest

    Hello,

    I have some problems using the coefplot command following a suest.

    I estimated 9 individual regression models. These models all include the same indepent variables, although the dependent variable varies. I used the suest command to combine the estimation results. Now, I want to plot the first coefficient of each model (the first coefficient is always the same in all submodels), in order to compare this coefficient as well as the 95% conf. intervall graphically across the models. I stored the suest as "dunrateoverall".
    However, when I use the coefplot command in the following way:

    coefplot dunrateoverall, keep (resQminus1)


    it only plots the coefficient of the first submodel, not of all submodels.
    The stored estimate correctly stored the whole suest, so I dont know why coefplot only gives me the coefficient of the first submodel...

    Thank you already for your help. This is my first post as I am just starting to work properly with Stata.

  • #2
    The examples I see in the user written -coefplot- use -estimates store- to store results. -suest- is generally for seemingly unrelated estimation, not for saving multiple results.

    Also, show exactly what you typed at Stata.

    Comment


    • #3
      I used -estmate store- after -suest- and it actually saved the multiple results.

      Here is wat i typed:

      reg dunrate dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrate

      reg dunrateplus1 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus1

      reg dunrateplus2 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus2

      reg dunrateplus3 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus3

      reg dunrateplus4 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus4

      reg dunrateplus5 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus5

      reg dunrateplus6 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus6

      reg dunrateplus7 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus7

      reg dunrateplus8 dunrateminus1 dunrateminus2 resQminus1 resQminus2 resQminus3 resQminus4 resQminus5 resQminus6 resQminus7 resQminus8
      estimates store dunrateplus8

      suest dunrate dunrateplus1 dunrateplus2 dunrateplus3 dunrateplus4 dunrateplus5 dunrateplus6 dunrateplus7 dunrateplus8

      est store dunrateoverall

      coefplot dunrateoverall, keep (resQminus1)


      The first part is just the 9 individual models, only the last 3 lines are important.
      Last edited by David Buegel; 24 Dec 2022, 03:19.

      Comment


      • #4
        Maybe I should clarify what I am trying to do:

        The dependent variable in the original 9 models can be seen as a time axis. I used the suest command to estimate jointly. Now I want to display the first coefficient 9 times (basically the first coefficient of all submodels) to see a change of the coefficient over the "time axis".

        Comment


        • #5
          What happens if you move the -coefplot- command before the -suest- command?

          The help file of -coefplot- has examples with -est sto-. It does not have examples with -suest-.

          And for the coefficient plots you do not need the -suest-. -suest- is useful for the joint variance matrix of all the models together.

          Comment


          • #6
            I did that as well. Together with the keep() option it gives me the desired results. However, using the suest command to jointly estimate the equations, the p-values decreased significantly. Thats why I wanted to use the coefplot after suest.

            Comment


            • #7
              Additionally, after using the suest command, I test for joint significance of the first coefficient across the submodels, as they are indivudally insignificant.

              Comment


              • #8
                I do not think that your p-values decrease because of the joint estimation, I think they decrease because you are not using robust variance, and -suest- uses robust variance by default.

                Comment


                • #9
                  I see. I didn't think about the robustness. Thanks a lot!
                  The p-values decreased, however, they are still not as low as with the -suest- joint estimation. But if I can't display the change of the coefficients over time using -suest-, then I will use -coefplot- after the regular (now robust) regressions.

                  Would you say the -suest- command is still viable to test for joint significance?

                  Comment


                  • #10
                    Originally posted by David Buegel View Post
                    I see. I didn't think about the robustness. Thanks a lot!
                    The p-values decreased, however, they are still not as low as with the -suest- joint estimation. But if I can't display the change of the coefficients over time using -suest-, then I will use -coefplot- after the regular (now robust) regressions.

                    Would you say the -suest- command is still viable to test for joint significance?
                    Yes, this is what -suest- is all about, to estimate your models jointly so that you can test joint significance or across equations restrictions.

                    What you are having is known as Multivariate Regression, because only your dependent variables are different, but the regressors are the same in each equation. You can also estimate your models jointly using -mvreg-. This however does not seem to help with -coefplot-, it is plotting only one of the estimated coefficients.

                    It seems that -coefplot- cannot handle system estimators.

                    Comment


                    • #11
                      Originally posted by Joro Kolev View Post
                      It seems that -coefplot- cannot handle system estimators.
                      coefplot is from SSC (FAQ Advice #12). With multiple models, you want to ask coefplot to keep all the equations.

                      Code:
                      coefplot, keep(*:)
                      Last edited by Andrew Musau; 26 Dec 2022, 05:16.

                      Comment


                      • #12
                        Originally posted by Joro Kolev View Post

                        Yes, this is what -suest- is all about, to estimate your models jointly so that you can test joint significance or across equations restrictions.

                        What you are having is known as Multivariate Regression, because only your dependent variables are different, but the regressors are the same in each equation. You can also estimate your models jointly using -mvreg-. This however does not seem to help with -coefplot-, it is plotting only one of the estimated coefficients.

                        It seems that -coefplot- cannot handle system estimators.
                        Thanks again for your input. I tried the -mvreg- command, however, as I don't have that many observations, the number of observations used for estimating the first equations dropped by quite a lot (relatively speaking) so that the standard errors where higher than with the regular regression.

                        Comment


                        • #13
                          Originally posted by Andrew Musau View Post

                          coefplot is from SSC (FAQ Advice #12). With multiple models, you want to ask coefplot to keep all the equations.

                          Code:
                          coefplot, keep(*:)
                          Thanky you very much! Using -keep (*: ) drop (....) solved the problem for me.

                          So, compared to the individual regressions with robust standard errors, suest yields the same coefficiants with even lower standard errors.
                          As my individual equations are definitely correlated (as the dependet variable is basically the time axis), I can use -suest- and interpret the increase in significance as the result of Stata estimating all at the same time?
                          Last edited by David Buegel; 26 Dec 2022, 06:44.

                          Comment


                          • #14
                            Originally posted by David Buegel View Post
                            So, compared to the individual regressions with robust standard errors, suest yields the same coefficiants with even lower standard errors.
                            As my individual equations are definitely correlated (as the dependet variable is basically the time axis), I can use -suest- and interpret the increase in significance as the result of Stata estimating all at the same time?
                            What Joro states is correct, suest only adjusts the VCE - so the standard errors are not lower compared to. Only note that suest reports z-statistics whereas regress reports t-statistics, so this may be what is tripping you up. Try glm instead with the -robust- option.

                            Comment


                            • #15
                              I didn't realise that one reports t-statistics, while the other reports z-statistics. That explains a lot for me. Using -glm- and comparing the results cleared thing up for me.

                              One follow up regarding the different statistics:

                              I know that, individually, I can't use z-statistics as I only have between 20-25 observations per submodel. That's why I use -regress- to estimate and store my submodels. Does using -suest- and, therefore, z-statistics become viable for me when doing a joint estimation as I have ~200 observations in total across all submodels?
                              The results of -suest- are more significant than the results of regress with the robust option due to the different statistics reported (as you mentioned). And -suest- yields the same results as glm with -robust- option would individually. As I can't use glm with -robust- individually (too few obs), I am wondering wether I can use -suest- jointly to get a smaller 95% intervall by using z-statistics.

                              Thank you very much in advance!

                              Comment

                              Working...
                              X