-------------------------------------------------------------------------------
help: alsmle                                                        dialog: als
> mle
-------------------------------------------------------------------------------

+-------+ ----+ Title +------------------------------------------------------------

alsmle: Beach-Mackinnon AR(1) Autoregressive Maximum Likelihood Estimation

+-------------------+ ----+ Table of Contents +------------------------------------------------

Syntax Options Description Saved Results References

*** Examples

Acknowledgment Author

+--------+ ----+ Syntax +-----------------------------------------------------------

alsmle depvar indepvars [if] [in] [weight] , [ noconstant diag mfx(lin, log) dn log tolog twostep iter(#) tolerance(#) predict(new_var) resid(new_var) level(#) vce(vcetype) ]

+---------+ ----+ Options +----------------------------------------------------------

options Description -------------------------------------------------------------------------

noconstant Exclude Constant Term from Equation dn Use (N) divisor instead of (N-K) for Degrees of Freedom (DF) log display iteration of Log Likelihood tolog Convert dependent and independent variables to LOG Form in the memory for Log-Log regression. tolog Transforms depvar and indepvars to Log Form without lost the original data variables iter(#) number of iterations; Default is iter(50) tolerance(#) tolerance for coefficient vector; Default is tol(0.00001) twostep Two-Step estimation, stop after first iteration, same as iter(1) predict(new_var) Predicted values variable resid(new_var) Residuals values variable level(#) confidence intervals level; Default is level(95) vce(vcetype) ols, robust, cluster, bootstrap, jackknife, hc2, hc3 mfx(lin, log) Type of functional form, either Linear model (lin), or Log-Log model (log), to compute Marginal Effects and Elasticities. - In Linear model marginal effects are the transformed coefficients (Bm), and elasticities are (Es=Bm X/Y).

- In Log-Log model the transformed coefficients are elasticities, and the marginal effects are (Bm =Es Y/X).

- Using mfx(log) requires tolog option, to trnsform variables to log form.

diag Model Selection Diagnostic Criteria: - Log Likelihood Function LLF - Akaike Final Prediction Error AIC - Schwartz Criterion SC - Akaike Information Criterion ln AIC - Schwarz Criterion ln SC - Amemiya Prediction Criterion FPE - Hannan-Quinn Criterion HQ - Rice Criterion Rice - Shibata Criterion Shibata - Craven-Wahba Generalized Cross Validation-GCV

+-------------+ ----+ Description +------------------------------------------------------

alsmle estimates Autoregressive Least Squares (ALS) via Maximum Likelihood Estimation (MLE), according to Beach-Mackinnon (1978) method for Autocorrelated Errors with first order AR(1). alsmle can also estimate weighted Autoregressive Maximum Likelihood Estimation weight, with or without constant term. alsmle can compute model selection diagnostic criteria, marginal effects, and elasticities.

+---------------+ ----+ Saved Results +----------------------------------------------------

Depending on the model estimated, alsmle saves the following results in e():

Scalars: e(N) number of observations e(r2c) R-squared e(r2c_a) Adjusted R-squared e(r2u) Raw Moments R-squared e(r2u_a) Raw Moments Adjusted R2 e(f) F-test e(fp) F-test P-Value e(wald) Wald-test e(waldp) Wald-test P-Value e(llf) Log Likelihood Function e(aic) Akaike Final Prediction Error AIC e(sc) Schwartz Criterion SC e(laic) Akaike Information Criterion ln AIC e(lsc) Schwarz Criterion Log SC e(fpe) Amemiya Prediction Criterion FPE e(hq) Hannan-Quinn Criterion HQ e(shibata) Shibata Criterion Shibata e(rice) Rice Criterion Rice e(gcv) Craven-Wahba Generalized Cross Validation-GCV

Matrixes: e(b) coefficient vector e(V) variance-covariance matrix of the estimators e(mfx) Beta and Marginal Effect

+------------+ ----+ References +-------------------------------------------------------

Beach, Charles & James G. Mackinnon (1978) "A Maximum Likelihood Procedure for Regression with Autocorrelated Errors", Econometrica, Vol. 46, No. 1, Jan.; 51-58.

Judge, Georege, R. Carter Hill, William . E. Griffiths, Helmut Lutkepohl, & Tsoung-Chao Lee (1988) "Introduction To The Theory And Practice Of Econometrics", 2nd ed., John Wiley & Sons, Inc., New York, USA.

Judge, Georege, W. E. Griffiths, R. Carter Hill, Helmut Lutkepohl, & Tsoung-Chao Lee(1985) "The Theory and Practice of Econometrics", 2nd ed., John Wiley & Sons, Inc., New York, USA.

+----------+ ----+ Examples +---------------------------------------------------------

clear all

sysuse alsmle.dta, clear

db alsmle

alsmle y x1 x2

alsmle y x1 x2 , iter(1)

alsmle y x1 x2 , twostep

alsmle y x1 x2 , iter(10)

alsmle y x1 x2 , noconstant

alsmle y x1 x2 , mfx(lin) log alsmle y x1 x2 [weight=x1]

alsmle y x1 x2 [aweight=x1]

alsmle y x1 x2 [iweight=x1]

alsmle y x1 x2 [pweight=x1]

alsmle y x1 x2 in 2/16 [weight=x1] , noconstant

alsmle y x1 x2 , mfx(lin) diag predict(Yh) resid(Ue)

alsmle y x1 x2 , mfx(log) diag tolog predict(Yh) resid(Ue)

alsmle y x1 x2 , mfx(log) log tolog

. clear all . sysuse alsmle.dta, clear . alsmle y x1 x2 , mfx(lin) diag log

============================================================================== * Beach-Mackinnon AR(1) Autoregressive Maximum Likelihood Estimation ============================================================================== Iteration Rho LLF SSE 0 0.000000 -51.6471 433.3130 1 -0.184911 -51.6645 419.9530 2 -0.197405 -51.4007 419.7750 3 -0.197972 -51.3972 419.7692 4 -0.197997 -51.3971 419.7691 ------------------------------------------------------------------------------ Number of Obs = 17 Wald Test = 457.1243 P-Value > Chi2(2) = 0.0000 F Test = 228.5621 P-Value > F(2 , 14) = 0.0000 R-squared = 0.9528 Raw Moments R2 = 0.9987 R-squared Adj = 0.9461 Raw Moments R2 Adj = 0.9985 Root MSE (Sigma) = 5.4757 Log Likelihood Function = -51.3971 Autoregressive Coefficient (Rho) Value = -0.1979982 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.065033 .2067004 5.15 0.000 .6217044 1.508361 x2 | -1.375032 .0643558 -21.37 0.000 -1.513061 -1.237002 _cons | 129.6105 20.87587 6.21 0.000 84.83621 174.3848 ------------------------------------------------------------------------------

============================================================================== * Model Selection Diagnostic Criteria ============================================================================== Log Likelihood Function LLF = -51.3971 Akaike Final Prediction Error AIC = 32.3009 Schwartz Criterion SC = 35.6275 Akaike Information Criterion ln AIC = 3.4751 Schwarz Criterion ln SC = 3.5731 Amemiya Prediction Criterion FPE = 34.6460 Hannan-Quinn Criterion HQ = 32.6171 Rice Criterion Rice = 33.3836 Shibata Criterion Shibata = 31.5353 Craven-Wahba Generalized Cross Validation GCV = 32.7901 ---------------------------------------------------------------

* Linear: Marginal Effect - Elasticity

+-----------------------------------------------------------------------------+ | Variable | Marginal_Effect(B) | Elasticity(Es) | Mean | |--------------+--------------------+--------------------+--------------------| | x1 | 1.0650 | 0.8154 | 102.9824 | | x2 | -1.3750 | -0.7801 | 76.3118 | +-----------------------------------------------------------------------------+ Mean of Dependent Variable = 134.5059

+----------------+ ----+ Acknowledgment +---------------------------------------------------

I would like to thank Professor James G. Mackinnon for sending to me his reference paper (1978)

+--------+ ----+ Author +-----------------------------------------------------------

Emad Abd Elmessih Shehata Assistant Professor Agricultural Research Center - Agricultural Economics Research Institute - Eg > ypt Email: emadstat@hotmail.com WebPage: http://emadstat.110mb.com/stata.htm WebPage at IDEAS: http://ideas.repec.org/f/psh494.html WebPage at EconPapers: http://econpapers.repec.org/RAS/psh494.htm

+-----------------+ ----+ alsmle Citation +--------------------------------------------------

Emad Abd Elmessih Shehata (2012) ALSMLE: "Stata Module to Estimate Beach-Mackinnon First Order AR(1) Autoregressive Maximum Likelihood Estimation"

Online Help:

Official: regress, prais.