|
|
|
|
|
|
時系列分析ソフトウェア
RATS |
|
3-6. RATS Basics: Hypothesis Testing
RATS includes several built-in hypothesis testing instructions. Its flexibility also allows you to implement many others. We'll look at a couple of simple examples, and show you how to program a more complex test.
Our Example Program
Here is our example program so far:
CALENDAR 1922
ALLOCATE 1941:1
OPEN DATA C:\RATS\FOODDATA.RAT
DATA(FORMAT=RATS) / FOODCONS PRRETAIL DISPINC FOODPROD PRFARM
TABLE
PRINT
SET TREND = T
SET AVGPRICES = (PRFARM+PRFARM{1})/2.0
LINREG FOODCONS
# CONSTANT PRRETAIL DISPINC TREND
LINREG FOODCONS
# CONSTANT PRRETAIL DISPINC{0 1}
Let's look at the second regression model, and test the hypothesis that both of the DISPINC variables (zero lag and one lag) can jointly be excluded from the regression (i.e. that both coefficients are zero). The easiest way to do that is to use the EXCLUDE instruction. After executing the second LINREG instruction above, we can do the following:
EXCLUDE
# DISPINC{0 1}
Which produces the following output:
Null Hypothesis : The Following Coefficients Are Zero
DISPINC Lag(s) 0 to 1
F(2,15)= 27.52708 with Significance Level 0.00000955
The null hypothesis is strongly rejected in this case.
Other Examples
RATS offers several other instructions, including TEST which tests specific coefficient values, and RESTRICT and MRESTRICT, which test general linear hypothesis.
The example below regresses Y on X1, X2, and X3, and tests the hypothesis that the coefficients on X1 and X2 sum to 1.0 (i.e. that 1.0*β1 + 1.0*β2 = 1.0, where β1 and β2 are the coefficients of X1 and X2, respectively):
LINREG Y
# X1 X2 X3
RESTRICT 1
# 1 2
# 1.0 1.0 1.0
The following code implements a somewhat more involved test for the presence of Autoregressive Conditional Heteroscedasticity. First, we do an OLS regression, and save the residuals in a series called RESIDS. Next, we regress the squared residuals on its lag. We then compute our test statistic, which is T times R-squared from the squared-residuals regression. Finally, we use the CDF instruction to compute the marginal significance level for the test statistic. CDF allows you to choose from F, t, chi-squared, or normal distributions. Here, we use the chi-squared distribution, with one degree of freedom.
LINREG Y / RESIDS
# CONSTANT X1 X2 X3 X4
SET RESSQR = RESIDS**2
LINREG(NOPRINT) RESSQR
# CONSTANT RESSQR{1}
COMPUTE TEST_STAT = %NOBS*%RSQUARED
CDF CHISQR TEST_STAT 1
Here's the output from the CDF instruction:
Chi-Squared(1)= 2.501825 with Significance Level 0.11371447
In this case, the significance level is slightly larger than 0.10, so we cannot reject the ARCH hypothesis at the 10% level.
|
|
|
←RATSのTopページに戻る |
|
|