# Sample stratification by dependent variable in linear regression analysis

I have a theoretical question that I would like some guidance on. Is it ok to stratify a sample population by the dependent variable? Does this bias regression results? For example, I'm doing an analysis on the impact of a overnight stay after surgery in the post-anesthesia care room on overall hospital length of stay. However, the decision to to hold patients overnight is not always random and could be influenced by different things (e.g. patients with very minor recovery requirements could be preferentially held, etc.). To alleviate some of this non-random decision bias, we thought to stratify our patient population by hospital length of stay (our dependent variable) so that we could separate the sickest patients from those who are not so sick. Is such a stratification by the dependent variable allowable? Any literature on this subject would be greatly appreciated!

• how would you do this stratification? Commented Mar 31, 2020 at 22:01
• effectively do 3 separate analyses on different sub-populations based on our strata limits (a,b): y < a, a <= y < b, y>=b Commented Mar 31, 2020 at 22:37

I would strongly encourage you to consider Judea Pearl's work on causality (check out his book The Book of Why to start), and its implications for confounding variables. In particular, the backdoor criterion can answer your question in a fairly straight-forward fashion. Here's how to do the analysis. The first thing you do is to determine the causal diagram. You need to figure out what your variables are, and the directions for the causation. Next, you need to figure out if the variable hospital-length-of-stay satisfies the backdoor criterion or not. That will lead you to determine if you need to stratify (condition) on it or not.

So here's one possibility. Let $$X$$ be the decision to stay overnight. Let $$Z$$ be the overall hospital length of stay. Let $$Y$$ be the patient outcome. Then you would likely have a causal diagram as follows (the arrow from $$X$$ to $$Z$$, for example, says that $$X$$ is a cause of $$Z.$$)

Assuming this is the correct diagram for your situation, the answer is simple: there are no backdoor paths from $$X$$ to $$Y$$, and therefore, if you want to find the total causal effect of $$X$$ on $$Y,$$ you should NOT condition on $$Z.$$

If, on the other hand, you have a diagram like this:

then the path $$X\leftarrow Z\to Y$$ is a backdoor path, and you would need to condition on $$Z$$ to block that back-door path in order to get the correct causal effect of $$X$$ on $$Y.$$

• thank you for the thought out answer, I really appreciate it. So in this analysis we are looking at the impact of an indicator for overnight status based on our specified criteria on length of stay (which would be our dependent variable) and we adjust for a confounding of expected length of stay. So based on the answer you have given, due to the backdoor criterion, stratifying by our dependent variable would be inappropriate. But stratifying by our confounding variable would be? Commented Mar 31, 2020 at 22:49
• Well, this diagram analysis tells you if a variable is confounding or not. What you need to do is to think carefully about what your variables are, and what the causal relationships are between them. You say, e.g., that expected length of stay is a confounding variable. Well, is it? Confounding is now well-defined by this backdoor criterion. In the two diagrams in my answer, $Z$ is not a confounding variable in the first diagram, but it is in the second. To move forward, then, you absolutely must list out your variables, and then tell me the causal relationships between them. Commented Apr 1, 2020 at 0:38
• I believe the causal relationship of my variables looks something like the bottom figure. My regression equation looks as thus: Y (length of stay) = X (indicator of interest) + Z (expectations). It is believed that the distribution of X is not random, and related to the severity of illness of the patient, which would be encompassed by the expectation (Z). As you said, in this situation, I would need to condition on Z to block the back-door path in order to get the correct causal effect of X on Y. Are there more ways to condition on Z other than stratifying the sample? i.e. add X:Z interaction? Commented Apr 2, 2020 at 14:23
• Well, there might be other methods, but stratifying (conditioning) on $Z$ is certainly the usual procedure. I don't know of any others. Commented Apr 2, 2020 at 14:26