tests {SARP.compo} | R Documentation |
Utility functions to obtain p-values from tests on individual ratios
Description
These functions can be used in the functions to perform analysis on all pairwise ratios of a compositional dataset
Usage
student.fpc( d, variable, v.X, var.equal = TRUE, ... )
anva1.fpc( d, variable, v.X, frm = NULL, ... )
anva1vi.fpc( d, variable, v.X, frm = NULL, ... )
rls.fpc( d, variable, v.X, frm = NULL, ... )
kw.fpc( d, variable, v.X, frm = NULL, ... )
anva_SC.fpc( d, variable, frm, SC = 1, type = 1, ... )
Arguments
d |
The data frame that contains the ratio to test, and all variables of the original data frame that where not used as compositional data. |
variable |
A length-one character vector containing the names of the variable corresponding to the ratio (or log-ratio) to test. |
v.X |
The name of the explanatory (independant, predictor)
variable. This variable should be a factor for |
frm |
The formula to use. Defaults to For |
SC |
For |
type |
For |
var.equal |
For |
... |
additional arguments |
Details
These functions are only wrapper to some commonly used tests. The correspondance is as follow
student.fpc | Student's T-test | t.test()$p.value |
anva1.fpc | One-way analysis of variance | anova(lm())[ 1, 5 ] |
rls.fpc | Simple linear regression | anova(lm())[ 1, 5 ] |
anva1vi.fpc | One-way analysis of variance, without equal variance assumption | oneway.test()$p.value |
kw.fpc | Kruskal-Wallis test | kruskal.test()$p.value |
anva_SC.fpc
is a generic wrapper for lm
using any
formula. It then extracts the p-value of the line given by
SC
in the analysis of variance table. If type = 1
, the
table is built using anova
and corresponds to type 1
(sequential sum of square). If type = 2
or type = 3
,
the table is built using car::Anova
and corresponds either to
type 2 or type 3 sums of squares.
For Student's test (either with equal or unequal variances), instead of calling t.test, the computation is done internally, hopefully speeding up (less controls are done and only useful computations are done)
Value
These function returns the p-value from the corresponding test.
Note
rls.fpc
is an exact synonym for anva1.fpc
, since the
underlying theory is the same. Distinction is made to help users
without a formal statistical background to find the right test.
Author(s)
Emmanuel Curis (emmanuel.curis@parisdescartes.fr)
See Also
kruskal.test
, lm
, anova
,
Anova
, oneway.test
, for corresponding tests.
equiv.fpc
for an approach using equivalence tests.
creer.Mp
to use these functions to create a matrix of
p-values.
Examples
# load the potery data set
data( poteries )
# Compute one-way ANOVA p-values for all ratios in this data set
Mp <- creer.Mp( poteries, c( 'Al', 'Na', 'Fe', 'Ca', 'Mg' ),
f.p = anva1.fpc, v.X = 'Site', frm = R ~ Site )
Mp
# Make a graphe from it and plot it
plot( grf.Mp( Mp ) )