Econometrics论文模板 – Applied Econometrics Exercises

Exercise 1

This report attempts to evaluate the factors that determine the level of earnings by an employee. It assesses how factors such as schooling, work experience, and gender impact the personal earnings level.  Figure 1 and figure 2 below shows the scatter plot for earnings against experience and years spend in school.  It is evident that both years of experience and schooling have a mild positive relationship with the level earnings. Both datasets have clear outliers, and further analysis is required to determine the nature of the relationship between the variables conclusively.

Figure 1: A Scatter Plot of the Earnings and Experience

Figure 2: A Scatter Plot of the Earnings and Years in School

Over the past few years, organizations have sought continuously to retain employees as changes and disruption due to employee turnover are often expensive. The hiring and training of new personnel is both time and resource consuming. New staff must learn and get accustomed to the policies and culture of the organization. It is likely that their effectiveness, efficiency, and productivity is less than that of the employee who left.  Therefore, companies seek to retain their employees by rewarding them for staying. However, the dataset does not show a clear relationship between tenure and the level of earning as seen I figure 3 below.       

Figure 3: A Scatter Plot of the Earnings and Tenure

Regression Analysis

This report employs regression analysis to determine the extent to which earnings by individuals is explained by working experience, years of education and gender. The results from regressing the corresponding variables are shown in table 1 below. The dataset consists of 200 observations. The estimated model can be summarized as follows:

Earnings = (2.6389 × Schooling) + (0.33737 × Experience) + (8.2732 × Gender) – 26.4886        (1)

Equation 1 above shows is a regression model capturing the relationship between earnings and the working experience, years of education and gender of an employee. It suggests that the experience, years of education, and gender variables have a positive relationship with the earnings. The estimated coefficients suggest the longer an employee spend in education, the higher the earnings. Also, employees with more job experience are likely to earn a higher salary than their counterparts with less experience. The estimated coefficient of the role of gender in earrings suggests that male employees earn more than their female counterparts.

Table 1: Summary of the Regression Analysis Results

Source       SSdf     MS Number of obs =     200 
 F(  3,   196) =   25.78 
Model13467.6634489.22 Prob > F      =  0.0000 
Residual34135.93196174.16 R-squared     =  0.2829 
 Adj R-squared =  0.2719 
Total47603.60199239.21 Root MSE      =  13.197 
 
EARNINGSCoef.Std. Err.     tP>t[95% Conf. Interval] 
S2.63890.37107.110.00001.907279        3.370423 
EXP0.37370.24741.510.1320-.1141602    .8615998 
MALE8.27321.94924.240.00004.429143         12.11731 
_cons-26.48867.2427-3.660.0000-52.9772 

The results of the F Test show the overall significance of the model for further extrapolation. It points out if the independent variable is likely to have occurred by chance with a given degree of freedom and particular observations. The p-value of the F-statistic is 0.00 implying that at a 5% significance level, we would reject the null hypothesis that the intercept-only estimated model fits the data as well as the proposed model. Hence, the data provides sufficient evidence to conclude that the proposed regression model is significant as it gives a better fit than the model with no independent variables.  The model has an Adjusted R2 of 0.2719 implying that the model explains only 27.19% of the variations of the dependent variable. Hence, it can accurately forecast the earnings of an employee using working experience, years of education and gender 27.19% of the times.

The t-statistic is used to examine the significance of the coefficients of the estimated model. It is employed in testing the following hypothesis:

H0: Estimated coefficient = 0

H1: Estimated coefficient ≠ 0

The p-values of the t-static for the estimated coefficients of working experience, years of education and gender are 0.13, 0.00, and 0.00 as seen in table 1. Therefore, at a 0.05 significance level, we reject the null hypothesis that the coefficients for the variables of years in school and gender are equal to zero. However, we fail to reject the null hypothesis that the estimated coefficient of the experience variable is zero as the p-value is greater than 0.05. Hence, at 5% significance level the variables for years in school and gender are significant in the model while experience is not.   

Residuals Analysis

