* PS3.1, using data file DATA3-1, for various examples in Chapter 3 read(data3-1) price sqft * estimate model and save things ols price sqft / pcov resid=ut predict=phat1 print price phat1 ut * another way to get fitted value genr phat2 = price - ut print phat2 * retrieve number of obs. gen1 generates a single value. gen1 n = $n * retrieve ESS - Section 3.4 gen1 ESS = $SSE * compute st. dev. for price stat price / stdev=sdy * compute TSS - Example 3.4 gen1 TSS = (n-1)*sdy*sdy * compute RSS gen1 RSS = TSS - ESS * retrieve R-square gen1 RSQ = $r2 * print values print TSS ESS RSS RSQ * F-statistic in Example 3.6 gen1 Fc = RSS*(n-2)/ESS print Fc * plot price and phat against sqft plot price phat1 sqft * Reproduce predicted averages in Table 3.1 using only 3 decimals genr phat3 = 52.351+(0.139*sqft) print phat3 stop