|
|
楼主

楼主 |
发表于 2009-5-25 23:12:25
|
只看该作者
利用一列row1里数据求下面row的数 --- 也想求一名sas 高手, 以后可以随时回到出现的一些问题。合理付费!
请高手指导! 也想求一名sas 高手, 以后可以随时回到出现的一些问题。合理付费!
i have a time series data file that has about 3.5million observations. to give an example, the original data looks like this:
Column1: Column2: Column3:
x c1 t1
y c2 t2
. c3 t3
. c4 t4
in Column1, i have values X, Y, respectively in the first two rows. the rest of the rows in Column1 is empty. i want to use X and Y (values in the first two rows of Column1) to generate value for all the other rows in Column1, using the formula Column2 * (Column3 - lag2(column1)) + lag2(column1)
for example, to get the value for Column1, row 3, we want to take the lag2 value of the row, which is x, and do C3 *(t3-x)+x. for Column1, row 4, it should be C4 *(t4-y)+y
we want to finished data to be like this
Column1:
x
y
C3 *(t3-x)+x
C4 *(t4-y)+y
C3 *(t3-(C3 *(t3-x)+x))+(C3 *(t3-x)+x)
C4 *(t4-(C4 *(t4-y)+y))+(C4 *(t4-y)+y)
.
.
.
i have tried doing something like:
if row>2 thencolumn1 = lag2(Column1)
but it doesn't work.
Can you figure something out? Thanks! |
|