Following the regression analysis and estimation of the model describing the nature of the relationship between earnings and, working experience, years of education and gender the residuals are tested for correlation with the independent variables. Residuals are required to be independent and random to minimize type 1 error. Figure 4 it is evident that the residuals are centered on zero seem randomly distributed as they have no distinct pattern.

The classical assumptions of ordinary least squares linear regression advance the following assumptions about the residuals:

  • Residuals have a population mean of zero.
  • The independent variables are uncorrelated with the error term.
  • The residuals have a constant variance.
  • The residuals are normally distributed.

The residuals of the model are distributed around zero as seen in figure 4. Hence the assumption that the residuals have a population mean zero is true. The assumption on the variance of errors implies that the variance should be consistent for the range of observations. The plot of residuals versus fitted value is applied to check for the assumption of homoscedasticity. In figure 4 it is evident that the spread of the residuals increases with the increase in fitted values implying that variance changes with values of the fitted model. The cone-shaped spread of distribution implies heteroscedasticity of residuals.

Figure 4:  A scatter Plot of the Residuals Versus Fitted Values

Table 2 below shows the results of the Shapiro-Wilk test for Normality. The p-value is less than 0.05. Hence, we reject the null hypothesis that the residuals are normally distributed.

Table 2: Results of the Shapiro-Wilk Test for Normality

   Variable    Observations      W          V        z      Prob>z
    residual2000.986052.0811.6860.04589

Testing for Heteroscedasticity 

For a linear regression model to be reliable, the variance of the errors should be consistent for all observations.  This report employs the Breusch-Pagan test to test for heteroscedasticity of the independent variables. The analysis produces a chi-squared statistics with 3 degrees of freedom when the null hypothesis of no heteroscedasticity is satisfied which is 46.09 in this case as seen in table 3 below. The estimated p-value of the chi-squared statistics is 0.00. Therefore, the null hypothesis of no heteroscedasticity is rejected. The results suggest that the variance of the residuals of the model increases or decrease as a function of one of the independent variables.  The presence of heteroscedasticity negatively affects the reliability of the results of the regression analysis as the t-values of the estimated coefficients are affected by the biased standard error terms.

Table 3: Results of the Breusch-Pagan Test

Breusch-Pagan / Cook-Weisberg test for heteroscedasticity          Ho: Constant variance          Variables: S EXP MALE            chi2(3)      =    46.09          Prob > chi2  =   0.0000  

Remedy for Heteroscedasticity

Various approaches can be employed to correct the heteroscedasticity problem. This report will apply use the logarithm approach. It involves generating the logarithm of the dependent variable and using the same as the dependent variable in the regression model. Table 4 below shows the results of regression analysis with the Log of earnings as the dependent variable. Based on the F-statistic the estimated model is significant at a 0.05 significance level. The estimated coefficients for working experience, years of education and gender are all significant at a 0.05 significance level. 

Table 4: Summary of the Regression Analysis Results with Log of Earnings as Dependent Variable

. regress LogEarnings S EXP MALE
      Source |      SS      df      MS             Number of obs =     200
 F(  3,   196) =   51.07
       Model35.39846311.7994871Prob > F      =  0.0000
    Residual |45.282311960.23103217 R-squared     =  0.4387
 Adj R-squared =  0.4302
       Total | 80.680771990.405430989Root MSE      =  .48066
 
 LogEarnings |     Coef.  Std. Err.     t     P>|t|  [95% Conf. Interval] 
           S | 0.14030.013510.380.00000.11360.1669
         EXP |  0.03500.00903.880.00000.01720.0528
        MALE |   0.34190.07104.820.00000.20190.4819
       _cons | 0.10640.26380.40.6870-0.41380.6266

Table 5 shows the results of the Breusch-Pagan test for the new model.  The results show that the new model is homoscedastic since we fail to reject the null hypothesis for no heteroscedasticity as the p-value of the chi-squared statistic is greater than 0.05.  Therefore, the logarithm approach solves the heteroscedasticity problem of the model. 

Table 5: Results of the Breusch-Pagan Test for the New Model

Breusch-Pagan / Cook-Weisberg test for heteroskedasticity          Ho: Constant variance          Variables: fitted values of LogEarnings            chi2(1)      =     0.08          Prob > chi2  =   0.7811

