全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
11065 5
2010-11-29
请教如何在SAS中进行LRT检验,在MIXED中么?是哪个选项阿?
先谢谢了
二维码

扫码加我 拉你入群

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

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

全部回复
2010-11-29 16:31:24
是在mixed model,

eg.proc mixed method=reml;
二维码

扫码加我 拉你入群

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

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

2010-11-29 16:50:19
我的代码是这样的
DATA SPLIT;
  INPUT BLOCK A B Y @@;
  DATALINES;
  1 1 1 56  1 1 2 41
  1 2 1 50  1 2 2 36
  1 3 1 39  1 3 2 35
  2 1 1 30  2 1 2 25
  2 2 1 36  2 2 2 28
  3 1 1 32  3 1 2 24
  3 2 1 31  3 2 2 27
  3 3 1 15  3 3 2 19
  4 1 1 30  4 1 2 25
  4 2 1 35  4 2 2 30
  4 3 1 17  4 3 2 18
  ;
PROC MIXED METHOD=REML;
   CLASS A B BLOCK;
   MODEL Y=A B A*BLOCK;
   RANDOM BLOCK A*BLOCK;
RUN;
执行结果中没有列出Model Fitting Information for Y,这一结果,不明白为什么,请教大虾。
结果中并没有列出LRT的结果啊 ?
二维码

扫码加我 拉你入群

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

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

2010-12-1 07:47:41
shfujim 发表于 2010-11-29 16:50
我的代码是这样的
DATA SPLIT;
  INPUT BLOCK A B Y @@;
  DATALINES;
  1 1 1 56  1 1 2 41
  1 2 1 50  1 2 2 36
  1 3 1 39  1 3 2 35
  2 1 1 30  2 1 2 25
  2 2 1 36  2 2 2 28
  3 1 1 32  3 1 2 24
  3 2 1 31  3 2 2 27
  3 3 1 15  3 3 2 19
  4 1 1 30  4 1 2 25
  4 2 1 35  4 2 2 30
  4 3 1 17  4 3 2 18
  ;
PROC MIXED METHOD=REML;
   CLASS A B BLOCK;
   MODEL Y=A B A*BLOCK;
   RANDOM BLOCK A*BLOCK;
RUN;
执行结果中没有列出Model Fitting Information for Y,这一结果,不明白为什么,请教大虾。
结果中并没有列出LRT的结果啊 ?
Add solution in the model statement as

MODEL Y=A B A*BLOCK/solution;

Hope this helps.
二维码

扫码加我 拉你入群

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

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

2010-12-10 12:10:15
/solution选项好像不能打印出LRT吧,这个是打印出截距和自变量的系数的吧。我的是SAS8.2 版本的,这个是不是和版本也有关系的阿? 4# bobguy
我的目的是打印出和附件里面的图的效果,最后三行的检验结果如何打印呢?前面的几项都打印出来了的。
附件列表
未命名.JPG

原图尺寸 55.66 KB

未命名.JPG

二维码

扫码加我 拉你入群

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

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

2010-12-10 14:57:12
自己搞明白了,如果有大虾有不同意见,请指正。我主要参考
http://support.sas.com/kb/24/447.html#ex4
Constructing a Likelihood Ratio Test
Note that the two models above are considered nested because the main-effects model is just the saturated model with several parameters (the interaction parameters) set to zero. You can compare two nested models by computing a likelihood ratio (LR) test statistic, which is twice the ratio of the models' likelihood values, or equivalently and more conveniently, twice the difference in their log likelihood values. For these models, twice the difference in their log likelihoods is 8.228. The LR statistic is chi-square distributed with degrees of freedom (DF) equal to the number of parameters being tested—seven in this case, because there are seven DF that are associated with the four interactions. To get a p-value for the LR statistic, use the PROBCHI function in the DATA step. The following statements produce a p-value for the LR test comparing the main-effects and saturated models:

data lrt;
   lr=2*(-682.2478 - -686.3618);
   df=7;
   p=1-probchi(lr,df);
   run;
proc print noobs;
   format p pvalue.;
   run;
The null hypothesis being tested is that the saturated and main-effects models are equivalent. For this to be true in this example, the interaction parameters must all be zero. So, the null hypothesis can be stated generally as model equivalency, or in this example it can be stated as lack of interaction. The results show that the null hypothesis cannot be rejected (p=.3129).
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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