# Calculate probability of disease appearance

I am a doctor so please be kind with me and my basic understanding of statistics.

I have a dataset consisting of patients and their visits and I have labelled the presence of a specific kind of mole in their left and/or right hand with {0,1} values (0 = not present and 1 = present). The dataset looks like this:

**I removed it since the answers are provided; I can send it upon new request

So, that means that patient A1-001 had 6 visits with no presence of mole in his right hand during all visits and present of mole in his left hand in all visits except the first one.

I am interested in finding the probability of a hand developing a mole among only the patients that developed a mole in one hand and finding the probability of developing a mole in the other hand (given that the patient had already a mole in the other hand).

Furthermore, I want to know what is the probability of developing a mole within visits among the patients that developed a mole at some point in both hands

Could you help me model these simple questions?

• "Furthermore, I want to know what is the probability of developing a mole in the same visit among the patients that developed a mole at some point in both hands." — But you're coding moles per hand as present or absent rather than counting the number of moles, so if a patient already has a mole on each hand, how would an additional mole be visible in the data? – Kodiologist Jun 15 '18 at 15:27
• @Kodiologist Yes, I am only interested in the presence and not the number of moles. If a patient has already a mole on each hand, then it is not possible to have an extra one: it is only possible to stay with this mole or the mole to disappear. – azal Jun 15 '18 at 15:34
• Providing the complete data set may clarify the question and assist with receiving an answer. – Todd D Jun 15 '18 at 17:44
• @Todd I don't get how providing the whole dataset will change the solution to the problem. I'm not a mathematician but I believe the problem is well-defined even with this sample size. I guess solving the problem for N = 3 (number of patients) will be the same as solving the problem for N = 100. – azal Jun 18 '18 at 14:47
• @laza, mathematics is not difficult for mathematicians. But you pose a problem that is not about mathematics and instead about trying to understand what you mean (that is why a larger data-set was asked)...... what do you mean by "I want to know what is the probability of developing a mole in the same visit among the patients that developed a mole at some point in both hands." ? You did not answer that question from Kodiologist, – Sextus Empiricus Jun 20 '18 at 14:42

I personally feel this lends itself well to a survival analysis.

You have people without moles in a certain hand at the start of the period (your at risk population); you can select these, and you have time points for follow-up and whether or not they were censored (developed a mole). This gives you a hazard for whatever cohort you've selected.

You can then calculate a hazard ratio (e.g. for developing a right-hand mole in people with a left-hand moles at baseline, versus those without). This could be expressed on a Kaplan-Meier graph and will come with a confidence interval.

• Hi @James, I think I will give a shot to this lifelines.readthedocs.io/en/latest/… What do you think? – azal Jun 22 '18 at 10:18
• I’m sure that’s fine. Whilst I love python I generally prefer R for stats, but this seems reasonably well supported. – James Jun 22 '18 at 10:41
• can you give me a hint or two wrt bringing the data to the correct format? – azal Jun 22 '18 at 12:32
• Like it says you need to know the time people were observed for and when they 'died' (ie got a mole) or the last time they were seen if they didn't get a mole. So for every patient, track the time from where you first saw them without a mole, to the time they got the mole or were last seen. That's the 'T' column in the example link. The 'E' column is whether they got a mole or not. You then need 1 row per patient. – James Jun 22 '18 at 12:43
• But what happens if the patient had a mole immediately on the first visit? And in another question, why do you think Markov chains are not suitable for this problem? It's a transition problem and from what I read, they seem very suitable to tackle these kind of problems. – azal Jun 22 '18 at 14:17

There is no modeling to be done here, all of your questions are simple conditional probabilities.

Alright, since people did not appreciate that answer, you need to clarify a couple of things.

I am interested in finding the probability of a hand developing a mole among only the patients that developed a mole in one hand and finding the probability of developing a mole in the other hand (given that the patient had already a mole in the other hand).

Do you mean per visit? Or that they never developed a mole ever? From your example:

Patients 1 and 3 developed a mole on one hand. Patient 1 never developed a mole on the other hand but patient 3 did, so you could argue the answer to your question is 50%. Now, you could also argue that patient 1 had 4 checkups with 1 mole and not on the other and patient 3 had 0 checkups with 1 mole and not the other so the probability could be 1/5 = 20%. It depends on how you define your question.

• Thank you for your reply. Can you help me even with that? I would really appreciate it. Some colleagues of mine, though, told me to use longitudinal modelling for the data or Bayesian statistics. These do not apply here I guess? – azal Jun 15 '18 at 15:21
• This post does not answer the question, because any statement about a probability is intrinsically a model. The important issue is "what model is it (or should it be)?" – whuber Jun 15 '18 at 15:45

Personally, I think you can start by studying the multicovariance generalized linear models: https://cran.r-project.org/web/packages/mcglm/index.html

http://cursos.leg.ufpr.br/mcglm4aed/slides/2-mcglm.html#(1)

Those models are apropriated for when you have more than one response variable and they're not gaussian, and this is your case, as you have two binary variables (mole or not mole in each hand). Also, the method lets you deal with intra-individual dependencies, which is given by the longitudinal structure. Here, longitudinal means repeated measures for the same individual, along the time.

I think the links above will help you to have a good idea about these techniques, and they also provide the computational implementation in R.