This is more of a comment, in response to comments to Ed Rigdon's answer:
I understand that I shouldn’t control for B because it’s a collider. I want to know how the diagram looks when a variable is controlled for. Then I would be able to see everything explicitly
A good way to do this is by drawing the conditional graph by a process called graphical moralization. The steps are very simple (this is quoted almost verbatim from Greenland and Pearl, 2017) where I have just changed the variable names to match the ones in the question:
- If B is a collider, join (marry) all pairs of parents of B by undirected arcs (here, a dashed line will be used).
- Similarly, if A is an ancestor of B and a collider, join all pairs of parents of A by undirected arcs. [obviously this is not the case here]
- Erase B and all arcs connecting B to other variables.
So we arrive at the following graph:
Note that this is not a DAG because of the presence of the dashed line. To continue using DAG theory we must retain B and use the reasoning in Noah's answer where the backdoor path is shown as $X \leftarrow A \rightarrow \fbox B \leftarrow C \rightarrow Y$
Finally I often find it instructive to do simple simulation so here I simulate data according to the original DAG and show what happens when controlling for the collider:
> set.seed(15)
> N <- 100
> A <- rnorm(N, 10, 2)
> C <- rnorm(N, 5, 1)
> B <- A + C + rnorm(N)
> X <- A + B + rnorm(N)
> Y <- X + C + rnorm(N)
> m0 <- lm(Y ~ X)
> summary(m0)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.28681 0.87685 3.748 0.000301 ***
X 1.06439 0.03411 31.203 < 2e-16 ***
So we obtain good estimates for the effect of X. However:
> m1 <- lm(Y ~ X + B)
> summary(m1)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.82040 0.82263 3.429 0.000892 ***
X 0.68665 0.09811 6.999 3.36e-10 ***
B 0.66931 0.16452 4.068 9.65e-05 ***
Now we have a biased estimate for X