These functions can be used in the functions to perform analysis on all pairwise ratios of a compositional dataset
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, ... )
These function returns the p-value from the corresponding test.
The data frame that contains the ratio to test, and all variables of the original data frame that where not used as compositional data.
A length-one character vector containing the names of the variable corresponding to the ratio (or log-ratio) to test.
The name of the explanatory (independant, predictor)
variable. This variable should be a factor for anva1.fpc
,
anva1vi.fpc
and kw.fpc
and a numeric for
rls.fpc
.
The formula to use.
Defaults to as.formula( paste0( variable,
"~", v.X ) )
for anva1.fpc
, anva1vi.fpc
and kw.fpc
.
Providing the formula speeds up the computation, since it avoids
repeating the construction step for each ratio.
For anva_SC.fpc
, giving the formula is mandatory and
variable
is unused. Beware of the term order to select the
right sum of squares to test!
For anva_SC.fpc
, the number of the line to use in the analysis
of variance table to get a p-value, see details.
For anva_SC.fpc
, the kind of sums of square to be used when
constructing the analysis of variance table, see details.
For student.fpc
, shall we assume that variance are equals in
the two groups (TRUE
, the default) or not
(FALSE
). Same as in t.test
.
additional arguments
Emmanuel Curis (emmanuel.curis@parisdescartes.fr)
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)
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.
# 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 ) )
Run the code above in your browser using DataLab