-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50eed6d
commit 76e2aba
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ Imports: | |
utils | ||
Suggests: | ||
BH, | ||
betareg, | ||
brms, | ||
coda, | ||
collapse, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# estimate_means for betareg | ||
|
||
Code | ||
print(out, zap_small = TRUE) | ||
Output | ||
Estimated Marginal Means | ||
batch | Proportion | SE | 95% CI | z | ||
------------------------------------------------ | ||
1 | 0.31 | 0.01 | [0.29, 0.34] | 26.00 | ||
2 | 0.23 | 0.01 | [0.21, 0.26] | 16.76 | ||
3 | 0.28 | 0.01 | [0.25, 0.31] | 18.78 | ||
4 | 0.19 | 0.01 | [0.17, 0.21] | 19.96 | ||
5 | 0.20 | 0.01 | [0.18, 0.22] | 19.16 | ||
6 | 0.19 | 0.01 | [0.17, 0.21] | 17.83 | ||
7 | 0.12 | 0.01 | [0.11, 0.14] | 15.57 | ||
8 | 0.12 | 0.01 | [0.10, 0.13] | 14.56 | ||
9 | 0.11 | 0.01 | [0.09, 0.12] | 12.25 | ||
10 | 0.07 | 0.01 | [0.06, 0.09] | 12.78 | ||
Variable predicted: yield | ||
Predictors modulated: batch | ||
Predictors averaged: temp (3.3e+02) | ||
Predictions are on the response-scale. | ||
|
||
# estimate_relation for betareg | ||
|
||
Code | ||
print(out, zap_small = TRUE) | ||
Output | ||
Model-based Predictions | ||
batch | Predicted | 95% CI | ||
-------------------------------- | ||
1 | 0.31 | [0.28, 0.35] | ||
2 | 0.23 | [0.21, 0.25] | ||
3 | 0.28 | [0.25, 0.31] | ||
4 | 0.19 | [0.17, 0.21] | ||
5 | 0.20 | [0.18, 0.22] | ||
6 | 0.19 | [0.17, 0.21] | ||
7 | 0.12 | [0.11, 0.14] | ||
8 | 0.12 | [0.10, 0.13] | ||
9 | 0.11 | [0.09, 0.12] | ||
10 | 0.07 | [0.06, 0.09] | ||
Variable predicted: yield | ||
Predictors modulated: batch | ||
Predictors controlled: temp (3.3e+02) | ||
Predictions are on the response-scale. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
skip_on_cran() | ||
skip_if_offline() | ||
skip_if_not_installed("marginaleffects") | ||
skip_if_not_installed("betareg") | ||
|
||
test_that("estimate_means for betareg", { | ||
data("GasolineYield", package = "betareg") | ||
m1 <- betareg::betareg(yield ~ batch + temp, data = GasolineYield) | ||
out <- estimate_means(m1, "batch") | ||
expect_snapshot(print(out, zap_small = TRUE)) | ||
}) | ||
|
||
|
||
test_that("estimate_relation for betareg", { | ||
data("GasolineYield", package = "betareg") | ||
m1 <- betareg::betareg(yield ~ batch + temp, data = GasolineYield) | ||
out <- estimate_relation(m1, by = "batch", verbose = FALSE) | ||
expect_snapshot(print(out, zap_small = TRUE)) | ||
}) |