posthocKW {postHoc} | R Documentation |
Post-hoc analysis based on the Kruskal-Walis test
Description
posthocKW is used to group or cluster effects using the Kruskal-Wallis test for making a non-parametric based post-hoc analysis.
Usage
posthocKW (y, g, EffectIndices = NULL, EffectLabels = NULL,
Nboots = 9999, SignificanceLevel = 0.05, UpperCase = FALSE,
RankLabels = TRUE, CalcClusters = FALSE, PlotAdj = FALSE,
digits = 4, padjust = NULL, Scale = 1.0, Location = 0.0)
Arguments
y |
is a vector with the response. |
g |
is a single classification factor. |
EffectIndices |
a vector containing the indices of the effects to be analysed (default = NULL, indicating that all the levels are used). |
EffectLabels |
a character vector with the labels of the effects (default = NULL, which implies that the corresponding labels of the model coefficient are used). |
Nboots |
number of bootstrap samples used for the confidence interval. (default = 9999). |
SignificanceLevel |
the significance level of the pairwise comparisons (default = 0.05). |
UpperCase |
should upper case letters be used for labelling the groups (default is FALSE). |
RankLabels |
should the labels of the grouping be sorted according to the value of the response (default=TRUE) |
CalcClusters |
should the clusters be calculated and displayed instead of grouping (Default is FALSE) |
PlotAdj |
should the associated graph be printed(default = FALSE). |
digits |
number of digits in the output (default = 4) |
padjust |
method for correcting the p-values (before the calculations are performed) as in the function p.adjust (Default is NULL, indicating that no multiple testing corrections are used) |
Scale |
a scaling factor multiplying the output table (default = 1, i.e., no scaling is used). |
Location |
a location term added to the output table (default = 0, i.e., no location shift is performed). |
Details
The function contructs, using Kruskal-Wallis rank sum tests all pairwise comparisosns, an undirected graph with vertices representing the levels of the effects, using the convention that two vertices are connected by an edge iff the p-value for testing equality the two vertices is larger than the prefixed significance level. The maximal cliques of this graph form the grouping of the levels of the effects.
Value
an object of (S3) class "PostHoc" with methods for print, summary, plot, barplot and lines defined. An object of class "PostHoc" contails the effects, grouping, the matrix of p-values of all pairwise comparisons, the graph (Gr) of adjacency, the confidence intervals of the effects, the significance levels, the number of digits to be used for printing, the list of maximal cliques of the graph Gr, the clusters (if calculated).
Author(s)
Rodrigo Labouriau
Examples
print( posthocKW(DeIdentifiedExample$Y, DeIdentifiedExample$Treatment) )