********************************************************************************; * * Hypothesis Testing and the Quadratic Regression Model * ********************************************************************************; # delimit ; clear; cap log close; ********************************************************************************; * * Specify the output file * ********************************************************************************; log using Quad.log,replace; set more off; ********************************************************************************; * * Read in and summarize the data * ********************************************************************************; use caschool.dta; describe; summarize testscr avginc; ********************************************************************************; * * Form quadratic income term * ********************************************************************************; gen inc2 = avginc^2; ********************************************************************************; * * Estimate the quadratic model * ********************************************************************************; reg testscr avginc inc2 ,r; test inc2; test avginc + 21*inc2=0; test avginc + 81*inc2=0; scalar Poor10 = _b[_cons] + 10*_b[avginc] + (10^2)*_b[inc2]; scalar Poor11 = _b[_cons] + 11*_b[avginc] + (11^2)*_b[inc2]; scalar Rich40 = _b[_cons] + 40*_b[avginc] + (40^2)*_b[inc2]; scalar Rich41 = _b[_cons] + 41*_b[avginc] + (41^2)*_b[inc2]; scalar DeltaP = _b[avginc] + (21)*_b[inc2]; scalar DelraR = _b[avginc] + (81)*_b[inc2]; scalar list; log close; *clear; *exit;