-1
$\begingroup$

There is a dataset/study that has two independent binary variables, and a continuous dependent variable.

Variable A    Variable B    Measurement C
1               1               32.4
0               1               29.1
1               0               15.8
1               1               25.9
...

The binary variables were manipulated by the researchers. This simple study was observing animal behavior, by varying two binary variables in their environment, and then taking a measurement (continuous / ratio).

1. A and B only occur during a time when this animal behavior (C) occurs, and thus can be measured. The behavior does not occur when A and B are absent.
2. A and B always occur together, but they are independent.
3. The animal behavior being measured (C), can't affect either A or B.

Is it valid to take this dataset and use logistic regression to:

  1. Independent variable is C; dependent variable is B.
  2. Independent variables are C and A; dependent variable is B.

I can write a null hypothesis that says the odd ratio is 1, and use the data.

Mathematically, you can do this, but is the causal inference biased?

$\endgroup$
7
  • $\begingroup$ It's really unclear what you're asking, and what you wrote in the title doesn't correspond to what you wrote in the question text. What is your research question, and what is the alternate way you are thinking of it? What does -> mean your title and text? Please make this question clearer and we will be able to help you better. $\endgroup$
    – Noah
    Commented Jul 16, 2020 at 1:52
  • $\begingroup$ Okay. Give me a minute to work on that. $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 1:53
  • $\begingroup$ @Noah - Updated. $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 1:59
  • $\begingroup$ If you construct a hypothesis from the collected data, and then test the hypothesis on the data (surprise! the data support the hypothesis!) that is clearly the wrong way forward. Why were the variables collected in the first place (what was that hypothesis)? Why isn't it being tested with the data. $\endgroup$
    – Michelle
    Commented Jul 16, 2020 at 2:17
  • $\begingroup$ @Michelle I think OP is using the word "result" to mean "outcome variable". They are asking whether it makes sense to regress experimental condition on the observed outcome. It's not about the sequence of hypothesis generation and data collection. $\endgroup$
    – Noah
    Commented Jul 16, 2020 at 2:34

2 Answers 2

0
$\begingroup$

You can do this, but it wouldn't tell you much. I could imagine you might be interested in predicting environmental conditions from animal behavior if it was cheap to observe the behavior and expensive to measure the environment (e.g., using a canary in a coal mine), in which case it might make sense to model the environmental condition using the animal behavior. You wouldn't know the baseline prevalence of the environmental conditions, however, so you wouldn't be able to predict its specific value from the measured behavior of animals in the wild, making the model close to useless.

In science, though, we are often interested in causal relationships, which are associations that have specific properties (temporal precedence, no confounding, etc.). The odds ratio for the relationship between the environmental condition and animal behavior is a measure of association that is free of confounding, but it doesn't represent the temporal precedence of the relationship. The animal's behavior does not cause changes in the environment (or if it does, that is not the relationship you are investigating), so the odds ratio has no causal interpretation and doesn't tell you anything about how the environment would change if you forced changes in an animal's behavior or how the animal's behavior would change if you forced changes in the environment (like you did in the experiment). So this odds ratio would tell you nothing of interest.

The causal parameter of interest is likely the difference in the means of the animal's behavior between the environmental conditions. This parameter has a causal interpretation because it can be identified as the typical change in the animal's behavior that occurs when the environment is intervened upon (i.e., changed by a force external to the animal). This parameter is useful for science because it helps explain animal behavior, which the odds ratio in the previous model does not.

Finally, the second regression, with A predicting B, makes no sense at all because A and B are independent if manipulated separately by the experimenter, so the coefficient on A tells you absolutely nothing. In fact, the coefficient will likely be spuriously nonzero due to collider bias and should not be interpreted (see Elwert & Winship, 2014, for an explanation of this).


One interesting tidbit is the finding that if two groups are normally distributed with the same variance, the parameters in the logistic regression model predicting group membership from the continuous variable can be directly computed from the means and variances, implying a specific mathematical connection between the difference in means and the odds ratio. This was described here in a very clean and clear derivation and is worth a look.

