cv: Coefficient of the experiment variation

View source: R/cv.R

cvR Documentation

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)

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)

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

Examples

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]

TukeyC documentation built on Aug. 31, 2023, 5:06 p.m.