Hello, Thank you for your response. I have further explained what I am looking for. When I simulate the counts dataset I want to account for the time factor in the dataset itself. I wanted to create a simulated dataset which will have simulated counts following poisson distribution accounting for the time factor (generally 5 years of follow-up). I want to use this simulated dataset further in PROC GENMOD. Like I have simulated independent variables with normal distribution, my question is how can we simulate the follow-up time in the dataset? This simulated dataset then can be used in PROC GENMOD. I further built the code as below. I simulated time with a mean of 5 years and a standard deviation of 1.2 years. While simulating counts, in the equation (ETA1) I have added the effect of time as logarithm of time. Can you kindly look into the program and let me know if the equation (ETA1) correct accounting for time factor? %let N = 500; %let nCont = 5; data SimPoiReg1; call streaminit(54321); array x[&nCont]; array beta[0:5] (1.0034 0.2115 -0.145 -0.0944 0.1097 -0.0999); do i = 1 to &N; x[1] = Rand("normal", 20, 1.5); x[2] = rand("normal", 15, 2); x[3] = rand("normal",10, 0.2); x[4] = rand("normal", 50, 2); x[5] = rand("normal", 100, 3); time = rand("normal", 5, 1.2); logt = log(time); eta = beta[0]; do j = 1 to &nCont; /*eta = eta + beta[j] * x[j];*/ eta1 = eta + beta2 * x1 + beta3 * x2 + beta4 * x3 + beta5 * x4 + beta6 * x5 + logt; end; lambda=exp(eta1); Y = rand("Poisson",lambda) ; output; end; run; Regards, Anita
... View more