O(∩_∩)O~! 发表于 2010-9-17 15:11
下面的内容是在sas help里看到的,有些地方不太明白,请高手帮忙解释下,多谢!1 design matrix 指的是什么样的矩阵?
2 函数运行后的结果怎么来理解?
The DESIGNF FunctionThe DESIGNF function generates a full-rank design matrix, useful in calculating ANOVA tables. It has the general form
DESIGNF( column-vector );
For example, the following statement creates a full-rank design matrix for a one-way ANOVA, where the treatment factor has three levels and there are n1=3, n2=2, and n3=2 observations at the factor levels:
> d=designf({1,1,1,2,2,3,3});
D 7 rows 2 cols (numeric)
1 0
1 0
1 0
0 1
0 1
-1 -1
-1 -1
http://en.wikipedia.org/wiki/Design_matrix
The corresponding function in SAS for the example in the weblink is
proc iml;
d=design({1,1,1,2,2,3,3});
print d;
quit;
Since the intercept column will be a linear combination of other columns(note the moments will not be a full rank.). Usually SAS use the last level as a reference level. This setting sometime is called GLM setting. A design matrix can be set in many difference way. But all regression results should be equivelent. The explaination will be defferent in term of its design matrix.



雷达卡



京公网安备 11010802022788号







