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!
 A: 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.$
