I have a simple dataset consisting of the dates/times at which certain medications were taken by a patient. By looking retrospectively I'd like to make a best guess estimate as to which medication that same patient is most likely to be taking at any given date/time in the future.
Essentially I'm looking to base my estimate on the following factors:
- Time: medication is usually taken at fairly regulated intervals. If a certain medication is always taken at a specific time of day, and we're close to that time, increase the likelihood that that medication will be taken.
- Day: similar to time, certain medications may only be taken on certain days of the week. This should help determine the probability of a given medication being taken. However, it's worth nothing that this should not strictly exclude certain medications (i.e: don't exclude a medication simply because it's never been taken on a given day before).
I'm fairly green when it comes to statistical analysis and any kind of mathematics in general, but I'm posting here in the hopes that someone can point me in the right direction.
EDIT: I've made changes to my question to hopefully offer a bit more clarity at Xoque55's request
Your problem constraints sound appropriate for using a "Poisson Random Variable". A discrete random variable $X$ is said to have a "Poisson Distribution" with parameter $\lambda > 0 $ and $k \in \mathbb{N_0}$ if it has a probability mass function given by
$$f(k,\lambda) = \Pr(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}$$ The parameter $\lambda$ is equal to the expected value of $X$ and also the variance of $X$.
Without as much intro notation, your random variable $X$ is equal to the number of events that occur in a particular frame. Note how vague this definition is; both events and frames are specified by each problem. For example, you could measure the number of defective components (each defective component is 1 event) in a batch of a manufacturer's products (each batch is a frame).
Frames don't always have to be strictly spatially defined: time makes a good frame. You could let your random variable measure the number of people who enter a doorway in an office building (each entrance is an event) in an 8-minute span. Or you could measure the event of a car accident occurring in the frame of at a busy intersection everyday from 12:00 pm to 1:00 pm.
In your case (Time: events that have previously occurred close to the given time), you would likely want to calculate the number of time-units (hours, minutes, seconds, etc.) that a particular event occurs from a standard time of day or some other periodic measure - all using a Poisson random variable. In your other case (Day: events that have previously occurred on the relevant day of the week (although this should not strictly exclude events which have occurred around the given time)) a Poisson random variable might also be appropriate if you let you random variable measure the number of times an event occurs on a particular day of the week, regardless of the time of day.
I'm not sure if this is what you're looking for - mostly because your question is vague in terms of what you'll actually be measuring. I'm not saying Poisson is appropriate for every random variable - of course not! But if you clarify your problem statement or tell us exactly what you're measuring I would happy to suggest a more appropriate random variable - there are so many types of them!