I am given a sample with n = 100 of patients with risk factor information for all of them (binary variable, yes/no) and the disease status (also binary). I have to find the association between each individual risk factor and the disease and supply the result as a p-value and $\chi^2$ value.
I thought I would make a 2×2 contigency table for each risk factor, where one variable was presence of disease and the other the presence of a risk factor. After that I simply used the formula $\chi^2 = \sum{\frac{(O - E)^2}{E}}$ and obtained the $\chi^2$ and p values. Is this a correct or wrong way to do this? If not then how should I have done it?
self-study
tag and read its wiki. To answer your other question, if you are tasked with bivariate analysis of the association between your outcome and the risk factor variables, then your approach is correct $\endgroup$