Causality
Causality copied to clipboard
Add float() in Chapter 3.4 IN[16] and IN[17]
Dear Bruno,
as far as I can see, to get the results in Chapter 3.4 - Front Door Criterion in lines OUT[16] and OUT[17] you should add float() to the individual parameters. I altered the code like this:
for Z in ['Tar', 'No Tar']:
for Xl in ['Smokers', 'Non Smokers']:
Prob1 += float(Cancer.loc[Xl, Z]) * float(P_Smoking.loc[Xl]) * float(P_Tar_Smoking.loc[Z, X])
Which returned the correct number instead of NaN.
greetings, Philipp