Factor out effect of a factor I have test scores, homework scores and extra credit scores for 50 so students. There is a significant positive correlation between extra credit and exam scores. There is also a significant positive correlation between homework scores and exam scores.
I want to figure out, roughly speaking, whether the students who didn't do much extra credit (I give weekly EC assignments) did as well on exams as the students with similar HW scores who did do the EC assignments.
I suppose I could simply divide the students into two groups based on the median EC score and simply look at the two HW vs exam graphs, but I'm hoping there's a better way to do this sort of analysis.
 A: It sounds like the first, most basic analysis would be to regress exam scores on homework scores and extra credit. That is, estimate all the $\beta$s in the regression equation:
$$ y_i = \beta_0 + \beta_{\text{ec}} x_{i,\text{ec}} + \beta_\text{h} x_{i,\text{h}} + \epsilon_i  $$
where $y_i$ is individual $i$'s homework score, $x_{i,ec}$ is individual $i$'s extra credit, etc... This estimates a linear, conditional expectations function for exam scores conditional on homework and extra credit. $\beta_\text{ec}$ would be your variable of interest. Controlling for homework scores, does higher extra credit forecast higher exam scores?
Estimating a conditional expectations function of course won't tell you the causal structure. For example, if $\beta_{\text{ec}}$ were positive at a statistically significant level, you wouldn't be able to distinguish between:


*

*Doing extra credit causes students to learn more and do better on exams. (i.e.doing extra credit causes higher exam scores)

*Highly motivated students do better on exams and also choose to do more extra credit. (i.e. an omitted variable, motivation, causes both extra credit and high exam scores)

