diff --git a/R/legTools.R b/R/legTools.R index 963ddcc7185899a55a9d08ef76291ceefa5010c2..a3151617e9027b200733a5e61bde5ca383642f78 100644 --- a/R/legTools.R +++ b/R/legTools.R @@ -579,8 +579,9 @@ NULL #' @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. +#' studing the effect of fertilizaton with vinasse (a residual from +#' industrial processing of sugar cane) and complete mineral +#' fertilization. #' #' \itemize{ #' \item \code{block} a factor with 4 levels. @@ -630,3 +631,67 @@ NULL #' summary(m1) #' NULL + +#' @name filterCake +#' +#' @title Fertilization with filter cake and mineral +#' +#' @description These data are from an \eqn{2^2} factorial experiment +#' studing the effect of fertilizaton with filter cake (a residual +#' from industrial processing of sugar cane) and traditional 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{cake} low (-1) and high (+1) levels of fetilization +#' with filter cake. +#' \item \code{y} some response variable. The text book doesn't give +#' any information. +#' } +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(filterCake) +#' +#' @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 120) +#' +#' @examples +#' +#' library(lattice) +#' library(latticeExtra) +#' +#' data(filterCake) +#' str(filterCake) +#' +#' xyplot(y~cake, groups=mineral, +#' auto.key=list(title="Mineral", columns=2), +#' data=filterCake, type=c("p", "a"), +#' ylab="y", +#' xlab="Filter cake level") +#' +#' m0 <- lm(y~block+(cake+mineral)^2, data=filterCake) +#' par(mfrow=c(2,2)); plot(m0); layout(1) +#' anova(m0) +#' +#' summary(m0) +#' +#' filterCake$Mineral <- factor(filterCake$mineral, +#' labels=c("absent", "present")) +#' +#' m1 <- aov(y~block+Mineral/cake, data=filterCake) +#' anova(m1) +#' +#' ## Split SS to see effect of cake in each level of mineral. +#' summary(m1, split=list("Mineral:cake"=list("absent"=1, "present"=2))) +#' +#' summary.lm(m1) +#' +#' +NULL diff --git a/data-raw/filterCake.R b/data-raw/filterCake.R new file mode 100644 index 0000000000000000000000000000000000000000..52aa6d39a650d1b02ad9ca24e672180f69b919e9 --- /dev/null +++ b/data-raw/filterCake.R @@ -0,0 +1,49 @@ +##---------------------------------------------------------------------- +## Data generation. + +filterCake <- expand.grid(block=gl(4, 1), mineral=c(-1, 1), + cake=c(-1, 1), KEEP.OUT.ATTRS=FALSE) + +filterCake$y <- c(18.0, 8.6, 9.4, 11.4, 20.6, 21.0, 18.6, 20.6, 19.6, + 15.0, 14.6, 15.8, 19.2, 19.6, 18.4, 20.2) + +str(filterCake) + +save(filterCake, file="../data/filterCake.RData") + +##---------------------------------------------------------------------- +## Examples. + +library(lattice) +library(latticeExtra) + +data(filterCake) +str(filterCake) + +xyplot(y~cake, groups=mineral, + auto.key=list(title="Mineral", columns=2), + data=filterCake, type=c("p", "a"), + ylab="y", + xlab="Filter cake level") + +m0 <- lm(y~block+(cake+mineral)^2, data=filterCake) +par(mfrow=c(2,2)); plot(m0); layout(1) +anova(m0) + +summary(m0) + +filterCake$Mineral <- factor(filterCake$mineral, + labels=c("absent", "present")) + +m1 <- aov(y~block+Mineral/cake, data=filterCake) +anova(m1) + +## Split SS to see effect of cake in each level of mineral. +summary(m1, split=list("Mineral:cake"=list("absent"=1, "present"=2))) + +summary.lm(m1) + +rm(list=ls()) +load("../data/filterCake.RData") +ls() +str(filterCake) diff --git a/data/filterCake.RData b/data/filterCake.RData new file mode 100644 index 0000000000000000000000000000000000000000..a0de62bd28138af476f33e6348a87bfd0ee00b62 Binary files /dev/null and b/data/filterCake.RData differ diff --git a/man/filterCake.Rd b/man/filterCake.Rd new file mode 100644 index 0000000000000000000000000000000000000000..2f65788c77d2c9d04d3f8ab34ae9bdb45b4b9091 --- /dev/null +++ b/man/filterCake.Rd @@ -0,0 +1,62 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{filterCake} +\alias{filterCake} +\title{Fertilization with filter cake 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 120) +} +\usage{ +data(filterCake) +} +\description{ +These data are from an \eqn{2^2} factorial experiment + studing the effect of fertilizaton with filter cake (a residual + from industrial processing of sugar cane) and traditional 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{cake} low (-1) and high (+1) levels of fetilization + with filter cake. + \item \code{y} some response variable. The text book doesn't give + any information. +} +} +\examples{ +library(lattice) +library(latticeExtra) + +data(filterCake) +str(filterCake) + +xyplot(y~cake, groups=mineral, + auto.key=list(title="Mineral", columns=2), + data=filterCake, type=c("p", "a"), + ylab="y", + xlab="Filter cake level") + +m0 <- lm(y~block+(cake+mineral)^2, data=filterCake) +par(mfrow=c(2,2)); plot(m0); layout(1) +anova(m0) + +summary(m0) + +filterCake$Mineral <- factor(filterCake$mineral, + labels=c("absent", "present")) + +m1 <- aov(y~block+Mineral/cake, data=filterCake) +anova(m1) + +## Split SS to see effect of cake in each level of mineral. +summary(m1, split=list("Mineral:cake"=list("absent"=1, "present"=2))) + +summary.lm(m1) +} +\keyword{datasets} + diff --git a/man/vinasseFert.Rd b/man/vinasseFert.Rd index 981cc37232a997c214223a387b0cb266ea5386a4..ae7a36622fcba75164cfb7d5df6ce2912864b1a1 100644 --- a/man/vinasseFert.Rd +++ b/man/vinasseFert.Rd @@ -14,8 +14,9 @@ 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. + studing the effect of fertilizaton with vinasse (a residual from + industrial processing of sugar cane) and complete mineral + fertilization. \itemize{ \item \code{block} a factor with 4 levels.