* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapter 3 Interval Estimation and Hypothesis Testing * After model estimation with the OLS command the CONFID command * and TEST command can be used for Interval Estimation and * Hypothesis Testing SAMPLE 1 40 READ (food.dat) / names * Estimation of the food expenditure function. OLS FOOD INCOME * Calculate a 95% confidence interval estimate for the * slope parameter (p. 98) CONFID INCOME / TCRIT=2.024 * Test the null hypothesis H0: beta_2 = 5.5 (p. 107) TEST INCOME=5.5 * Test the null hypothesis H0: beta_2 = 15 (p. 108) TEST INCOME=15 * Test the null hypothesis H0: beta_2 = 7.5 (p. 108; p-value p. 112) TEST INCOME=7.5 * Note: The TEST command reports a test statistic and * p-value for a 2-sided test. This p-value can be transformed * to a p-value for a one-sided test. * --------------------------------------------------------------- * The calculation of a p-value for a Right-Tail test. OLS FOOD INCOME * Test H0: beta_2 = 5.5 against H1: beta_2 > 5.5 TEST INCOME=5.5 * The degrees of freedom and t-test statistic are saved in the * temporary variables \$DF and \$T. GEN1 DF=\$DF GEN1 TSTAT=\$T * The DISTRIB / TYPE=T command calculates t-distribution probabilities. DISTRIB TSTAT / TYPE=T DF=DF GEN1 PVALUE=1-\$CDF * List the p-value (p. 111) PRINT TSTAT PVALUE * The calculation of a p-value for a Left-Tail test. OLS FOOD INCOME * Test H0: beta_2 = 15 against H1: beta_2 < 15 TEST INCOME=15 GEN1 DF=\$DF GEN1 TSTAT=\$T DISTRIB TSTAT / TYPE=T DF=DF * The p-value is now the area under the probability density * function to the LEFT of the calculated test statistic. GEN1 PVALUE=\$CDF * List the p-value (p. 112) PRINT TSTAT PVALUE STOP