由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS 问题求助,有包子
相关主题
在SAS里面如何进行数组操作?SAS程序一问
关于recode data的问题,多谢。如何把一个variable中missing 的observation 付上非missing observation 的value
觉得SAS array超难用如何有SAS处理这个DATA SET,谢谢!
help for sas programSAS问题请教, keep/drop
SAS数据输入疑问syntax errors
关于读数据紧急求助,包子答谢,谢谢了先[合集] 问一个SAS 从excel import数据的问题
SAS base 问题,有关读入raw data时input 中num型变量格式后不加点的sas一问
[合集] Thanks so much! Re: SAS 一问. please help关于在R中run SVM的问题
相关话题的讨论汇总
话题: variable1话题: sas话题: lag话题: use话题: array
进入Statistics版参与讨论
1 (共1页)
a*****b
发帖数: 2789
1
我有N多个observation,已经读入为sas data。如下
variable1
11
22
33
44



12
13
14



我现在想比较variable1的相邻observation之间的关系。比如obs3 继续向下比较(实际情况很复杂)。想用数组来做。不知道可不可以把variable1下面的
所有数据定义成数字型数组,比如variable1(i)代表第i个数,然后我在data里面做
循环?array好像是循环变量的,对变量值不好操作,而且我又不方便把variable1转成
n个新变量。
请问应该如何定义?需要用到的proc或者function是什么?谢谢
p********a
发帖数: 5352
2
看起来有点象股票里的BID,哈哈。你应该还有个时间变量啊,提供一点TIP
data tc;
set tc;
retain I1;
if pt>lag(pt) then I1=1; else if pt run;
o****o
发帖数: 8077
3
no need to use array, just take the whole data file as a big array, and use
random access method: point=i; you can control i freely

【在 a*****b 的大作中提到】
: 我有N多个observation,已经读入为sas data。如下
: variable1
: 11
: 22
: 33
: 44
: 。
: 。
: 。
: 12

a*****b
发帖数: 2789
4

use
~~~~~~~~how to do that, can you say that in more
detail?

【在 o****o 的大作中提到】
: no need to use array, just take the whole data file as a big array, and use
: random access method: point=i; you can control i freely

a*****b
发帖数: 2789
5
yes, lag may work. But i also need forward lag here.do you know what's the
function or option for FORWARD LAG?

【在 p********a 的大作中提到】
: 看起来有点象股票里的BID,哈哈。你应该还有个时间变量啊,提供一点TIP
: data tc;
: set tc;
: retain I1;
: if pt>lag(pt) then I1=1; else if pt: run;

o****o
发帖数: 8077
6
I need to know more details on the operations you want to do

【在 a*****b 的大作中提到】
: yes, lag may work. But i also need forward lag here.do you know what's the
: function or option for FORWARD LAG?

G**S
发帖数: 1108
7
agree

【在 o****o 的大作中提到】
: I need to know more details on the operations you want to do
g**r
发帖数: 425
8
One way is to read the dataset to IML, then you can treat your variable as a
vector and var[i] will just be your element.

【在 a*****b 的大作中提到】
: 我有N多个observation,已经读入为sas data。如下
: variable1
: 11
: 22
: 33
: 44
: 。
: 。
: 。
: 12

a*****b
发帖数: 2789
9
哦,我试试。好像很不错的样子,不过要新学IML的东西,捣鼓一下先

a

【在 g**r 的大作中提到】
: One way is to read the dataset to IML, then you can treat your variable as a
: vector and var[i] will just be your element.

1 (共1页)
进入Statistics版参与讨论
相关主题
关于在R中run SVM的问题SAS数据输入疑问
SAS help needed!关于读数据紧急求助,包子答谢,谢谢了先
急请教一个sas 问题SAS base 问题,有关读入raw data时input 中num型变量格式后不加点的
[合集] R问题 求助... 谢谢[合集] Thanks so much! Re: SAS 一问. please help
在SAS里面如何进行数组操作?SAS程序一问
关于recode data的问题,多谢。如何把一个variable中missing 的observation 付上非missing observation 的value
觉得SAS array超难用如何有SAS处理这个DATA SET,谢谢!
help for sas programSAS问题请教, keep/drop
相关话题的讨论汇总
话题: variable1话题: sas话题: lag话题: use话题: array