# Which test to use to check if a possible confounder impacts a 0 / 1 result?

I've been given a task with the following question:

1. Investigate whether or not the type or treatment (0 or 1) has an impact on the result (0 or 1)
2. The same as 1), but keeping in mind another variable which is either 0,1 or 2 may be a confounder for the result.

How would I check whether or not it has an impact? For question one, I think I can use a chi-squared test, is this correct? And for question two, I'm not sure how to include the confounder in the test.

-
As per our FAQ, we don't provide direct answers to homework problems (at least not for a period of time), so that you can learn by working it out yourself. Here's a hint: what kind of model can handle a response variable (ie the result) that is 0 or 1? Would this model allow you to statistically control for a possible confounder? –  gung Aug 19 '12 at 19:22
I'm not sure... Is my assumption of using the chi-squared test correct? I think I can also use the McNemar test, is this correct? Edit: actually, can I use the Cochran Q test to include the confounders? –  Sirzh Aug 19 '12 at 20:32
One thing I can tell you is that the chi-squared test can be used when the data can be assumed to be independent, & that McNemar's test can be used when the data are dependent. –  gung Aug 19 '12 at 20:37