cv: Coefficient of the experiment variation

Description Usage Arguments Details Value Author(s) Examples

View source: R/cv.R

Description

It obtains the coefficient of variation of the experiment obtained by models lm, aov and aovlist.

Usage

1
2
cv(x, 
   round=2)

Arguments

x

A object of the class lm, aov or aovlist.

round

An integer value indicating the number of decimal places to be used. The default value is 2.

Details

sqrt(MSerror)*100/mean(x)

Value

x

named numeric vector

Author(s)

Jos<e9> Cl<e1>udio Faria (joseclaudio.faria@gmail.com)
Enio Jelihovschi (eniojelihovs@gmail.com)
Ivan Bezerra Allaman (ivanalaman@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
library(TukeyC)

## Completely Randomized Design (CRD - aov) 
data(CRD1)
av1 <- with(CRD1,
            aov(y ~ x,
                data=dfm))
summary(av1)
cv(av1)

## Randomized Complete Block Design (RCBD - aov)
data(RCBD)
av2 <- with(RCBD,
            aov(y ~ blk + tra,
                data=dfm))
summary(av2)
cv(av2)

## Split-plot experiment (SPE - aovlist)
data(SPE)
av3 <- with(SPE,
            aov(y ~ blk + P*SP + Error(blk/P),
                data=dfm))
summary(av3)
cv(av3)

## Split-split-plot experiment (SSPE - aovlist)
data(SSPE)
av4 <- with(SSPE,
            aov(y ~  blk + P*SP*SSP + Error(blk/P/SP),
                data=dfm))
summary(av4)
cv(av4)

## storing
res <- cv(av4)
res[2:3]

Example output

Loading required package: doBy
            Df Sum Sq Mean Sq F value   Pr(>F)    
x            3 1224.9   408.3   11.08 0.000168 ***
Residuals   20  736.9    36.8                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
   cv 
11.78 
            Df Sum Sq Mean Sq F value Pr(>F)  
blk          3   80.3   26.77   0.661  0.592  
tra          4  795.7  198.92   4.914  0.014 *
Residuals   12  485.8   40.48                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  cv 
4.44 

Error: blk
    Df Sum Sq Mean Sq
blk  5  413.9   82.78

Error: blk:P
          Df Sum Sq Mean Sq F value Pr(>F)
P          2  17.26    8.63   0.515  0.613
Residuals 10 167.73   16.77               

Error: Within
          Df Sum Sq Mean Sq F value   Pr(>F)    
SP         3 192.99   64.33  18.410 6.15e-08 ***
P:SP       6  21.46    3.58   1.023    0.423    
Residuals 45 157.25    3.49                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cv(a) cv(b) 
25.57 11.67 

Error: blk
    Df Sum Sq Mean Sq
blk  3  15692    5231

Error: blk:P
          Df Sum Sq Mean Sq F value Pr(>F)
P          2  196.9   98.44   1.368  0.324
Residuals  6  431.7   71.94               

Error: blk:P:SP
          Df Sum Sq Mean Sq F value Pr(>F)
SP         2    110    54.8   0.113  0.894
P:SP       4    250    62.5   0.129  0.970
Residuals 18   8735   485.3               

Error: Within
           Df Sum Sq Mean Sq F value   Pr(>F)    
SSP         4  69420   17355  10.949 1.72e-07 ***
P:SSP       8    392      49   0.031        1    
SP:SSP      8 138209   17276  10.899 3.68e-11 ***
P:SP:SSP   16    559      35   0.022        1    
Residuals 108 171186    1585                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cv(a) cv(b) cv(c) 
 2.18  5.67 10.24 
cv(b) cv(c) 
 5.67 10.24 

TukeyC documentation built on May 2, 2019, 8:50 a.m.