Calculate conditional probability from a dataset

Laurence

New member
Joined
Jun 20, 2021
Messages
1
Say I have a table of data with four columns labelled A, B, C, D, where each entry is either a 0 or 1, how do I calculate P(D=1|A=1,B=1,C=1) directly from the data? Here, event D Is dependent upon events A, B, C. Can I apply the conditional probability formula P(D|A,B,C)=P(A,B,C,D)/P(A,B,C)? Also, to calculate the joint probability P(A=1,B=1,C=1) directly from the data, do I just count number of rows with A=1, B=1and C=1, divided by total number of rows? Here, events A, B, C, D are not independent. Thanks, any help is greatly appreciated!
 
To calculate P(D|A,B,C) ignore all entries except those where A= B= C= 1. P(D|A, B, D) is the number of those in which D= 1 also divided that by the total number of entries where A= B= C= 1.

Yes, P(A, B, C) is the number of entries in which A= B= C= 1 divided by the total number of entries.
 
Top