Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapter 4 edits #312

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

chapter 4 edits #312

wants to merge 3 commits into from

Conversation

tgerke
Copy link
Collaborator

@tgerke tgerke commented Jan 16, 2025

Mostly minor edits

@tgerke
Copy link
Collaborator Author

tgerke commented Jan 16, 2025

We should time order Figure 4.3, especially since the text refers to the timing

@tgerke
Copy link
Collaborator Author

tgerke commented Jan 16, 2025

In the collider discussion, this isn't clear to me

Sometimes, people draw the path opened up by conditioning on a collider connecting x and y.

I haven't seen this, though I'm sure you're right that it happens. What I'm more familiar with is the box around the collider, which is read out as an open path. Do we want to mention that as well?

@tgerke
Copy link
Collaborator Author

tgerke commented Jan 16, 2025

In the callout box, we have

Here’s a condensed version of what ggdag_adjustment_set() is doing:

which removes arrows from the DAG. It's not exactly what ggdag_adjustment_set does, since that function grays out the adjusted edges (which is typically preferred). Suggest changing those line colors instead.

@tgerke
Copy link
Collaborator Author

tgerke commented Jan 16, 2025

In our next meeting, it would be great to talk about choice of adjustment method in the context of m-bias. I believe there are cases where IPW can be robust against this (certainly true that it can resolve selection bias) while direct/regression adjustment cannot. I think this has to do with the notion that weighting "removes arrows" while regression adjustment and/or stratification "draws boxes."

@malcolmbarrett malcolmbarrett self-requested a review January 16, 2025 13:37
@malcolmbarrett
Copy link
Collaborator

The job is failing because we need the dev version of tidysmd now, but I'll take care of that before merging

What I'm more familiar with is the box around the collider, which is read out as an open path. Do we want to mention that as well?

Maybe I'm not sure what you mean, but we already use and discuss the box notation. What did you have in mind?

We should time order Figure 4.3, especially since the text refers to the timing

I want it like this so people are forced to think about the structure and the arrows. In the workshop, though, we later show the time-ordered version, which we don't here. We should add that to the time-ordering section

It's not exactly what ggdag_adjustment_set does

Yes, it is. shadow = TRUE adds the greyed-out lines. We could mention that, but I don't want to get distracted by perfect replication here, though, as the point is about the geoms.

In our next meeting, it would be great to talk about choice of adjustment method in the context of m-bias. I believe there are cases where IPW can be robust against this (certainly true that it can resolve selection bias) while direct/regression adjustment cannot. I think this has to do with the notion that weighting "removes arrows" while regression adjustment and/or stratification "draws boxes."

I've thought this through already, and it can, but it's silly. You could use g-comp or IPW the same way you do for time-varying exposures/confounding, but it would require you to have the two unmeasured confounders, in which case you could just adjust for them through direct adjustment. So you can, but it's not that helpful.

labels = scales::label_percent()
) +
theme(
axis.title = element_blank()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your thinking here that it's clear from the axis what this is? It doesn't seem that way to me the way it can be obvious from other labels.

@@ -485,7 +486,7 @@ In the code above, we assume that:
- a graduate student's mood, sense of humor, and how prepared they feel for the exam could influence whether they listened to a podcast the morning of the test
- their mood and how prepared they are also influence their exam score

Notice we *do not* see podcast in the exam equation; this means that we assume that there is *no* causal relationship between podcast and the exam score.
Notice we *do not* see podcast in the exam equation; this means that we are constructing this DAG under the null assumption that there is *no* causal relationship between listening to the podcast and the exam score.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Notice we *do not* see podcast in the exam equation; this means that we are constructing this DAG under the null assumption that there is *no* causal relationship between listening to the podcast and the exam score.
Notice we *do not* see podcast in the exam equation; this means that we assume that there is *no* causal relationship between podcast and the exam score.
This is sometimes called a **null DAG**.

What if we separate these ideas and make it a little more explicit? We bring up null DAGs later, so it might be useful to emphasize

@malcolmbarrett malcolmbarrett marked this pull request as draft January 16, 2025 15:05
@malcolmbarrett
Copy link
Collaborator

malcolmbarrett commented Jan 16, 2025

Note to self: I was wrong about shadow = TRUE. It is now the default, per... checks notes... me r-causal/ggdag#135. So it would indeed be better to use color. It was not the default at the time that I wrote this chapter, so it needs to be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants