Announcement

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

  • Explaining a main variable by the movement of some other variables

    Hello Stata users;

    I hope I could get some help with this. I do have this data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(Fiscal_resources Non_fiscal_resources Debt_resources Total_budget_resources)
       1632   635.9   771.3   3039.2
     1666.8     737   619.6   3023.4
     1772.1   859.2     791   3422.3
       1946   951.4     938   3835.4
     2169.2   855.1    1195   4219.3
       2464   709.4    1443   4616.4
     2809.5   860.3  1094.2     4764
     3080.5   966.5  1432.9   5479.9
     3283.5  1073.4  1722.1     6079
     3492.4     988  1925.5   6405.9
     3780.2  1016.6  2750.3   7547.1
       4231   977.6    2733   7941.6
     4762.7    1327    2431   8520.7
       5208   924.2  2750.7   8882.9
     5678.4   853.6  3063.5   9595.5
     6221.5   874.1  3783.6  10879.2
     6429.2    1247  3368.1  11044.3
     6630.7  1190.2  3738.9  11559.8
     7251.9  1464.5  4024.5  12740.9
     7904.1    1376  3009.2  12289.3
     8469.8  2082.8  2217.9  12770.5
     9508.1  1935.9  2437.6  13881.6
    11330.9 2383.25  1640.4 15354.55
    11685.2  2076.8  2187.4  15949.4
    12698.7  2124.6  1859.1  16682.4
    13629.7  3123.2    3731  20483.9
    14864.6  3623.8  4764.1  23252.5
    16333.4  3670.7  5279.3  25283.4
    18673.6  1686.6  6892.8    27253
    18487.3    1640  7374.7    27502
      18702  2543.2    8157  29402.2
    21186.5  2704.9 10284.4  34175.8
    24503.3    3439    9498  37440.3
    28909.9  3465.9  9692.5  42068.3
    27147.1  3505.9 15896.8  46549.8
    30408.8  3360.2 14224.7  47993.7
    35449.3  5794.4   18304  59547.7
    end
    As you can see, my main budget variable is the "Total_budget_resources", which is composed of the 3 sub-budgetary variables: Fiscal_resources, Non_fiscal_resources and Debt_resources. It is obvious that the main variable depends on those 3 sub-variable, already, when adding them up, we get the value of the Total_budget_resources, which means that when one of those 3 sub-budgetary variables move, the main variable would follow.
    I've tried to study that using a simple regression: reg Total_budget_resources Fiscal_resources Non_fiscal_resources Debt_resources, but that didn't work, I don't know why.
    I would love to get a statistical study or a code that could help explain the movement of the main "Total_budget_resources" by the movement of the 3 other sub-budget variables at each year or each period, even when drawing the line graphs of those 4 variables, we could see that there is some kind of relation.

    ​​​​​​​ Any help please? Thanks in advance!

  • #2
    I don't understand what you are asking. The equation Total_budget_resources = Debt_resources + Non_fiscal_resources + Fiscal_resources is an accounting identity, and your data are 100% consistent with it. Any unit movement in any of the right hand side variables produces exactly a unit movement in the same direction in the left hand side.

    I've tried to study that using a simple regression: reg Total_budget_resources Fiscal_resources Non_fiscal_resources Debt_resources, but that didn't work, I don't know why.
    Well, I can't reproduce that at all on my setup: everything goes smoothly and produces exactly the expected results:
    Code:
    . regress Total_budget_resources Fiscal_resources Non_fiscal_resources Debt_resources
    
          Source |       SS           df       MS      Number of obs   =        37
    -------------+----------------------------------   F(3, 33)        =         .
           Model |  7.5872e+09         3  2.5291e+09   Prob > F        =         .
        Residual |           0        33           0   R-squared       =    1.0000
    -------------+----------------------------------   Adj R-squared   =    1.0000
           Total |  7.5872e+09        36   210754598   Root MSE        =         0
    
    --------------------------------------------------------------------------------------
    Total_budget_resou~s | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    ---------------------+----------------------------------------------------------------
        Fiscal_resources |          1          .        .       .            .           .
    Non_fiscal_resources |          1          .        .       .            .           .
          Debt_resources |          1          .        .       .            .           .
                   _cons |   .0000837          .        .       .            .           .
    --------------------------------------------------------------------------------------
    And since all you say about your own attempt at this is that it "didn't work" nobody can even know where to begin in helping you figure out what you did wrong. If you need help troubleshooting code, you need to show the exact actual code you ran (which, perhaps, you did) along with the exact output that Stata gave you from it, and, unless it is blatantly obvious even to people who know nothing about the subject matter, you need to describe how the output you got does not meet your expectations and needs. The only thing one might say about the results I am showing here is that the constant term, which, in theory should be exactly zero, has a small rounding error beginning in the 5th decimal place--but that is as good as it gets with finite-precision digital calculations like this.

    Somehow, I suspect you have something else in mind, but you have not at all communicated what that is.

    Comment


    • #3
      Dear Clyde Schechter Thanks for the response.

      Yes, the equation is an accounting identity, you are right about that. Yet, when I've drawn the evolution of the 4 variables by time on a graph, I've seen that a movement of any of the right hand side variables produces a movement of the left hand side variable, yet, by the grapg, that also depends on the time period, and that is what i wanna study and show.

      I've done the same regression with the same code that you've kindly showed me, and I was kind of confused since there were no results on the Std. err., t P>|t|, [95% conf. interval] information, that's the first time I've seen a regression result like that (perhaps it's because the relation is an accounting one).

      Perhaps all I'am saying is a bit wrong anyway.

      Again, thanks for the help.

      Comment


      • #4
        there were no results on the Std. err., t P>|t|, [95% conf. interval] information, that's the first time I've seen a regression result like that (perhaps it's because the relation is an accounting one).
        Yes, that's precisely because it's an accounting identity. Or, more generally, because the regression fits the data with no error term, there is nothing that can be used to calculate standard errors and the other inferential statistics one normally sees. This will happen in any regression where the data are fit perfectly by the regression equation.

        Comment


        • #5
          Clyde Schechter I understand.
          Thanks for the respond.

          Comment

          Working...
          X