Closed behrman closed 2 years ago
Hi Bill, these definitions are quite common in the literature, and defining it this way makes some things easier. (See e.g. https://www.jmlr.org/papers/volume18/16-319/16-319.pdf) I would not want to change the default behavior but I can add an explanation and a parameter that you can use to turn this off?
Hi Johannes,
First, thanks for creating a very useful package. If the concepts of ancestors and descendants have different definitions, I think it would be helpful to add a parameter to these functions to let users choose the desired behavior. I agree that you would not want to change the default behavior, as that likely break others' code, but being able to choose the behavior would be helpful.
I just finished writing some dagitty examples using study questions from (Pearl, 2016) and would have welcomed that option.
Hi Bill,
Thanks, I added an option "proper" to the ancestors and descendants functions. With proper=TRUE, you will not get the node itself. See last commit
Hi Johannes,
Perfect! That's just what was needed. I've streamlined my code to use proper = TRUE
. Thanks for being so responsive.
By the way, my students love using dagitty.
The functions
ancestors()
anddescendants()
return the input variable.Created on 2022-04-06 by the reprex package (v2.0.1)
This does not follow the usual definitions; see, for example, (Pearl, 2016), p. 25.