Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/bayestestR
04 October 2022, 07:12:41 UTC
  • Code
  • Branches (24)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1.0
    • refs/tags/0.10.0
    • refs/tags/0.10.5
    • refs/tags/0.11.0
    • refs/tags/0.11.5
    • refs/tags/0.12.1
    • refs/tags/0.13.0
    • refs/tags/0.2.0
    • refs/tags/0.2.2
    • refs/tags/0.2.5
    • refs/tags/0.3.0
    • refs/tags/0.4.0
    • refs/tags/0.5.0
    • refs/tags/0.5.1
    • refs/tags/0.5.2
    • refs/tags/0.5.3
    • refs/tags/0.6.0
    • refs/tags/0.7.0
    • refs/tags/0.7.2
    • refs/tags/0.7.5
    • refs/tags/0.8.0
    • refs/tags/0.8.2
    • refs/tags/0.9.0
    No releases to show
  • aedc67f
  • /
  • tests
  • /
  • testthat
  • /
  • test-BFBayesFactor.R
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:9c6c5cac1228dd496695547c3f4842a4af808a3f
origin badgedirectory badge Iframe embedding
swh:1:dir:6fcf24c7617f1cbb6ddc68f7c9d430fc24a69ef8
origin badgerevision badge
swh:1:rev:d8462ad2168ad7ee61c0d7e679174e775f01a9be
origin badgesnapshot badge
swh:1:snp:2c68a6c5a8af2f06ac2c0225927f25b54fd1f9d0
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: d8462ad2168ad7ee61c0d7e679174e775f01a9be authored by Dominique Makowski on 18 January 2020, 07:10:02 UTC
version 0.5.0
Tip revision: d8462ad
test-BFBayesFactor.R
library(BayesFactor)

set.seed(333)

context("BF correlation")
x <- BayesFactor::correlationBF(y = iris$Sepal.Length, x = iris$Sepal.Width)
test_that("p_direction", {
  testthat::skip_on_travis() # Until insight v3 is released
  expect_equal(as.numeric(p_direction(x)), 0.9225, tol = 1)
})


# ---------------------------
context("BF t.test one sample")
data(sleep)
diffScores <- sleep$extra[1:10] - sleep$extra[11:20]
x <- BayesFactor::ttestBF(x = diffScores)
test_that("p_direction", {
  testthat::skip_on_travis() # Until insight v3 is released
  expect_equal(as.numeric(p_direction(x)), 0.99675, tol = 1)
})


# ---------------------------
context("BF t.test two samples")
data(chickwts)
chickwts <- chickwts[chickwts$feed %in% c("horsebean", "linseed"), ]
chickwts$feed <- factor(chickwts$feed)
x <- BayesFactor::ttestBF(formula = weight ~ feed, data = chickwts)
test_that("p_direction", {
  testthat::skip_on_travis() # Until insight v3 is released
  expect_equal(as.numeric(p_direction(x)), 1, tol = 1)
})

# ---------------------------
context("BF t.test meta-analytic")
t <- c(-.15, 2.39, 2.42, 2.43)
N <- c(100, 150, 97, 99)
x <- BayesFactor::meta.ttestBF(t = t, n1 = N, rscale = 1)
test_that("p_direction", {
  testthat::skip_on_travis() # Until insight v3 is released
  expect_equal(as.numeric(p_direction(x)), 0.99975, tol = 1)
})

# # ---------------------------
# context("BF ANOVA")
# data(ToothGrowth)
# ToothGrowth$dose <- factor(ToothGrowth$dose)
# levels(ToothGrowth$dose) <- c("Low", "Medium", "High")
# x <- BayesFactor::anovaBF(len ~ supp*dose, data=ToothGrowth)
# test_that("p_direction", {
#   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
# })
#
# # ---------------------------
# context("BF ANOVA Random")
# data(puzzles)
# x <- BayesFactor::anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom="ID")
# test_that("p_direction", {
#   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
# })
#
#
# # ---------------------------
# context("BF lm")
# x <- BayesFactor::lmBF(len ~ supp + dose, data = ToothGrowth)
# test_that("p_direction", {
#   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
# })
#
#
# x2 <- BayesFactor::lmBF(len ~ supp + dose + supp:dose, data = ToothGrowth)
# x <- x / x2
# test_that("p_direction", {
#   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
# })

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API