View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kwaldman@gmail.com is offline
external usenet poster
 
Posts: 2
Default Running code on a list of variables

Thanks - I guess I should be more clear on what exactly I'm working
with. We have patients who will accumulate a higher risk of developing
the disease based on how much time we've been observing them. So for
example, someone who's been in the clinic for 1 year will have less of
a chance of developing the disease than someone who's been in the
clinic for 2 years. The way I've worked this out is like this:

1. Create a counter to count the number of days elapsed between the
start and end date of your observation period
2. Input a daily enrollment rate
3. Input a daily probability of developing a disease

So then we calculate how many people will get the disease in the
observation period like this:

On the first day of observation, number of cases = 1 (number of days
enrolled) * daily probability of disease * number people enrolled

But on the second day of observation, number of cases = 2 * daily
probability of disease * number of people enrolled so that the
probability becomes cululative.

I've done this using a VB do loop, and I basically want to run this
calculation for each disease without having to make a formula for
each, replacing the daily probability of disease for each disease.

Thanks in advance for any help!