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
fd4a550
commit 3cfa7bf
Showing
5 changed files
with
46 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
language: r | ||
cache: packages | ||
warnings_are_errors: false | ||
before_install: | ||
- cd pkg/BayesFactor |
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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
|
||
context("anovaBF") | ||
|
||
test_that("Puzzles example works", { | ||
data(puzzles) | ||
|
||
bf = anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom = "ID", | ||
iterations=1000, progress = FALSE) | ||
|
||
expect_that(bf, is_a("BFBayesFactor")) | ||
expect_that(length(bf), is_equivalent_to(4)) | ||
}) | ||
}) |
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,8 @@ | ||
|
||
context('generalTestBF') | ||
|
||
data(puzzles) | ||
|
||
test_that('generalTestBF works', { | ||
generalTestBF(RT ~ shape*color*ID, whichRandom="ID", data = puzzles) | ||
}) |
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,27 @@ | ||
|
||
context('t-test') | ||
|
||
data('ToothGrowth') | ||
|
||
test_that('ttest works', { | ||
ttestBF(ToothGrowth$len, ToothGrowth$dose) | ||
ttestBF(formula=len~supp, data=ToothGrowth) | ||
}) | ||
|
||
test_that('rejects bad input', { | ||
expect_error( | ||
ttestBF(formula=len~dose, data=ToothGrowth), | ||
'Indep. groups t test requires a factor with exactly 2 levels.', | ||
fixed=TRUE | ||
) | ||
expect_error( | ||
ttestBF(formula=len~dose+supp, data=ToothGrowth), | ||
'Indep. groups t test can only support 1 factor as predictor.', | ||
fixed=TRUE | ||
) | ||
expect_error( | ||
ttestBF(formula=len~dose:supp, data=ToothGrowth), | ||
'Interaction terms are not allowed in t test.', | ||
fixed=TRUE | ||
) | ||
}) |