全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
7206 5
2009-06-23
我在做SAS 的时候
proc
ttest data= data06.ttest;
class dnum;
var se_vest2 ae_vest2;
run
;
这一步说我——
The CLASS variable has more than two levels
请问是什么意思啊?
二维码

扫码加我 拉你入群

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

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

全部回复
2009-6-23 02:28:38
clearbetty 发表于 2009-6-23 02:01
我在做SAS 的时候
proc
ttest data= data06.ttest;
class dnum;
var se_vest2 ae_vest2;
run
;
这一步说我——
The CLASS variable has more than two levels
请问是什么意思啊?
Clearly here, t test can only be performed on the 2-level factor; but dnum has more than 2 levels. You can go to proc glm or anova for a F test on the >2 level variable.
二维码

扫码加我 拉你入群

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

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

2009-6-23 06:31:02
2# jingju11
但是我限定的不是两个变量么? var 只设了两个啊?
二维码

扫码加我 拉你入群

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

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

2009-6-23 08:32:49
3# clearbetty

和变量个数无关。你的程序是在做two-sample independent t test.
whatever, you should read more about that.
二维码

扫码加我 拉你入群

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

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

2009-6-23 08:39:16
if x be the indicator for the group, for example, x=1 is the group of male and x=2 is the group of  female.
y be the height for each student in both group . now you want to compare the means of height for each group.
so if the student is independent to each other and height is rougly normally distributed. then you can test that like the following:

proc ttest data=YourData;
class x;
var y;
run;
*again here, x only has value of 1 and 2, called two-level; y is the variable you want to compare;
二维码

扫码加我 拉你入群

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

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

2015-10-23 09:28:29
看了看时间已经过去好几年了,挖个坟,因为我自己今天也遇到这个问题了
题目是 假说:“北方动物比南方动物具有较短的附肢。”为验证这一假说,调查了如下鸟翅长(mm)资料。北方的:120113125118116114119;南方的:116117121114116118123120。试验证这一假说。
我编的程序,开始是
data ttest_2;input temp long @@;
cards;
n 120 113 125 118 116 114 119
s 116 117 121 114 118 123 120
;
proc ttest;class temp;
var long;run;

然后就跳出来The CLASS variable has more than two levels
后来看了看书,发现  分组的符号貌似要用数字,每一个数据前面都要带上分组符号
我也不知道是不是因为这个,不过,后面程序运行成功了
修改后:
data ttest_2;input temp long @@;
cards;
1 120 1 113 1 125 1 118 1 116 1 114 1 119
2 116 2 117 2 121 2 114 2 118 2 123 2 120
;
proc ttest;class temp;
var long;run;


我刚刚开始接触SAS,才疏学浅,有什么不对的还请指正,可以加我扣扣号交流446974093


二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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