Data generation

Feb 13 2010 11:54 PM
Hello everybody

I need your help for generating a data in the following format into a text file
the first number in the first bracket denotes the patient and the second number in the first bracket denotes the day.....the number on the right side should be 1 or 100 for a patient on day 1(should be randomly assigned )..if a patient is assigned as 100 on day 1 then he should have 90 on the next day and 80 on the 3rd day and so on. If he is assigned 1 then for all days it is 1.
the number of patients and days should be changeable.....

(1,1) [100]
(1,2) [90]
(2,1) [1]
(2,2) [1]
(3,1) [100]
(3,2) [90]
(4,1) [100]
(4,2) [90]
(5,1) [1]
(5,2) [1]
(6,1) [1]
(6,2) [1]
(7,1) [100]
(7,2) [90]
(8,1) [1]
(8,2) [1]
(9,1) [1]
(9,2) [1]
(10,1)[100]
(10,2) [90] ]

thanks
Bharath

Answers (2)