楼主: chichi_shu
1871 2

[原创博文] 简单问题两个 [推广有奖]

  • 0关注
  • 1粉丝

初中生

76%

还不是VIP/贵宾

-

威望
0
论坛币
24 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
219 点
帖子
13
精华
0
在线时间
15 小时
注册时间
2009-4-9
最后登录
2014-4-16

楼主
chichi_shu 发表于 2009-11-22 12:08:32 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. data nonresp(where=(ranuni(5555)<.1));
  2. set acqmod.both(where=(respond^=1));
  3. run;
  4. data acqmod.model;
  5. set acqmod.both(where=(respond=1)) nonresps;
  6. if respond = 1 then smp_wgt = 1;
  7. else smp_wgt = 10;
  8. respond = (respond = 1);
  9. run;
  10. proc freq;
  11. weight smp_wgt;
  12. table respond activate /missing;
  13. run;
复制代码



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

谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:简单问题 ranuni Where Data HERE where

回帖推荐

jingju11 发表于2楼  查看完整内容

1# chichi_shu *That makes variable respond binary, i.e., either 1 when (old) respond =1 or 0 otherwise. 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 v ...

本帖被以下文库推荐

沙发
jingju11 发表于 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
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

藤椅
chichi_shu 发表于 2009-11-23 06:31:33
楼上老大太nice了!
谢谢!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 09:38