@@ -4,7 +4,7 @@ iris$Cat2 <- rep_len(c("A", "B"), nrow(iris))
44# aov ----------------------------------
55
66test_that(" model_parameters.aov" , {
7- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
7+ skip_if_not_installed(" effectsize" )
88
99 model <- aov(Sepal.Width ~ Species , data = iris )
1010 mp <- suppressMessages(model_parameters(
@@ -20,26 +20,52 @@ test_that("model_parameters.aov", {
2020 expect_equal(na.omit(mp $ Omega2_CI_high ), es $ CI_high , tolerance = 1e-3 , ignore_attr = TRUE )
2121 expect_equal(na.omit(mp $ Omega2_CI_high ), 1 , tolerance = 1e-3 , ignore_attr = TRUE )
2222
23- expect_identical(colnames(mp ), c(
24- " Parameter" , " Sum_Squares" , " df" , " Mean_Square" , " F" , " p" ,
25- " Omega2" , " Omega2_CI_low" , " Omega2_CI_high" , " Eta2" ,
26- " Eta2_CI_low" , " Eta2_CI_high" , " Epsilon2" , " Epsilon2_CI_low" ,
27- " Epsilon2_CI_high"
28- ))
23+ expect_identical(
24+ colnames(mp ),
25+ c(
26+ " Parameter" ,
27+ " Sum_Squares" ,
28+ " df" ,
29+ " Mean_Square" ,
30+ " F" ,
31+ " p" ,
32+ " Omega2" ,
33+ " Omega2_CI_low" ,
34+ " Omega2_CI_high" ,
35+ " Eta2" ,
36+ " Eta2_CI_low" ,
37+ " Eta2_CI_high" ,
38+ " Epsilon2" ,
39+ " Epsilon2_CI_low" ,
40+ " Epsilon2_CI_high"
41+ )
42+ )
2943
3044 model <- aov(Sepal.Length ~ Species * Cat1 * Cat2 , data = iris )
3145 mp <- model_parameters(model , es_type = " eta" , ci = 0.9 , partial = FALSE , alternative = " greater" )
3246 es <- effectsize :: eta_squared(model , partial = FALSE , ci = 0.9 )
3347 expect_equal(na.omit(mp $ Eta2_CI_low ), es $ CI_low , tolerance = 1e-3 , ignore_attr = TRUE )
34- expect_equal(mp $ Eta2_CI_low , c(0.5572 , 0 , 0 , 0 , 0 , 0 , 0 , NA ), tolerance = 1e-3 , ignore_attr = TRUE )
48+ expect_equal(
49+ mp $ Eta2_CI_low ,
50+ c(0.5572 , 0 , 0 , 0 , 0 , 0 , 0 , NA ),
51+ tolerance = 1e-3 ,
52+ ignore_attr = TRUE
53+ )
3554 expect_equal(na.omit(mp $ Eta2_CI_high ), es $ CI_high , tolerance = 1e-3 , ignore_attr = TRUE )
3655 expect_equal(na.omit(mp $ Eta2_CI_high ), rep(1 , 7 ), tolerance = 1e-3 , ignore_attr = TRUE )
3756
3857 expect_identical(
3958 colnames(mp ),
4059 c(
41- " Parameter" , " Sum_Squares" , " df" , " Mean_Square" , " F" , " p" ,
42- " Eta2" , " Eta2_CI_low" , " Eta2_CI_high"
60+ " Parameter" ,
61+ " Sum_Squares" ,
62+ " df" ,
63+ " Mean_Square" ,
64+ " F" ,
65+ " p" ,
66+ " Eta2" ,
67+ " Eta2_CI_low" ,
68+ " Eta2_CI_high"
4369 )
4470 )
4571})
@@ -48,7 +74,7 @@ test_that("model_parameters.aov", {
4874# anova ---------------------
4975
5076test_that(" model_parameters.anova" , {
51- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
77+ skip_if_not_installed(" effectsize" )
5278
5379 model <- anova(lm(Sepal.Length ~ Species * Cat1 * Cat2 , data = iris ))
5480 mp <- model_parameters(
@@ -72,7 +98,7 @@ test_that("model_parameters.anova", {
7298})
7399
74100test_that(" model_parameters.anova" , {
75- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
101+ skip_if_not_installed(" effectsize" )
76102 model <- aov(wt ~ cyl + Error(gear ), data = mtcars )
77103 suppressWarnings({
78104 mp <- model_parameters(model , es_type = c(" omega" , " eta" , " epsilon" ), partial = TRUE , ci = 0.9 )
@@ -96,16 +122,15 @@ test_that("model_parameters.anova", {
96122test_that(" model_parameters.car-anova" , {
97123 skip_if_not_installed(" car" )
98124 skip_if_not_installed(" carData" )
99- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
125+ skip_if_not_installed(" effectsize" )
100126
101127 data(Moore , package = " carData" )
102128 set.seed(123 )
103- model <-
104- car :: Anova(stats :: lm(
105- formula = conformity ~ fcategory * partner.status ,
106- data = Moore ,
107- contrasts = list (fcategory = contr.sum , partner.status = contr.sum )
108- ))
129+ model <- car :: Anova(stats :: lm(
130+ formula = conformity ~ fcategory * partner.status ,
131+ data = Moore ,
132+ contrasts = list (fcategory = contr.sum , partner.status = contr.sum )
133+ ))
109134
110135 mp <- model_parameters(model , es_type = c(" omega" , " eta" , " epsilon" ), partial = TRUE , ci = 0.9 )
111136 es <- effectsize :: omega_squared(model , partial = TRUE , ci = 0.9 )
@@ -125,7 +150,7 @@ test_that("model_parameters.car-anova", {
125150
126151# maov ----------------------------------
127152test_that(" model_parameters.maov" , {
128- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
153+ skip_if_not_installed(" effectsize" )
129154
130155 set.seed(123 )
131156 fit <- lm(cbind(mpg , disp , hp ) ~ factor (cyl ), data = mtcars )
@@ -156,7 +181,7 @@ test_that("model_parameters.maov", {
156181
157182test_that(" works with aov" , {
158183 skip_on_cran()
159- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
184+ skip_if_not_installed(" effectsize" )
160185
161186 set.seed(123 )
162187 npk.aov <- aov(yield ~ block + N * P , npk )
@@ -267,7 +292,7 @@ test_that("works with aov", {
267292
268293test_that(" works with manova" , {
269294 skip_on_cran()
270- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
295+ skip_if_not_installed(" effectsize" )
271296
272297 set.seed(123 )
273298 # fake a 2nd response variable
@@ -318,7 +343,7 @@ test_that("works with manova", {
318343test_that(" works with Gam" , {
319344 skip_on_cran()
320345 skip_if_not_installed(" gam" )
321- skip_if_not_installed(" effectsize" , minimum_version = " 0.5.1 " )
346+ skip_if_not_installed(" effectsize" )
322347
323348 # setup
324349 set.seed(123 )
@@ -371,7 +396,7 @@ test_that("works with Gam", {
371396test_that(" works with anova" , {
372397 skip_on_cran()
373398 skip_if_not_installed(" car" )
374- skip_if_not_installed(" effectsize" , minimum_version = " 0.7.1 " )
399+ skip_if_not_installed(" effectsize" )
375400
376401 set.seed(123 )
377402 mod <-
0 commit comments