Stata 15 help for _crcar1

Title

[P] _crcar1 -- Programmer's utility for computing AR(1) rho from residuals

Syntax

_crcar1 rho_scalar method_macro : resids_varname [, k(#) check dw freg nagar regress theil tscorr ]

_crcar1 is for use with time-series data. You must tsset your data before using _crcar1; see [TS] tsset.

Description

_crcar1 is a programmer support command. It computes the first-order autocorrelation parameter for a variable (presumably containing residuals) using any of several estimates of the autocorrelation.

_crcar1 expects the first argument to be the name of a scalar into which the value of rho is saved and the second argument to be the name of a local macro which will be set to the fully expanded name of the method for computing rho.

Options

check specifies that rho is not computed, but that the command is simply checked for syntax and an error reported if the syntax is not proper.

k(#) specifies the number of parameters estimated in the model. This is only required for the theil and nagar options which use k to adjust the degrees of freedom.

The remaining options specify how rho is to be computed; regress is the default.

regress rho_reg = B from the residual regression e_t = B * e_(t-1).

freg rho_freg = B from the residual regression e_t = B * e_(t+1).

tscorr rho_tscorr = e'e_(t-1)/e'e, where e is the vector of residuals.

dw rho_dw = 1 - DW / 2.

theil rho_theil = rho_tscorr * (N - k) / N.

nagar rho_nagar = (rho_dw * N^2 + k^2) / (N^2 - k^2).

Examples

. _crcar1 rho fullopt : my_res

. _crcar1 rho fullopt : my_res, theil k(3)


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index