Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 11, 2024
1 parent 2e1d405 commit f3cf4b6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 12 deletions.
63 changes: 63 additions & 0 deletions tests/testthat/_snaps/printing2.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,69 @@
-----------------------------------------------------------------------------------------------------------------------------------
Observations | 150 | | 150 | | 150 |

---

Code
print(out, groups = list(Species = c("Species [versicolor]",
"Species [virginica]"), Interactions = c(
"Species [versicolor] * Petal Length", "Species [virginica] * Petal Length"),
Controls = "Petal Length"))
Output
Parameter | lm1 | lm2
-----------------------------------------------------------------------------------
Species | |
Species [versicolor] | -1.60 (-1.98, -1.22) | -1.69 (-2.80, -0.57)
Species [virginica] | -2.12 (-2.66, -1.58) | -1.19 (-2.37, -0.01)
Interactions | |
Species [versicolor] * Petal Length | | -0.01 (-0.56, 0.53)
Species [virginica] * Petal Length | | -0.15 (-0.69, 0.39)
Controls | |
Petal Length | 0.90 ( 0.78, 1.03) | 0.39 (-0.13, 0.90)
-----------------------------------------------------------------------------------
Observations | 150 | 150

---

Code
print(out, groups = list(Species = c("Species [versicolor]",
"Species [virginica]"), Interactions = c(
"Species [versicolor] * Petal Length", "Species [virginica] * Petal Length"),
Controls = "Petal Length"), select = "{estimate}{stars}")
Output
Parameter | lm1 | lm2
----------------------------------------------------------
Species | |
Species [versicolor] | -1.60*** | -1.69**
Species [virginica] | -2.12*** | -1.19 *
Interactions | |
Species [versicolor] * Petal Length | | -0.01
Species [virginica] * Petal Length | | -0.15
Controls | |
Petal Length | 0.90*** | 0.39
----------------------------------------------------------
Observations | 150 | 150

---

Code
print(out, groups = list(Species = c("Species [versicolor]",
"Species [virginica]"), Interactions = c(
"Species [versicolor] * Petal Length", "Species [virginica] * Petal Length"),
Controls = "Petal Length"), select = "{estimate}|{p}")
Output
Parameter | Estimate (lm1) | p (lm1) | Estimate (lm2) | p (lm2)
-------------------------------------------------------------------------------------------
Species | | | |
Species [versicolor] | -1.60 | <0.001 | -1.69 | 0.003
Species [virginica] | -2.12 | <0.001 | -1.19 | 0.048
Interactions | | | |
Species [versicolor] * Petal Length | | | -0.01 | 0.961
Species [virginica] * Petal Length | | | -0.15 | 0.574
Controls | | | |
Petal Length | 0.90 | <0.001 | 0.39 | 0.138
-------------------------------------------------------------------------------------------
Observations | 150 | | 150 |

# combination of different models

Code
Expand Down
24 changes: 12 additions & 12 deletions tests/testthat/test-printing2.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ withr::with_options(
expect_snapshot(
print(out, groups = list(
Species = c(
"Species (versicolor)",
"Species (virginica)"
"Species [versicolor]",
"Species [virginica]"
),
Interactions = c(
"Species (versicolor) * Petal Length",
"Species (virginica) * Petal Length"
"Species [versicolor] * Petal Length",
"Species [virginica] * Petal Length"
),
Controls = "Petal Length"
))
)
expect_snapshot(
print(out, groups = list(
Species = c(
"Species (versicolor)",
"Species (virginica)"
"Species [versicolor]",
"Species [virginica]"
),
Interactions = c(
"Species (versicolor) * Petal Length", # note the unicode char!
"Species (virginica) * Petal Length"
"Species [versicolor] * Petal Length", # note the unicode char!
"Species [virginica] * Petal Length"
),
Controls = "Petal Length"
), select = "{estimate}{stars}")
)
expect_snapshot(
print(out, groups = list(
Species = c(
"Species (versicolor)",
"Species (virginica)"
"Species [versicolor]",
"Species [virginica]"
),
Interactions = c(
"Species (versicolor) * Petal Length", # note the unicode char!
"Species (virginica) * Petal Length"
"Species [versicolor] * Petal Length", # note the unicode char!
"Species [virginica] * Petal Length"
),
Controls = "Petal Length"
), select = "{estimate}|{p}")
Expand Down

0 comments on commit f3cf4b6

Please sign in to comment.