楼主: lemonxinran
8353 15

sas如何分组进行if语句的判断 [推广有奖]

11
lemonxinran 发表于 2013-1-24 20:56:42
ziyenano 发表于 2013-1-24 19:46
这样行不?
data ex;
input
您好,请教一个白痴的问题,你的程序中的group by 1,2的意思是不是就是select后面排序第一和第二的变量?谢谢啦!

12
webgu 发表于 2013-1-24 21:22:49
lemonxinran 发表于 2013-1-24 20:56
您好,请教一个白痴的问题,你的程序中的group by 1,2的意思是不是就是select后面排序第一和第二的变量? ...
是的。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

13
lemonxinran 发表于 2013-1-24 21:44:04
webgu 发表于 2013-1-24 21:22
是的。
谢谢呀!

14
bobguy 发表于 2013-1-25 09:54:19
You can leverage the SAS function intnx doing it easly. Here is an example.

data t1;
  do date='1jan2010'd to '1apr2010'd by 10;
     x+1;
     output;
  end;
run;

proc means data=t1 n mean;
class date;
var x;
format date yymm7.;
run;
proc sql;
  create table new as
  select intnx('month', date, 0,'b') format=yymm7. as newdate, count(x) as count, mean(x) as mx
  from t1
  group by 1;
  quit;

  proc print data=new;
  run;

15
Imasasor 发表于 2013-1-25 10:03:16
ziyenano 发表于 2013-1-24 19:46
这样行不?
data ex;
input
你可以去领学术勋章了....
欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;

16
ziyenano 发表于 2013-1-25 12:59:09
Imasasor 发表于 2013-1-25 10:03
你可以去领学术勋章了....
嗯?这个还可以自己领

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

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