有一组数据,自变量是q,l,分别是朝向和楼层,分别只能取2个值,0,1。还有因变量p,是价钱,问Using a model without an interaction term:
(1) Is there reasonable basis to suspect that houses which border the river differ in predicted sales
price from houses which border the mountains? If so, what is your best estimate of the dollar value
of this difference?
(2) Is there reasonable basis to suspect that houses which have 1 level differ in predicted sales price
from houses which have 2 levels? If so, what is your best estimate of the dollar value of this
difference?
(3) What is the predicted difference in sales price between 1-level houses bordering the river and 2-
level houses bordering the mountains? (For this question, a minimal amount of hand computation
may be involved.)
Using a model with an interaction term:
(4) Is there reasonable basis to suspect that houses which border the river differ in predicted sales
price from houses which border the mountains? If so, what is your best estimate of the dollar value
of this difference?
(5) Is there reasonable basis to suspect that houses which have 1 level differ in predicted sales price
from houses which have 2 levels? If so, what is your best estimate of the dollar value of this
difference?
(6) Is there reasonable basis to suspect that the answer to Question (4) differs depending on number of
levels? If so, what is your best estimate of the difference in differences?
(7) Is there reasonable basis to suspect that the answer to Question (5) differs depending on quadrant?
If so, what is your best estimate of the difference in differences?
(8) What is the predicted difference in sales price between 1-level houses bordering the river and 2-
level houses bordering the mountains? Can we be reasonably confident that this difference is
anything other than zero in the population?
我写的程序是
data lab5_data_Housing;
infile "D:\Documents\Dropbox\Books\lab\lab5.txt";
input price 1-4 quadrant $ 6 levels 8;
run;
proc glm data = lab5_data_Housing;
classes quadrant levels;
model price= quadrant levels/solution;
means quadrant levels ;
estimate "N, 1" intercept 1 quadrant 1 0 levels 1 0;
estimate "N, 2" intercept 1 quadrant 1 0 levels 0 1;
estimate "S, 1" intercept 1 quadrant 0 1 levels 1 0;
estimate "S, 2" intercept 1 quadrant 0 1 levels 0 1;
run;
proc glm data = lab5_data_Housing;
classes quadrant levels;
model price= quadrant levels quadrant*levels/solution;
means quadrant levels quadrant*levels;
estimate "N, 1" intercept 1 quadrant 1 0 levels 1 0 quadrant*levels 1 0 0 0;
estimate "N, 2" intercept 1 quadrant 1 0 levels 0 1 quadrant*levels 0 1 0 0;
estimate "S, 1" intercept 1 quadrant 0 1 levels 1 0 quadrant*levels 0 0 1 0;
estimate "S, 2" intercept 1 quadrant 0 1 levels 0 1 quadrant*levels 0 0 0 1;
run;
quit;
怎么做这道题?