UNIVERSITY OF CALIFORNIA, LOS ANGELES
Department of Economics

Economics 143 (Cameron) - Applied Regression Analysis

SHAZAM code [het2.sha]


If you are downloading this SHAZAM code for use on your own computer, select "File", then "Save As...", and save on your own diskette (a:) or your own hard drive (c:\) using the same filename e143sh15.sha.

IMPORTANT: you must then use an editor (like TED) to delete all of the HTML code from the top and the bottom of the file, leaving only the SHAZAM code. The line which reads "* SHAZAM code (e143sh15.sha) downloaded from UCLA Econ 143 (CAMERON) WebSite" should be the first line of your edited program file. Save the edited program as het2.sha



* SHAZAM code downloaded from UCLA Econ 143 (CAMERON) WebSite: 
* HTML file called e143sh15.htm, and should have 
*  been downloaded as het2.sha

file 6 het2.out
sample 1 52
* in this similar data set, experience or practice 
*  is measured in days, not rounded to weeks
read(het2.dat) days perfect

* check how many observations there are at any given number of days
plot perfect days
* see whether accuracy increases with number of days of practice
ols perfect days / resid=e
test days=0

* try to find some approximate relationship between error variance
* and the magnitude of the days variable...

genr e2=e*e
plot e2 days
ols e2 days

genr le2=log(e2)
plot le2 days
ols le2 days

* from the above, does significant heteroscedasticity appear to be present?

* create some weights that might do the job, approximately...
genr wda=days
genr wdb=days*days
genr wdc=1/days
genr wdd=1/(days*days)
* acknowledging heteroscedasticity, does accuracy increase with days
* of practice?
ols perfect days / weight=wda
test days=0
ols perfect days / weight=wdb
test days=0
ols perfect days / weight=wdc
test days=0
ols perfect days / weight=wdd
test days=0

* try some Goldfeld-Quandt tests
sort days perfect
ols perfect days 
test days=0
diagnos / het chowtest gqobs=5





COURSE OUTLINE LECTURE OUTLINES PROBLEM SETS PROBLEM SOLUTIONS
COMPUTER LABS SHAZAM EXAMPLES DATA SETS ONLINE QUIZZES

Updated: November 18, 1997
Prepared by: Trudy Ann Cameron