Skip to contents

Function for extracting the two-sided or one-sided p-values in a SSDtest object as a matrix.

Usage

pvals(x, alternative = "two.sided")

Arguments

x

An object of class SSDtest.

alternative

a character value indicating whether two-sided or one-sided p-values should be extracted. Takes "two.sided" or "one.sided", defaulting to "two.sided". If "one.sided" then both sets of one-sided p-values are returned.

Value

A matrix containing the corresponding p-values in x.

Examples

# Standard significance test with one fossil sample, sampling without replacement
test_faux_uni <- SSDtest(
     fossil=list("Fauxil sp. 1"=fauxil[fauxil$Species=="Fauxil sp. 1", "FHSI"]),
     comp=list("G. gorilla"=apelimbart[apelimbart$Species=="Gorilla gorilla", "FHSI"],
               "H. sapiens"=apelimbart[apelimbart$Species=="Homo sapiens", "FHSI"],
               "P. troglodytes"=apelimbart[apelimbart$Species=="Pan troglodytes", "FHSI"],
               "H. lar"=apelimbart[apelimbart$Species=="Hylobates lar", "FHSI"]),
     fossilsex=NULL,
     compsex=list("G. gorilla"=apelimbart[apelimbart$Species=="Gorilla gorilla", "Sex"],
                  "H. sapiens"=apelimbart[apelimbart$Species=="Homo sapiens", "Sex"],
                  "P. troglodytes"=apelimbart[apelimbart$Species=="Pan troglodytes", "Sex"],
                  "H. lar"=apelimbart[apelimbart$Species=="Hylobates lar", "Sex"]),
     methsUni=c("MMR", "BDI"),
     limit=1000,
     nResamp=100)
#> Warning: The number of possible combinations (3049501) exceeds the user-specified limit. Monte Carlo sampling will be used.
#> Warning: The number of possible combinations (3049501) exceeds the user-specified limit. Monte Carlo sampling will be used.
#> Warning: The number of possible combinations (3049501) exceeds the user-specified limit. Monte Carlo sampling will be used.
#> Warning: The number of possible combinations (3049501) exceeds the user-specified limit. Monte Carlo sampling will be used.
pvals(test_faux_uni) # defaults to two-sided
#>                                   MMR:geomean BDI:geomean
#> H0: Fauxil sp. 1 = G. gorilla          0.6100      0.8500
#> H0: Fauxil sp. 1 = H. sapiens          0.0800      0.2100
#> H0: Fauxil sp. 1 = P. troglodytes      0.0200      0.0300
#> H0: Fauxil sp. 1 = H. lar              0.0000      0.0000
#> H0: G. gorilla = H. sapiens            0.5649      0.5520
#> H0: G. gorilla = P. troglodytes        0.3233      0.3041
#> H0: G. gorilla = H. lar                0.1011      0.0687
#> H0: H. sapiens = P. troglodytes        0.6220      0.6272
#> H0: H. sapiens = H. lar                0.1814      0.1607
#> H0: P. troglodytes = H. lar            0.4583      0.4056
pvals(test_faux_uni, alternative="one.sided")
#>                                    MMR:geomean BDI:geomean
#> H0: Fauxil sp. 1 <= G. gorilla          0.3200      0.4000
#> H0: Fauxil sp. 1 <= H. sapiens          0.0400      0.1300
#> H0: Fauxil sp. 1 <= P. troglodytes      0.0200      0.0300
#> H0: Fauxil sp. 1 <= H. lar              0.0000      0.0000
#> H0: G. gorilla <= H. sapiens            0.2809      0.2752
#> H0: G. gorilla <= P. troglodytes        0.1618      0.1504
#> H0: G. gorilla <= H. lar                0.0557      0.0412
#> H0: H. sapiens <= P. troglodytes        0.3076      0.3074
#> H0: H. sapiens <= H. lar                0.0824      0.0700
#> H0: P. troglodytes <= H. lar            0.2425      0.2152
#> H0: G. gorilla <= Fauxil sp. 1          0.6800      0.6000
#> H0: H. sapiens <= Fauxil sp. 1          0.9600      0.8700
#> H0: P. troglodytes <= Fauxil sp. 1      0.9800      0.9700
#> H0: H. lar <= Fauxil sp. 1              1.0000      1.0000
#> H0: H. sapiens <= G. gorilla            0.7191      0.7248
#> H0: P. troglodytes <= G. gorilla        0.8382      0.8496
#> H0: H. lar <= G. gorilla                0.9443      0.9588
#> H0: P. troglodytes <= H. sapiens        0.6924      0.6926
#> H0: H. lar <= H. sapiens                0.9176      0.9300
#> H0: H. lar <= P. troglodytes            0.7575      0.7848