* * Example from p. 587 * Linear Probability Model * open data table15-1.prn data(format=prn,org=columns) 1 40 * * Estimate Linear Probability Model. Compute the fitted values into yhat. * linreg y # constant x prj yhat * * The sample for the weighted regression will be those entries for which YHAT is * positive and less than one. Compute the variance series, which is * YHAT*(1-YHAT). (Weighted least squares are usually done in RATS by supplying * the variance, rather than actual weights). * set smpl = yhat>0.0.and.yhat<1.0 set v = %if(smpl,yhat*(1-yhat),0.0) * * Run the new regression, using the restricted sample and the heteroscedasticity * correction. * linreg(smpl=smpl,spread=v) y # constant x