Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 13, 2024
1 parent 0d42eaa commit ded71b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 142 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.12.3
Version: 0.12.3.1
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# performance 0.12.4

## Changes

* Minor revisions to the printed output of `check_dag()`.

# performance 0.12.3

## New functions
Expand Down
145 changes: 4 additions & 141 deletions tests/testthat/_snaps/check_dag.md
Original file line number Diff line number Diff line change
@@ -1,136 +1,3 @@
# check_dag

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: y
- Exposure: x
Identification of direct and total effects
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `x` on `y`.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: y
- Exposure: x
- Adjustment: b
Identification of direct and total effects
Model is correctly specified.
All minimal sufficient adjustments to estimate the direct and total effect were done.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: y
- Exposure: x
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, at least adjust for `b`.
Currently, the model does not adjust for any variables.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: y
- Exposure: x
- Adjustment: c
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, at least adjust for `b` and `c`.
Currently, the model only adjusts for `c`.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: y
- Exposure: x
- Adjustment: c
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, at least adjust for `b` and `c`.
Currently, the model only adjusts for `c`.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: mpg
- Exposure: wt
- Adjustments: cyl, disp and gear
Identification of direct and total effects
Model is correctly specified.
All minimal sufficient adjustments to estimate the direct and total effect were done.

# check_dag, multiple adjustment sets

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: exam
- Exposure: podcast
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, at least adjust for one of the following sets:
- alertness, prepared
- alertness, skills_course
- mood, prepared
- mood, skills_course.
Currently, the model does not adjust for any variables.

---

Code
print(dag)
Output
# Check for correct adjustment sets
- Outcome: exam
- Exposure: podcast
- Adjustments: alertness and prepared
Identification of direct and total effects
Model is correctly specified.
All minimal sufficient adjustments to estimate the direct and total effect were done.

# check_dag, different adjustements for total and direct

Code
Expand All @@ -143,14 +10,12 @@
Identification of direct effects
Incorrectly adjusted!
To estimate the direct effect, at least adjust for `x1` and `x2`.
Currently, the model does not adjust for any variables.
To estimate the direct effect, at least adjust for `x1` and `x2`. Currently, the model does not adjust for any variables.
Identification of total effects
Incorrectly adjusted!
To estimate the total effect, at least adjust for `x1`.
Currently, the model does not adjust for any variables.
To estimate the total effect, at least adjust for `x1`. Currently, the model does not adjust for any variables.

---
Expand All @@ -166,8 +31,7 @@
Identification of direct effects
Incorrectly adjusted!
To estimate the direct effect, at least adjust for `x1` and `x2`.
Currently, the model only adjusts for `x1`.
To estimate the direct effect, at least adjust for `x1` and `x2`. Currently, the model only adjusts for `x1`. You possibly also need to adjust for `x2` to block biasing paths.
Identification of total effects
Expand All @@ -188,8 +52,7 @@
Identification of direct effects
Incorrectly adjusted!
To estimate the direct effect, at least adjust for `x1` and `x2`.
Currently, the model only adjusts for `x2`.
To estimate the direct effect, at least adjust for `x1` and `x2`. Currently, the model only adjusts for `x2`. You possibly also need to adjust for `x1` to block biasing paths.
Identification of total effects
Expand Down

0 comments on commit ded71b4

Please sign in to comment.