extract_p: Extracts p-values

Description Usage Arguments Value Methods (by class) Author(s) See Also Examples

Description

For a given object it will look for the column named "p adj" or "difference" and extract its value mantaining its names

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_p(x)

## Default S3 method:
extract_p(x)

## S3 method for class 'TukeyHSD'
extract_p(x)

## S3 method for class 'mc'
extract_p(x)

Arguments

x

A object that has p-values or logical values.

Value

A named vector with p-values or logical values.

Methods (by class)

Author(s)

Luciano Selzer

See Also

multcompLetters multcompTs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
experiment <- data.frame(treatments = gl(11, 20, labels = c("dtl", "ctrl", "treat1",
              "treat2", "treatA2", "treatB", "treatB2",
              "treatC", "treatD", "treatA1", "treatX")),
              y = c(rnorm(20, 10, 5), rnorm(20, 20, 5), rnorm(20, 22, 5), rnorm(20, 24, 5),
               rnorm(20, 35, 5), rnorm(20, 37, 5), rnorm(20, 40, 5), rnorm(20, 43, 5),
               rnorm(20, 45, 5), rnorm(20, 60, 5), rnorm(20, 60, 5)))
exp_tukey <- TukeyHSD(exp_aov <- aov(y  ~ treatments, data = experiment))

extract_p(exp_tukey)

require(pgirmess)
extract_p(kruskalmc(y ~ treatments, data = experiment))

Example output

$treatments
       ctrl-dtl      treat1-dtl      treat2-dtl     treatA2-dtl      treatB-dtl 
   4.079750e-03    5.823899e-05    5.515507e-08    0.000000e+00    0.000000e+00 
    treatB2-dtl      treatC-dtl      treatD-dtl     treatA1-dtl      treatX-dtl 
   0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00 
    treat1-ctrl     treat2-ctrl    treatA2-ctrl     treatB-ctrl    treatB2-ctrl 
   9.949688e-01    3.746280e-01    8.182344e-14    8.570922e-14    0.000000e+00 
    treatC-ctrl     treatD-ctrl    treatA1-ctrl     treatX-ctrl   treat2-treat1 
   0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    9.522318e-01 
 treatA2-treat1   treatB-treat1  treatB2-treat1   treatC-treat1   treatD-treat1 
   9.037215e-14    9.470202e-14    5.795364e-14    0.000000e+00    0.000000e+00 
 treatA1-treat1   treatX-treat1  treatA2-treat2   treatB-treat2  treatB2-treat2 
   0.000000e+00    0.000000e+00    8.143819e-12    2.860134e-11    8.959500e-14 
  treatC-treat2   treatD-treat2  treatA1-treat2   treatX-treat2  treatB-treatA2 
   1.332268e-14    0.000000e+00    0.000000e+00    0.000000e+00    1.000000e+00 
treatB2-treatA2  treatC-treatA2  treatD-treatA2 treatA1-treatA2  treatX-treatA2 
   9.016225e-01    1.913601e-02    5.856908e-04    0.000000e+00    0.000000e+00 
 treatB2-treatB   treatC-treatB   treatD-treatB  treatA1-treatB   treatX-treatB 
   8.054474e-01    9.511380e-03    2.435506e-04    0.000000e+00    0.000000e+00 
 treatC-treatB2  treatD-treatB2 treatA1-treatB2  treatX-treatB2   treatD-treatC 
   6.378827e-01    1.160286e-01    2.509104e-14    6.039613e-14    9.975697e-01 
 treatA1-treatC   treatX-treatC  treatA1-treatD   treatX-treatD  treatX-treatA1 
   9.048318e-14    1.181277e-13    5.790923e-13    9.878764e-12    9.999938e-01 

Loading required package: pgirmess
       dtl-ctrl      dtl-treat1      dtl-treat2     dtl-treatA2      dtl-treatB 
          FALSE           FALSE           FALSE            TRUE            TRUE 
    dtl-treatB2      dtl-treatC      dtl-treatD     dtl-treatA1      dtl-treatX 
           TRUE            TRUE            TRUE            TRUE            TRUE 
    ctrl-treat1     ctrl-treat2    ctrl-treatA2     ctrl-treatB    ctrl-treatB2 
          FALSE           FALSE            TRUE            TRUE            TRUE 
    ctrl-treatC     ctrl-treatD    ctrl-treatA1     ctrl-treatX   treat1-treat2 
           TRUE            TRUE            TRUE            TRUE           FALSE 
 treat1-treatA2   treat1-treatB  treat1-treatB2   treat1-treatC   treat1-treatD 
          FALSE           FALSE            TRUE            TRUE            TRUE 
 treat1-treatA1   treat1-treatX  treat2-treatA2   treat2-treatB  treat2-treatB2 
           TRUE            TRUE           FALSE           FALSE            TRUE 
  treat2-treatC   treat2-treatD  treat2-treatA1   treat2-treatX  treatA2-treatB 
           TRUE            TRUE            TRUE            TRUE           FALSE 
treatA2-treatB2  treatA2-treatC  treatA2-treatD treatA2-treatA1  treatA2-treatX 
          FALSE           FALSE           FALSE            TRUE            TRUE 
 treatB-treatB2   treatB-treatC   treatB-treatD  treatB-treatA1   treatB-treatX 
          FALSE           FALSE           FALSE            TRUE            TRUE 
 treatB2-treatC  treatB2-treatD treatB2-treatA1  treatB2-treatX   treatC-treatD 
          FALSE           FALSE            TRUE            TRUE           FALSE 
 treatC-treatA1   treatC-treatX  treatD-treatA1   treatD-treatX  treatA1-treatX 
          FALSE           FALSE           FALSE           FALSE           FALSE 

multcompView documentation built on May 29, 2017, 10:05 a.m.