11.07.2015 Views

[U] User's Guide

[U] User's Guide

[U] User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

[ U ] 20.10 Accessing estimated coefficients 277We might now ask how the actual mileage of a Honda compares with the asif prediction:. list make asif mpg if strpos(make,"Honda")make asif mpg61. Honda Accord 26.52597 2562. Honda Civic 30.62202 28Notice the way we constructed our if clause to select Hondas. strpos() is the string function thatreturns the location in the first string where the second string is found or, if the second string doesnot occur in the first, zero. Thus any recorded make that contains the string “Honda” anywhere in itwould be listed; see [D] functions.We find that both Honda models yield slightly lower gas mileage than the asif domestic car–basedprediction. (We do not endorse this model as a complete model of the determinants of mileage, nordo we single out the Honda for any special scorn. In fact, please note that the observed values arewithin the root mean squared error of the average prediction.)We might wish to compare the overall average mpg and the asif prediction over all foreign carsin the data:. summarize mpg asif if foreignVariable Obs Mean Std. Dev. Min Maxmpg 22 24.77273 6.611187 14 41asif 22 26.67124 3.142912 19.70466 30.62202We find that, on average, foreign cars yield slightly lower mileage than our asif prediction. Thismight lead us to ask if any foreign cars do better than the asif prediction:. list make asif mpg if foreign & mpg>asif, sep(0)make asif mpg55. BMW 320i 24.31697 2557. Datsun 210 28.96818 3563. Mazda GLC 29.32015 3066. Subaru 28.85993 3568. Toyota Corolla 27.01144 3171. VW Diesel 28.90355 41We find six such automobiles.(Continued on next page)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!