UNIVERSITY OF CALIFORNIA, LOS ANGELES
Department of Economics

Economics 143 (Cameron) - Applied Regression Analysis

SHAZAM code [alaska0.sha]


If you are downloading this SHAZAM code for use on your own computer, select "File", then "Save As...", and save on your own computer using the filename alaska0.sha (instead of e143sh1.htm).

IMPORTANT: you must then use an editor 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 downloaded from UCLA Econ 143 (CAMERON) WebSite" should be the first line of your edited program file.


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

set nocolor
* observations run from 1964 through 1993

sample 1 30

* un-comment the following line to divert output to a file called alaska.out
*file 6 alaska.out

* read in the data from a separate file called "alaska.dat"
* note that a command that continues over more than one line requires the
*  use of a "&" at the end of the line to be continued
 
read(alaska.dat) year cprice kprice pprice rprice sprice  &
  cquant kquant pquant rquant squant &
  jprlint jpexch tuprice usincome wfarm
*----- VARIABLE DEFINITIONS ---------------------------------------
* cprice   = chum salmon real ex-vessel price, Alaska ($US, 1989)
* kprice   = king salmon real ex-vessel price, Alaska ($US, 1989)
* pprice   = pink salmon real ex-vessel price, Alaska ($US, 1989)
* rprice   = red salmon real ex-vessel price, Alaska ($US, 1989)
* sprice   = silver salmon real ex-vessel price, Alaska ($US, 1989)
* cquant   = chum salmon ex-vessel harvest, Alaska ('000 lbs)
* kquant   = king salmon ex-vessel harvest, Alaska ('000 lbs)
* pquant   = pink salmon ex-vessel harvest, Alaska ('000 lbs)
* rquant   = red salmon  ex-vessel harvest, Alaska ('000 lbs)
* squant   = silver salmon ex-vessel harvest, Alaska ('000 lbs)
* jprlint  = Japan, real interest rate
* jpexch   = Japan, real exchange rate in US dollars per yen
* tuprice  = real price of tuna ($US, 1989)
* usincome = US real per capita income, ($US 1989)
* wfarm    = world farmed salmon harvest ('000 lbs)
*------------------------------------------------------------------

* verify that these data look the way you expect them to look
* stat

* PREPROCESSING OF DATA

genr t=time(0)
genr year=time(1963)

* calculate total quantities (in '000 lbs) for main Alaskan salmon fisheries
genr qtot=cquant+kquant+pquant+rquant+squant
* express in billions of lbs?
genr qtotbil=qtot/1000000

* calculate total revenues from main Alaskan salmon fisheries
genr rtot=cprice*cquant + kprice*kquant + pprice*pquant + rprice*rquant &
           + sprice*squant

* calculate "average price" for main alaskan salmon fisheries
genr ptot=rtot/qtot

* look at data
* print year qtot rtot ptot

*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* NOW WE ARE READY FOR SOME STRAIGHT INTERACTIVE INPUT...........
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*






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

Update date: September 30, 1997
Prepared by: Trudy Ann Cameron