Quantifying degrees of necessity and of sufficiency in cause‐effect relationships with dichotomous and survival outcomes