楼主: llulla
2573 7

help for caculate the total value for the variables using macro language [推广有奖]

  • 2关注
  • 7粉丝

VIP

已卖:361份资源

讲师

22%

还不是VIP/贵宾

-

威望
0
论坛币
22712 个
通用积分
12.9431
学术水平
118 点
热心指数
151 点
信用等级
81 点
经验
14269 点
帖子
473
精华
0
在线时间
317 小时
注册时间
2007-5-11
最后登录
2019-7-30

楼主
llulla 发表于 2008-6-20 23:07:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

There are 10 cases,  each case has 25 variables  from x1 to x25. The purpose is generate a new variable X, and

 X=x1+x2+... +x25 for each case.

Could any expertise of SAS macro language write a SAS code for me or give me a suggestions?

Thank you for your help.

二维码

扫码加我 拉你入群

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

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

关键词:Variables Variable Language caculate Using Using value Macro Language caculate

沙发
pywolf 发表于 2008-6-21 02:05:00

What do you mean by 10 cases? you have 10 different tables or you have a variable named 'case'?

if ur table looks as case, x1 -- x25 then all you need to do is in the data step

data new; set data old; x=x1+...+x25;

please tell me hows your data looks like...

best regards,

-=pywolf =- I am a Mathematician & a Statistician; and I have an imagery friend.

藤椅
llulla 发表于 2008-6-23 23:42:00

In my statement, the 10 cases mean the sample size is the 10.

Yes, your right. it can be done in the data step as you said. But I don't think it is smart way.It also can be done using the function of sum.

It is difficult to deal with it as your method. Becasue there are 25 variables. If there are more than 300 variables. It is more difficlut. I want to use a loop  to deal with it based on macro language. 

板凳
baiyaoqian 发表于 2016-10-31 13:42:27
llulla 发表于 2008-6-23 23:42
In my statement, the 10 cases mean the sample size is the 10. Yes, your right. it can be done in the ...
how did you solve this problem at last?

报纸
learsaas 发表于 2016-10-31 14:45:38
用个数组不就完事了,非得纠结于宏,嗨。。。。。。。。。。。。

地板
llulla 发表于 2016-11-1 01:02:04
Thanks for your response, although it is a 8 years post. All of us have been changed, including you and me !

7
learsaas 发表于 2016-11-1 09:05:32
把你的数据集贴部分出来,帮你写成宏

8
llulla 发表于 2016-11-3 14:38:41
谢谢你的热心。8年前的老帖子了,问题已解决了,课题已结束,文章都发表过了。以后有问题再请你帮忙。

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 08:14