这里是 my data .数据的结构如下:id x1 x2 x3 y
.
我用过 proc mixed
分析它,但现在想确定回归系数,我不知道该怎么做。我只是一个初学者 sas
.从结果中我看到 x1
, x2
, x3
和 x1x2x3
是显着的影响,但如何确定系数 alpha, beta, gamma, delta, theta
:y = theta + alpha*x1 + beta*x2 + gamma*x3 + delta*x1*x2*x3
这是我的代码:
ods graphics on;
proc mixed data=test;
class x1 x2 x3;
model y = x1 | x2 | x3 / solution residual;
random id;
run;
ods graphics off;
编辑 1:这是表的一部分
Solutions for Fixed Effects
:自
x1
有两个级别,表中有两行。我得到了x1
的效果吗?通过将这两个值相加:-109.07
第一行和 0
第二,还是我应该做点别的?请注意,这是 2^k
设计。 x1
的效果应计算为 y
的平均值之间差异的一半当x1
高 (20) 和低 (10)。
最佳答案
根据您的型号,x1
, x2
, x3
应该被视为连续变量,那么您应该能够获得模型中的系数。
proc mixed data=test;
model y=x1 x2 x3 x1*x2*x3/ solution residual;
random id/s;
run;
但是,根据您的代码和
x1
的值, x2
和 x3
,最好将它们视为您所做的分类变量,那么您表中的估计实际上是任何两个级别之间的平均差异。下面的链接可以帮助您了解您的结果。http://support.sas.com/kb/38/384.html explanation of estimation of coefficients
关于sas - 如何在sas中混合proc计算回归系数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36531618/