全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1835 2
2009-11-22
复制代码



以上为什么在读完数据之后来一个“respond=(respond=1);"?这是赋值语句吗?这是要
让所有的respond都等于1吗?
后面那个weight,实在是不知道用力干什么的,察看了帮助还是很疑惑。有没有达人可
以告诉一下加了这个weight statement和不加有什么区别?

谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2009-11-22 22:58:14
1# chichi_shu
respond = (respond = 1);
*That makes variable respond binary, i.e., either 1 when (old) respond =1 or 0 otherwise.

weight smp_wgt;
Considering you use a WEIGHT statement of 'smp_wgt', PROC FREQ assumes that an observation represents smp_wgt observations , where smp_wgt is a number of either 1 or 10 here.  
If you do not specify a WEIGHT statement, each observation has a default weight of 1. The sum of the WEIGHT variable values represents the total number of observations.
For further illustrating this question, an example was following by:

obs reponse smp_wgt
1    1             10
2    0              1

in this case,
if specifying weight of smp_wgt, then total # of observations =1*10 +1*1 =11, % of (respond =1) =10/11;
if not specifying weight, then total # of observations =1*1 +1*1 =2, % of (respond =1) =1/2
二维码

扫码加我 拉你入群

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

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

2009-11-23 06:31:33
楼上老大太nice了!
谢谢!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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