Learn R Programming

TukeyC (version 1.3-43)

cv: Coefficient of the experiment variation

Description

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

Usage

cv(x, 
   round=2)

Value

x

named numeric vector

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.

Author

Jose Claudio Faria (joseclaudio.faria@gmail.com)
Enio Jelihovschi (eniojelihovs@gmail.com)
Ivan Bezerra Allaman (ivanalaman@gmail.com)

Details

sqrt(MSerror)*100/mean(x)

Examples

Run this code
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]

Run the code above in your browser using DataLab