ECO 582A
Spring 09
Final
Name: _
Note: There are two parts. Part A contains some data related questions that you have to
use SAS to get the answers. Part B consists of a set of 5 general econometric questions
and questions involving interpreting SAS resul
data tmp1;
infile 'f:/smoke.txt';
input cigs income cigpric educ age restaurn;
run;
data tmp2;
set tmp1;
lincome=log(income);
lcigpric=log(cigpric);
agesq=age*age;
run;
/*Regress cigs on log(income), log(cigpric), educ, age, age2, and restaurn. Save
http:/www.technion.ac.il/docs/sas/ets/index.htm
1. Determine whether the following ones are linear or non-linear regression models and
give the reason why.
a)
y = a + b x + c x2 + d z + e
non-linear regression model,or polynomial model
linear regression m
data tmp1;
infile 'e:/rental.txt';
input rent pop avginc pctstu city year;
run;
data tmp2;
set tmp1;
if year= 90 then y90=1;
if year= 80 then y90=0;
run;
data tmp2;
set tmp2;
lrent=log(rent); lpop=log(pop); lavginc=log(avginc);
run;
proc reg;
mo
data stock1;
infile 'g:/sp500.txt';
input sp500;
date = intnx('month', '31dec1946'd, _n_);
format date monyy.;
run;
proc gplot data= stock;
plot sp500 * date= '+';
run;
data stock1;
set stock;
if date > '30jun91'd then delete;
run;
proc arima
data tmp1;
infile 'e:/lab11.txt';
input favwin spread favhome fav25 und25;
run;
data tmp2;
set tmp1;
if favwin=0 then delete;
run;
/*=(422/553)*/
/*Estimate a linear probability model by using only spread.
Test whether the constant term equals 0.5
data tmp1;
infile 'e:/lab10.txt';
input salary sales roe ros;
run;
data tmp2;
set tmp1;
if ros<0 then rosneg=1;
if ros>0 then rosneg=0;
run;
data tmp3;
set tmp2;
lsalary=log(salary);
lsales=log(sales);
run;
proc reg data=tmp4;
model lsalary= ls
data tmp1;
infile 'f:/lab9.txt';
input unem inf;
run;
/*2.Regress inf on unem using reg procedure. What is the coefficient of unem? Is it significant?*/
proc reg;
model inf=unem /dw dwprob;
output out=sample residual=e;
run;
data sample;
set sample;