|
SCATTERName:
The SCATTER command is most often used after a GATHER command. That is, we use GATHER to extract specific rows of a variable, perform operations that modify these extracted values, and then use SCATTER to save these modfied values back in the original variable.
where <x> is a response variable; <index> is a variable containing row numbers; and <y> is a variable where the values of <x> will be saved.
let n = 30
let xseq = sequence 1 1 n
let x = normal rand numb for i = 1 1 n
let iindex = data 10 14 8 23 19
.
let y = -10 for i = 1 1 n
let y = scatter x iindex
set write decimals 3
print xseq x y iindex
The following output is generated.
1.000 -1.073 -10.000 10.000
2.000 0.573 -10.000 14.000
3.000 -0.873 -10.000 8.000
4.000 0.234 -10.000 23.000
5.000 -0.455 -10.000 19.000
6.000 -0.525 -10.000 0.000
7.000 -0.706 -10.000 0.000
8.000 0.032 -0.873 0.000
9.000 1.191 -10.000 0.000
10.000 0.270 -1.073 0.000
11.000 -0.149 -10.000 0.000
12.000 -0.197 -10.000 0.000
13.000 -0.243 -10.000 0.000
14.000 -0.841 0.573 0.000
15.000 -0.104 -10.000 0.000
16.000 0.419 -10.000 0.000
17.000 0.264 -10.000 0.000
18.000 0.898 -10.000 0.000
19.000 0.034 -0.455 0.000
20.000 1.588 -10.000 0.000
21.000 0.389 -10.000 0.000
22.000 -0.470 -10.000 0.000
23.000 -1.063 0.234 0.000
24.000 -0.027 -10.000 0.000
25.000 -0.464 -10.000 0.000
26.000 0.592 -10.000 0.000
27.000 -0.506 -10.000 0.000
28.000 -0.360 -10.000 0.000
29.000 0.499 -10.000 0.000
30.000 0.243 -10.000 0.000
Date created: 12/4/2008 |