全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
9237 2
2010-10-26
proc glm data=msexam.fall08reg outstat=backwardr;
model P= G_G GA_G FA_5_5 SA_G PP;
run;
proc glm data=msexam.fall08reg outstat=backward;
model P= G_G GA_G;
run;

%macro ftest (dataset1, dataset2);
/* this macro is counting on the data sets being created by proc glm's outdata*/
data ftest;
set &dataset1 &dataset2;
if _source_= "ERROR";
sse0=lag(ss);
dfe0=lag(df);
drop _name_ _type_;
f= ((sse0-ss)/(dfe0-df))/(min(of ss, sse0)/min(of df,dfe0));
prob =1 - cdf('F',f,abs(dfe0-df),min(of df,dfe0));
if f='.' then delete;
run;
proc print data=ftest;
var f prob;
run;
%mend;
%ftest(backward, backwardr);

以上是俺写过的一个macro。是检验linear regression下full model和nested model的F-test(model selection)。
听讲9.2的proc reg可以检验lack-of-fit,毕竟能用得上9.2的只是少数人。所以今天抛砖引玉,放出这一F-test的code,来换取高手做lack-of-fit的code。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-10-27 04:10:35
1# Isscaliu
复制代码
Hi,
I am not worrying too much about lack of fit for my newest SAS version. That is just for my interest. It yields the matched results as from proc rsreg. On the other hand, I do believe you can compute it in a more direct way.
My question is, when no replicates in the data, there is obviously no pure error. How to deal with this for lack of fit test?
JingJu

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-10-27 16:46:30
厉害,受教了。对于你的问题,很乐意讨论。
Obviously, there is no pure error when there is no replicate observations available. The text book says we can conduct a approximate lack of fit by grouping similar vectors if there are the cases. However, in my point of view, this will be resulting loss of information in dealing with continuous data.  Another thing is, putting similar observations into pseudo-replicates are very subjective.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群