$\endgroup$
6
  • $\begingroup$ A and B are independent of each other, they both occur in nature in either state (here, 0 and 1), and they can't be affected by the animal being observed. I will read your references tomorrow morning. Thanks. (I've updated the post with this information.) $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 3:22
  • $\begingroup$ Also, the animal can be observed (measuring C) independently of A and B being manipulated, and the natural state of A and B can be noted when taking the measurement. $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 3:43
  • $\begingroup$ ... and, the researcher expected A to moderate B. $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 4:36
  • $\begingroup$ I read a lot of that article (Elwert). It's very good. I'm not convinced it's relevant. Here, the environment will always consist of one of the four states used in the study. In Elwert's simple example, beauty and/or talent leads to acting success. Turning that around and saying acting success without beauty means there's talent is biased. Intuitively, there could be other explanations, such as charisma or charm - so the weight assigned to talent could be overestimated. -- That is not the case here. There are no other alternatives. I'm updating the description with this information. $\endgroup$
    – user179810
    Commented Jul 16, 2020 at 17:05
  • 1
    $\begingroup$ $A$ and $B$ are independent in your experiment and cause $C$. Conditioning on $C$ to estimate the effect of $A$ on $B$, which is what you do when you include $C$ in a regression of $B$ on $A$, as in model 2, is the definition of conditioning on a collider, which is exactly what the article is about. $\endgroup$
    – Noah
    Commented Jul 17, 2020 at 1:58
-1
$\begingroup$

Great question. As A, B, C occur together or not at all, I don't think any of the bias categories are applicable.

Regarding logistic regression, if there is an interaction effect between A and B when predicting C, then the value of A would be useful in predicting B - when including C. Logistic regression relies on the linear separability of classes, so if there is no interaction effect, A won't be helpful in predicting B. (I'm not talking about any expansions beyond just using A, B, and C in a new logistic regression model. Whether there's a more effective modeling technique is a separate issue.)

Consider the following dataset, where there is an interaction effect (extreme) between A and B on C. C and A predict B.

A  B  C  
   
2  1  40  
2  0  20  
3  1  60  
3  0  30  
4  1  80  
4  0  40  
0  1  10  
...  ...  ...  
$\endgroup$
10
  • $\begingroup$ when you say "If there is no interaction effect, A won't be helpful, assuming A and B are independent (and they should be)." I don't agree. If you imagine a simple DAG with three nodes A, B, and C and two arrows starting at A and B, respectively, and both pointing to C, then A and B will be conditionally associated given C, even when (i) there is no marginal association between A and B and (i) and A and B do not have an interaction $\endgroup$
    – psboonstra
    Commented Jul 17, 2020 at 3:00
  • $\begingroup$ @psboonstra The context is logistic regression, which works with classes that are linearly separable. If A isn't affecting B's contribution to C, and B isn't effecting A's contribution to C, how is A (or B) providing information about B (or A), given C? -- I didn't consider other techniques, such as neural networks, which could be capable of finding non-linearly separable associations between the three variables. (I updated my answer to limit my statement to logistic regression.) $\endgroup$
    – user255758
    Commented Jul 17, 2020 at 15:11
  • $\begingroup$ I believe my comment still applies. I have in mind something like the DAG on page 8, equation (29) here. Matching notation, I am thinking that X and Z in that DAG respectively correspond to A and B in this example, and Y corresponds to C. Conditioning on C may induce correlation between A and B. $\endgroup$
    – psboonstra
    Commented Jul 17, 2020 at 15:44
  • 1
    $\begingroup$ a+b is defining an interaction. "if a=0 then rnorm(b)" , "if a=1 then rnorm(b+1)" . --- In my example dataset in my proposed answer, "if a=0 then b*10, elseif b=0 then a*10" elseif b=1 then a*20" . $\endgroup$
    – user255758
    Commented Jul 18, 2020 at 3:27
  • 1
    $\begingroup$ @psboonstra Your own reference defines your model as an interaction - "In statistics, an interaction ... describes a situation in which the effect of one causal variable on an outcome depends on the state of a second causal variable." As Jason said, if a=0 then c = rnorm(b); if a=1 then c = rnorm(b+1). It's more than an effect, 'a' defines how 'b' will be used. $\endgroup$
    – user252085
    Commented Jul 19, 2020 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.