在SAS中,有一种方法可以计算“典型相关性”仅使用过程在两个分类变量之间?
我的数据集中有两个 char 变量。我想计算两者之间的典型相关性。我的意思是我想从两个分类变量创建一些虚拟变量,并以这种方式计算规范相关性。在查看 proc cancorr 之后,如果不首先手动将分类变量转换为虚拟变量,我找不到一种方法来做到这一点。有没有办法做到这一点,而无需先手动将分类变量转换为虚拟变量?
I have two char variables in a dataset. I want to compute the canonical correlation between the two. By that I mean I want to create some dummy variables from the two categorical variables and compute the canonical correlation that way. After looking through proc cancorr I can not find a way to do this without first manually converting the categorical variables to dummy variables first. Is there a way to do that without manually converting the categorical variables to dummy variables first?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无需手动执行此操作。有一些 SAS 宏可以为您执行此操作。这是一个:
http://www.datavis.ca/sasmac/dummy.html
No need to do this manually. There are a few SAS macros which can do this for you. Here is one:
http://www.datavis.ca/sasmac/dummy.html
PROC GLMMOD 将为您创建一个设计矩阵,这本质上意味着创建虚拟变量。
PROC GLMMOD will create a design matrix for you, which essentially means creating the dummy variables.