Skip to content
Snippets Groups Projects
Commit aa9a860d authored by Walmes Zeviani's avatar Walmes Zeviani
Browse files

Add dataset of a 2^2 RBD experiment, Pimentel pg 219.

parent 2531c8e9
Branches
No related tags found
No related merge requests found
...@@ -573,3 +573,60 @@ NULL ...@@ -573,3 +573,60 @@ NULL
#' color=brewer.pal(n=11, name="Spectral"))) #' color=brewer.pal(n=11, name="Spectral")))
#' #'
NULL NULL
#' @name vinasseFert
#'
#' @title Fertilization with vinasse and mineral
#'
#' @description These data are from an \eqn{2^2} factorial experiment
#' studing the effect of fertilizaton with vinasse (organic font)
#' and complete mineral fertilization.
#'
#' \itemize{
#' \item \code{block} a factor with 4 levels.
#' \item \code{mineral} low (-1) and high (+1) levels of mineral
#' fertilization.
#' \item \code{vinasse} low (-1) and high (+1) levels of fetilization
#' with vinasse.
#' \item \code{y} some response variable. The text book doesn't give
#' any information.
#' }
#'
#' @docType data
#'
#' @keywords datasets
#'
#' @usage data(vinasseFert)
#'
#' @format a \code{data.frame} with 16 records and 4 variables.
#'
#' @source Frederico, P. (2009). Curso de Estatística Experimental (15th
#' ed.). Piracicaba, São Paulo: FEALQ. (page 119)
#'
#' @examples
#'
#' library(lattice)
#' library(latticeExtra)
#'
#' data(vinasseFert)
#' str(vinasseFert)
#'
#' xyplot(y~vinasse, groups=mineral,
#' auto.key=list(title="Mineral", columns=2),
#' data=vinasseFert, type=c("p", "a"),
#' ylab="y",
#' xlab="Vinasse level")
#'
#' m0 <- lm(y~block+(vinasse+mineral)^2, data=vinasseFert)
#' par(mfrow=c(2,2)); plot(m0); layout(1)
#' anova(m0)
#'
#' m1 <- update(m0, .~block+vinasse)
#' par(mfrow=c(2,2)); plot(m1); layout(1)
#'
#' anova(m0, m1)
#' anova(m1)
#'
#' summary(m1)
#'
NULL
##----------------------------------------------------------------------
## Data generation.
vinasseFert <- expand.grid(block=gl(4, 1), mineral=c(-1, 1),
vinasse=c(-1, 1), KEEP.OUT.ATTRS=FALSE)
vinasseFert$y <- c(0.020, 0.630, 0.110, 0.115, 0.020, 2.005, 0.700,
1.120, 3.040, 4.760, 5.860, 5.520, 5.150, 4.770,
3.960, 5.230)
str(vinasseFert)
save(vinasseFert, file="../data/vinasseFert.RData")
##----------------------------------------------------------------------
## Examples.
library(lattice)
library(latticeExtra)
data(vinasseFert)
str(vinasseFert)
xyplot(y~vinasse, groups=mineral,
auto.key=list(title="Mineral", columns=2),
data=vinasseFert, type=c("p", "a"),
ylab="y",
xlab="Vinasse level")
m0 <- lm(y~block+(vinasse+mineral)^2, data=vinasseFert)
par(mfrow=c(2,2)); plot(m0); layout(1)
anova(m0)
m1 <- update(m0, .~block+vinasse)
par(mfrow=c(2,2)); plot(m1); layout(1)
anova(m0, m1)
anova(m1)
summary(m1)
rm(list=ls())
load("../data/vinasseFert.RData")
ls()
str(vinasseFert)
File added
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/legTools.R
\docType{data}
\name{vinasseFert}
\alias{vinasseFert}
\title{Fertilization with vinasse and mineral}
\format{a \code{data.frame} with 16 records and 4 variables.}
\source{
Frederico, P. (2009). Curso de Estatística Experimental (15th
ed.). Piracicaba, São Paulo: FEALQ. (page 119)
}
\usage{
data(vinasseFert)
}
\description{
These data are from an \eqn{2^2} factorial experiment
studing the effect of fertilizaton with vinasse (organic font)
and complete mineral fertilization.
\itemize{
\item \code{block} a factor with 4 levels.
\item \code{mineral} low (-1) and high (+1) levels of mineral
fertilization.
\item \code{vinasse} low (-1) and high (+1) levels of fetilization
with vinasse.
\item \code{y} some response variable. The text book doesn't give
any information.
}
}
\examples{
library(lattice)
library(latticeExtra)
data(vinasseFert)
str(vinasseFert)
xyplot(y~vinasse, groups=mineral,
auto.key=list(title="Mineral", columns=2),
data=vinasseFert, type=c("p", "a"),
ylab="y",
xlab="Vinasse level")
m0 <- lm(y~block+(vinasse+mineral)^2, data=vinasseFert)
par(mfrow=c(2,2)); plot(m0); layout(1)
anova(m0)
m1 <- update(m0, .~block+vinasse)
par(mfrow=c(2,2)); plot(m1); layout(1)
anova(m0, m1)
anova(m1)
summary(m1)
}
\keyword{datasets}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment