1

我已经编写了 SAS 代码来比较两组的结果测量(即反应时间 - rt)。但是,我们想考虑人口统计指标(即智商)来测试 rt 中的组差异是否实际上是由组间的智商差异驱动的。我想帮助我修改我的代码。我现有的用于计算 rt 中基本组差异的代码如下。我已经包含了使用 t-test sas 函数和 glm sas 函数的代码,它们得到了相似的结果。

data sepdata  ;
infile "input.txt"  ;
     input subjid group IQ rt;
run;

title 'T-test group differences;
proc ttest;
        class group;
        var  rt;
run;

title 'Parallel glm code for group differences ';
proc glm;
 class group ;
 model  rt  = group ;
run;

我需要修改 t-test 函数或 glm 函数以在模型中包含“IQ”的帮助。

4

1 回答 1

0

To account for the effect of IQ on the response, include it as a predictor in your MODEL statement behind GROUP. The results associated with GROUP that come out of this updated model are then adjusted for IQ.

proc glm data = sepdata;
    class group;
    model rt = group iq;
run;
quit;

I think it would be reasonable in this case to consider IQ as continuous. I hope that helps!

于 2013-11-18T18:30:43.497 回答