test: Utility functions to obtain p-values from tests on individual...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

These functions can be used in the functions to perform analysis on all pairwise ratios of a compositional dataset

Usage

1
2
3
4
5
6
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 anva1.fpc, anva1vi.fpc and kw.fpc and a numeric for rls.fpc.

frm

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!

SC

For anva_SC.fpc, the number of the line to use in the analysis of variance table to get a p-value, see details.

type

For anva_SC.fpc, the kind of sums of square to be used when constructing the analysis of variance table, see details.

var.equal

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
   # 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 ) )

SARP.compo documentation built on May 16, 2021, 1:06 a.m.

Related to test in SARP.compo...