Improving the Model

The model does not allow for testing whether the marginal effect of schooling on earnings depends on gender. It would require a change of the model’s gender variable to examine if the coefficient of schooling on earnings depends on gender.  The variable female is added to the model to replace the male variable. Table 6 below shows the results of the regression model with the variable Female. The estimated coefficient of the number of years is the same for both models in table 4 and table 6 suggesting that the effect of earnings depends on gender. Further correlation analysis shows that the gender variable does not have a relationship with the number of years in school.

Table 6: Summary of the Regression Analysis Results After Replacing the Variable Male With Female

regress LogEarnings S EXP  FEMALE
      SourceSS      df      MS             Number of obs =     200
 F(  3,   196) =   51.07
       Model35.3985311.7995 Prob > F      =  0.0
    Residual45.28231960.2310R-squared     =  0.4387
 Adj R-squared =  0.4302
       Total 80.68081990.4054Root MSE      =  .48066
 
 LogEarnings   Coef.  Std. Err.     t   P>|t|    [95% Conf. Interval] 
           S0.14030.013510.380.00000.11360.1669
         EXP0.03500.00903.880.00000.01720.0528
      FEMALE-0.34190.0710-4.820.0000-0.4819-0.2019
       _cons0.44830.28041.600.1110-0.10471.0012

Table 7: Correlation Matrix

 LogEarnings MALES   EXP
LogEarnings1   
 MALE0.35231  
S0.53480.04051 
   EXP0.16920.2697-0.21961

Adding Variables

The tenure in current employment should be added to the model. Over the past few years, organizations have sought continuously to retain employees as changes and disruption due to employee turnover are often expensive. The hiring and training of new personnel is both time and resource consuming. New personnel must learn and get accustomed to the policies and culture of the organization. It is likely that their effectiveness, efficiency, and productivity is less than that of the employee who left.  Therefore, companies seek to retain their employees by rewarding them with higher salaries for staying in the company.

Conclusion

The study established that working experience, years of education and gender are significant factors that impact the level of income. The results suggest that the more years in work experience and schooling yield higher income levels. The finding highlighted a key issue of gender inequality as the regression model showed that male employees earn more than their female counterparts. Organizations should aim at eliminating gender biases by ensuring all employees are compensated by merit.

Exercise 2

Figure 5 below shows the time series plot of the variable of the study. It is evident that the variable follows a seasonal pattern of an increasing trend followed by a sharp decline. The correlogram for the dataset is shown in figure 6 below. The character-based plot of the autocorrelations shows that the dataset has a seasonal component.   

Figure 5: Time Series Plot

Figure 6: Correlogram

Time series analysis seeks to provide a reliable description of the data and to understand unique features of trends, randomness, and seasonality. As observed in figure 5 and figure 6 the dataset has a significant seasonality component. A model can be derived from the time series data to predict future values based on the identified features of historical data.  Before building any forecasting model from a time series, it is necessary that the series is stationary. Where the stationarity condition is breached, the first solution involves making the time series stationary by differencing or detrending and using stochastic models to make predictions in the time series.  A time-series is said to be stationary if the mean of the series is constant such that it is not a function of time and homoscedastic such that the variance does not change over time. Hence, stationarity implies that the probabilistic character of a series does not vary with time.  

From figure 5 it is evident that the dataset has a seasonality component but no visible trend component. Based on the time series plot, the mean and the variance of the dataset do not seem to be constant over time hence the dataset is not stationary. In this case, we solve the stationarity problem by creating a new variable, z, derived from differencing the time series data. Figure 7 and figure 8 below show that the time series plot of the new variable and the character-based plot of the autocorrelations of the new variable. It is evident that the first difference of the variable is not stationary as the new variable shows changes in mean and variance as seen in figure 7 and figure 8.

Figure 7: Time Series Plot of Z

Figure 8: A Correlogram of Z

The second difference is obtained since the first difference does not yield stationarity of the dataset. From figure 9 and figure 10 below it is evident that the stationarity is achieved at the second difference. 

Figure 9: A Time Series Plot of the Second Difference

Figure 10: A Correlogram of the Second Difference

