Dear SAS users:
I hope to get some help for adding more data points in the data set.
My data file is like following:
ID TIME CONC. AGE WEIGHT
1 0 10 22 70
2 0 11 24 65
3 0 9 33 71
4 0 8 31 66
Every ID only has one CONC. at TIME=0. I'd like to add more TIME points eg. 0, 1, 2, 3, 4 ..to 100 for every ID. So the final format should look like:
ID TIME CONC. AGE WEIGHT
1 0 10 22 70
1 1 10 22 70
1 2 10 22 70
...
2 0 11 24 65
2 1 11 24 65
2 2 11 24 65
...
3 0 9 33 71
3 1 9 33 71
3 2 9 33 71
...
4 0 8 31 66
4 1 8 31 66
4 2 8 31 66
...
I was trying to use DO LOOP, change the TIME and use SET to merge the data. The code is listed below. But I have not succeeded. As then number in do loop increase, I get less and less observations in the data set. Thanks in advance.
filename datain
'E:\\pk.csv';
data fulldata;
infile datain DELIMITER=',';
input ID TIME CONC AGE WEIGHT;
if ID EQ _blank_ THEN delete;
drop _blank_;
run;
data pk1;
set fulldata;
run;
data pkn;
do i=1 to 100 ;
set pk1;
TIME=TIME+i;
end;
run;