How to test for confounds I found some interesting correlations in my data. I believe that it might be caused by a confounding variable. How do I test for a confounding variable.
Is it enough for a variable to correlate with both variables to call it a confound? 
I am unsure what is the best way to approach this. I have a lot of other variables that I can test for correlations with these two. I would like some ideas; I have some knowledge of statistics and probability, but I have not used it much recently. 
 A: First, you must know the temporal ordering of the variables in your dataset. It matters a lot whether your proposed "third variable" is measured before, between, or after your variables of interest. If the variable is measured before, it may be confounder, in which case controlling for it in regression (i.e., computing the partial correlation between your variables of interest) is sufficient to remove its (linear) confounding effect. If the variable is measured between, it may be a mediator, in which case controlling for it in any way (other than mediation analysis) will yield a biased association between your variables of interest; you should not control for the variable if it is a mediator. If the variable is measured after, it may be a collider (i.e., it is caused by both variables), in which case controlling for it will also bias the estimate of the association between the variables of interest. If you cannot determine which type of variable your "third variable" is, you can use graphical techniques to assess testable implications (i.e., using the DAGitty software).
If you have determined it is not a mediator or collider, there are a variety of way to control for the variable. You can stratify on it (i.e., create subclass of the variable and estimate the association within each subclass), include it in a (flexible) regression model of one of the variables of interest on the other, or you can perform matching or weighting.