Once stationary is achieved for the dataset, we fit the autoregressive model. The study runs an ARIMA (3,2,1) model, and the results are shown in table. The choice of the autoregressive order (3), integrated difference order (2), and moving average order (1) were derived from different approaches.  The choice of the autoregressive order was derived from the number of peak points in the partial correlogram in figure 11 below.

Table 8: Summary of the Estimated ARIMA Model

arima z, arima(3,2,1) ARIMA regression   Sample:  4 – 111                                Number of obs      =       108                                                 Wald chi2(4)       =    112.06 Log likelihood = -431.3875                      Prob > chi2        =    0.0000   ——————————————————————————              |                 OPG         D2.z |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval] ————-+—————————————————————- z            |        _cons |   -.000151   .0236076    -0.01   0.995     -.046421     .046119 ————-+—————————————————————- ARMA         |           ar |          L1. |  -.7428243   .0830595    -8.94   0.000    -.9056179   -.5800307          L2. |   -.412752   .1040706    -3.97   0.000    -.6167266   -.2087774          L3. |  -.2386445   .0937128    -2.55   0.011    -.4223182   -.0549708              |           ma |          L1. |  -1.000014    169.442    -0.01   0.995    -333.1002    331.1002 ————-+—————————————————————-       /sigma |   12.71143   1077.085     0.01   0.495            0    2123.759 ——————————————————————————

Figure 11: A Partial Correlogram

Stata Log File

  ___  ____  ____  ____  ____ (R)

 /__    /   ____/   /   ____/

___/   /   /___/   /   /___/   12.0   Copyright 1985-2011 StataCorp LP

  Statistics/Data Analysis            StataCorp

                                      4905 Lakeway Drive

     Special Edition                  College Station, Texas 77845 USA

                                      800-STATA-PC        http://www.stata.com

                                      979-696-4600        stata@stata.com

                                      979-696-4601 (fax)

Single-user Stata network perpetual license:

       Serial number:  93611859953

         Licensed to:  —–

                       ——

Notes:

      1.  (/v# option or -set maxvar-) 5000 maximum variables

. use “C:\Users\dell\Dropbox\jobs\Experiment5\Logfile.dta”, clear

. twoway (scatter EARNINGS EXP)

. twoway (scatter EARNINGS S)

. twoway (scatter EARNINGS TENURE)

. regress EARNINGS S  EXP MALE

      Source |       SS       df       MS              Number of obs =     200

————-+——————————           F(  3,   196) =   25.78

       Model |  13467.6617     3  4489.22056           Prob > F      =  0.0000

    Residual |  34135.9337   196  174.162927           R-squared     =  0.2829

————-+——————————           Adj R-squared =  0.2719

       Total |  47603.5953   199  239.214047           Root MSE      =  13.197

——————————————————————————

    EARNINGS |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

————-+—————————————————————-

           S |   2.638851   .3709533     7.11   0.000     1.907279    3.370423

         EXP |   .3737198   .2473859     1.51   0.132    -.1141602    .8615998

        MALE |   8.273226   1.949192     4.24   0.000     4.429143    12.11731

       _cons |  -26.48859   7.242666    -3.66   0.000    -40.77215   -12.20503

——————————————————————————

. log using “C:\Users\dell\Dropbox\jobs\Experiment5\Econometrics.smcl”

———————————————————————————————————————————————

      name:  <unnamed>

       log:  C:\Users\dell\Dropbox\Experiment5\Econometrics.smcl

  log type:  smcl

 opened on:  29 Jan 2019, 15:44:31

. twoway (scatter EARNINGS EXP)

. twoway (scatter EARNINGS S)

. twoway (scatter EARNINGS TENURE)

. regress EARNINGS S  EXP MALE

      Source |       SS       df       MS              Number of obs =     200

————-+——————————           F(  3,   196) =   25.78

       Model |  13467.6617     3  4489.22056           Prob > F      =  0.0000

    Residual |  34135.9337   196  174.162927           R-squared     =  0.2829

————-+——————————           Adj R-squared =  0.2719

       Total |  47603.5953   199  239.214047           Root MSE      =  13.197

——————————————————————————

    EARNINGS |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

————-+—————————————————————-

           S |   2.638851   .3709533     7.11   0.000     1.907279    3.370423

         EXP |   .3737198   .2473859     1.51   0.132    -.1141602    .8615998

        MALE |   8.273226   1.949192     4.24   0.000     4.429143    12.11731

       _cons |  -26.48859   7.242666    -3.66   0.000    -40.77215   -12.20503

——————————————————————————

. rvfplot

. swilk REGS

                   Shapiro-Wilk W test for normal data

    Variable |    Obs       W           V         z       Prob>z

————-+————————————————–

        REGS |    200    0.99205      1.186     0.393    0.34707

. predict resid, Residuals

option Residuals not allowed

r(198);

. predict resid, Resid

option Resid not allowed

r(198);

. predict resid, Res

option Res not allowed

r(198);

. hettest S EXP MALE

Breusch-Pagan / Cook-Weisberg test for heteroskedasticity

         Ho: Constant variance

         Variables: S EXP MALE

         chi2(3)      =    46.09

         Prob > chi2  =   0.0000

. regress LogEarnings S  EXP MALE

      Source |       SS       df       MS              Number of obs =     200

————-+——————————           F(  3,   196) =   51.07

       Model |  35.3984614     3  11.7994871           Prob > F      =  0.0000

    Residual |  45.2823054   196  .231032171           R-squared     =  0.4387

————-+——————————           Adj R-squared =  0.4302

       Total |  80.6807668   199  .405430989           Root MSE      =  .48066

——————————————————————————

 LogEarnings |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

————-+—————————————————————-

           S |   .1402813   .0135107    10.38   0.000     .1136363    .1669263

         EXP |   .0350012   .0090102     3.88   0.000     .0172319    .0527706

        MALE |    .341875   .0709926     4.82   0.000     .2018675    .4818824

       _cons |   .1064149   .2637891     0.40   0.687    -.4138144    .6266443

——————————————————————————

. regress LogEarnings S  EXP FEMALE

      Source |       SS       df       MS              Number of obs =     200

————-+——————————           F(  3,   196) =   51.07

       Model |  35.3984614     3  11.7994871           Prob > F      =  0.0000

    Residual |  45.2823054   196  .231032171           R-squared     =  0.4387

————-+——————————           Adj R-squared =  0.4302

       Total |  80.6807668   199  .405430989           Root MSE      =  .48066

——————————————————————————

 LogEarnings |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

————-+—————————————————————-

           S |   .1402813   .0135107    10.38   0.000     .1136363    .1669263

         EXP |   .0350012   .0090102     3.88   0.000     .0172319    .0527706

      FEMALE |   -.341875   .0709926    -4.82   0.000    -.4818824   -.2018675

       _cons |   .4482899    .280383     1.60   0.111    -.1046649    1.001245

——————————————————————————

.  ASVAB03

unrecognized command:  ASVAB03

r(199);

. use “C:\Users\dell\Desktop\CHRISTINE\Exercise2.dta”, clear

. twoway (tsline variable)

. ac variable

. twoway (tsline z)

. ac z

. tsset time

        time variable:  time, 1 to 111

                delta:  1 unit

. twoway (tsline z)

. dvariable = d.variable

unrecognized command:  dvariable

r(199);

. gen dvariable = d.variable

(1 missing value generated)

. twoway (tsline dvariable)

. ac dvariable

. twoway (tsline d.dvariable)

. ac d.dvariable

. arima d.dvariable time, arima(3,2,0)

note: D2.time dropped because of collinearity

(setting optimization to BHHH)

Iteration 0:   log likelihood = -604.36417 

Iteration 1:   log likelihood = -576.33622 

Iteration 2:   log likelihood = -545.47559 

Iteration 3:   log likelihood = -534.24595 

Iteration 4:   log likelihood = -517.03404 

(switching optimization to BFGS)

Iteration 5:   log likelihood = -508.97783 

Iteration 6:   log likelihood = -495.75782 

Iteration 7:   log likelihood = -488.90125 

Iteration 8:   log likelihood = -487.12916 

Iteration 9:   log likelihood = -485.15753 

Iteration 10:  log likelihood = -483.30611 

Iteration 11:  log likelihood = -483.18608 

Iteration 12:  log likelihood = -483.18251 

Iteration 13:  log likelihood = -483.18244 

Iteration 14:  log likelihood = -483.18243 

ARIMA regression

Sample:  5 – 111                                Number of obs      =       107

                                                Wald chi2(3)       =    578.14

Log likelihood = -483.1824                      Prob > chi2        =    0.0000

——————————————————————————

             |                 OPG

D3.dvariable |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

————-+—————————————————————-

dvariable    |

       _cons |   .0803223   .5956257     0.13   0.893    -1.087083    1.247727

————-+—————————————————————-

ARMA         |

          ar |

         L1. |  -1.573478   .0720765   -21.83   0.000    -1.714745    -1.43221

         L2. |  -1.292952   .1015338   -12.73   0.000    -1.491955    -1.09395

         L3. |  -.5498229   .0730351    -7.53   0.000     -.692969   -.4066768

————-+—————————————————————-

      /sigma |   21.82779   1.038335    21.02   0.000     19.79269    23.86288

——————————————————————————

Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. arima dvariable time, arima(3,2,0)

note: D2.time dropped because of collinearity

(setting optimization to BHHH)

Iteration 0:   log likelihood =  -494.4952 

Iteration 1:   log likelihood = -479.18552 

Iteration 2:   log likelihood = -473.62105 

Iteration 3:   log likelihood = -471.01932 

Iteration 4:   log likelihood = -468.10056 

(switching optimization to BFGS)

Iteration 5:   log likelihood = -467.94661 

Iteration 6:   log likelihood = -463.02373 

Iteration 7:   log likelihood = -457.17288 

Iteration 8:   log likelihood = -455.27644 

Iteration 9:   log likelihood = -454.45738 

Iteration 10:  log likelihood = -454.28194 

Iteration 11:  log likelihood = -454.27183 

Iteration 12:  log likelihood =  -454.2716 

Iteration 13:  log likelihood =  -454.2716 

ARIMA regression

Sample:  4 – 111                                Number of obs      =       108

                                                Wald chi2(3)       =    931.84

Log likelihood = -454.2716                      Prob > chi2        =    0.0000

——————————————————————————

             |                 OPG

D2.dvariable |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

————-+—————————————————————-

dvariable    |

       _cons |   .0798044   .5813969     0.14   0.891    -1.059713    1.219321

————-+—————————————————————-

ARMA         |

          ar |

         L1. |  -1.227382   .0518261   -23.68   0.000    -1.328959   -1.125804

         L2. |  -.8758729   .1036829    -8.45   0.000    -1.079088   -.6726581

         L3. |  -.3894012   .0953119    -4.09   0.000    -.5762092   -.2025933

————-+—————————————————————-

      /sigma |   16.10992    .642368    25.08   0.000      14.8509    17.36894

——————————————————————————

Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. arima d.dvariable time, arima(3,2,1)

note: D2.time dropped because of collinearity

(setting optimization to BHHH)

Iteration 0:   log likelihood = -512.10878 

Iteration 1:   log likelihood = -506.90462 

Iteration 2:   log likelihood =  -482.4457 

Iteration 3:   log likelihood = -464.29893 

Iteration 4:   log likelihood = -464.25877  (backed up)

(switching optimization to BFGS)

Iteration 5:   log likelihood = -462.13673 

Iteration 6:   log likelihood = -458.29143 

Iteration 7:   log likelihood = -456.83832 

Iteration 8:   log likelihood = -455.46375 

Iteration 9:   log likelihood = -454.44286 

Iteration 10:  log likelihood = -454.25128 

Iteration 11:  log likelihood = -454.18901 

Iteration 12:  log likelihood = -454.10725 

Iteration 13:  log likelihood = -454.10334 

Iteration 14:  log likelihood = -454.10021 

(switching optimization to BHHH)

Iteration 15:  log likelihood = -454.09988 

Iteration 16:  log likelihood = -454.09988  (backed up)

Iteration 17:  log likelihood = -454.09987  (backed up)

Iteration 18:  log likelihood = -454.09987  (backed up)

Iteration 19:  log likelihood = -454.09987  (backed up)

(switching optimization to BFGS)

Iteration 20:  log likelihood = -454.09987  (backed up)

Iteration 21:  log likelihood =  -454.0998 

Iteration 22:  log likelihood = -454.09977 

Iteration 23:  log likelihood = -454.09976 

ARIMA regression

Sample:  5 – 111                                Number of obs      =       107

                                                Wald chi2(4)       =   1335.98

Log likelihood = -454.0998                      Prob > chi2        =    0.0000

——————————————————————————

             |                 OPG

D3.dvariable |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

————-+—————————————————————-

dvariable    |

       _cons |   .0046315   .0140347     0.33   0.741    -.0228761     .032139

————-+—————————————————————-

ARMA         |

          ar |

         L1. |  -1.221487   .0527039   -23.18   0.000    -1.324784   -1.118189

         L2. |  -.8672662   .1048654    -8.27   0.000    -1.072799   -.6617337

         L3. |  -.3825357   .0942883    -4.06   0.000    -.5673374    -.197734

             |

          ma |

         L1. |         -1   .0793408   -12.60   0.000    -1.155505   -.8444951

————-+—————————————————————-

      /sigma |   16.17989          .        .       .            .           .

——————————————————————————

Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. arima dvariable time, arima(3,2,1)

note: D2.time dropped because of collinearity

(setting optimization to BHHH)

Iteration 0:   log likelihood =  -451.7533 

Iteration 1:   log likelihood = -447.88398 

Iteration 2:   log likelihood = -446.88608 

Iteration 3:   log likelihood = -445.10459 

Iteration 4:   log likelihood =  -444.5857 

(switching optimization to BFGS)

Iteration 5:   log likelihood = -444.41447 

Iteration 6:   log likelihood = -441.38757  (backed up)

Iteration 7:   log likelihood = -436.57411 

Iteration 8:   log likelihood = -433.19382 

Iteration 9:   log likelihood = -432.48895 

Iteration 10:  log likelihood = -431.47139 

Iteration 11:  log likelihood = -431.42239 

Iteration 12:  log likelihood = -431.39591 

Iteration 13:  log likelihood = -431.39124 

Iteration 14:  log likelihood = -431.38854 

(switching optimization to BHHH)

Iteration 15:  log likelihood = -431.38777 

Iteration 16:  log likelihood = -431.38777  (backed up)

Iteration 17:  log likelihood = -431.38777  (backed up)

Iteration 18:  log likelihood = -431.38777  (backed up)

Iteration 19:  log likelihood = -431.38777  (not concave)

(switching optimization to BFGS)

Iteration 20:  log likelihood = -431.38764 

Iteration 21:  log likelihood = -431.38754 

Iteration 22:  log likelihood = -431.38754 

Iteration 23:  log likelihood = -431.38751 

Iteration 24:  log likelihood =  -431.3875 

Iteration 25:  log likelihood =  -431.3875 

Iteration 26:  log likelihood = -431.38749 

ARIMA regression

Sample:  4 – 111                                Number of obs      =       108

                                                Wald chi2(4)       =    112.06

Log likelihood = -431.3875                      Prob > chi2        =    0.0000

——————————————————————————

             |                 OPG

D2.dvariable |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

————-+—————————————————————-

dvariable    |

       _cons |   -.000151   .0236076    -0.01   0.995     -.046421     .046119

————-+—————————————————————-

ARMA         |

          ar |

         L1. |  -.7428243   .0830595    -8.94   0.000    -.9056179   -.5800307

         L2. |   -.412752   .1040706    -3.97   0.000    -.6167266   -.2087774

         L3. |  -.2386445   .0937128    -2.55   0.011    -.4223182   -.0549708

             |

          ma |

         L1. |  -1.000014    169.442    -0.01   0.995    -333.1002    331.1002

————-+—————————————————————-

      /sigma |   12.71143   1077.085     0.01   0.495            0    2123.759

——————————————————————————

Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. pac z

. save “C:\Users\dell\Desktop\Exercise2.dta”, replace

file C:\Users\dell\Desktop\Exercise2.dta saved

Scroll to Top