diff --git a/DESCRIPTION b/DESCRIPTION index 325c0401d90555e30231c9993fed9b80936d3151..438ccedff7d3d3461a7810f43fff1eba2ab9ad4b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,12 @@ Package: legTools Title: Convenience Functions, Small GUI to Teach Statistics and Some Datasets Version: 0.2.0 -Authors@R: person("LEG", "Core Team", email = "leg@ufpr.br", role = - c("aut", "cre")) +Authors@R: as.person(c( + "LEG Core Team <leg@ufpr.br> [cre]", + "Walmes Marques Zeviani <walmes@ufpr.br> [aut]", + "Fernando de Pol Mayer <fernando.mayer@ufpr.br> [aut]", + "Bruna Davies Wundervald <brunadaviesw@gmail.com> [ctb]" + )) Description: legTools is a collection of R functions and datasets used for academic purposes. These functions mainly include small GUI to teach statistics, conveninece functions to visualize data and datasets, nost part diff --git a/R/legTools.R b/R/legTools.R index 115262bcc6e803a275f684b71032537541b8e399..c0e84bd9be14097927bd1e5e10e67ce3e9e4e42b 100644 --- a/R/legTools.R +++ b/R/legTools.R @@ -11,18 +11,20 @@ NULL #' #' @title Feeding type in pig weight gain #' -#' @description This is an artifial dataset corresponding a experiment -#' to study the effect of feeding type (factor with 4 categorical -#' nominal levels) in pig weight gain. The experiment was a -#' randomized complete design with five experimental units per +#' @description This is an artificial data set corresponding a +#' experiment to study the effect of feeding type (factor with 4 +#' categorical nominal levels) in pig weight gain. The experiment +#' was a randomized complete design with five experimental units per #' treatment level. The experimental unit was a pig. The response -#' measured was weight gain from the beggining to the end of the +#' measured was weight gain from the beginning to the end of the #' experiment. #' #' \itemize{ -#' \item \code{ft} feeding type, a categorical factor with 4 -#' levels. -#' \item \code{wg} weight gain (kg). +#' +#' \item \code{ft} feeding type, a categorical factor with 4 levels. +#' +#' \item \code{wg} weight gain (kg). +#' #' } #' #' @docType data @@ -57,10 +59,13 @@ NULL #' (t/ha) was recorded in each experimental unit. #' #' \itemize{ -#' \item \code{block} a categorical unordered factor with 4 levels. -#' \item \code{variety} a categorical unordered factor with 8 -#' levels. -#' \item \code{yield} potato yield (t/ha). +#' +#' \item \code{block} a categorical unordered factor with 4 levels. +#' +#' \item \code{variety} a categorical unordered factor with 8 levels. +#' +#' \item \code{yield} potato yield (t/ha). +#' #' } #' #' @docType data @@ -99,9 +104,13 @@ NULL #' units for each factor level in each block. #' #' \itemize{ -#' \item \code{block} a categorical unordered factor with 6 levels. -#' \item \code{plow} a categorical unordered factor with 2 levels. -#' \item \code{yield} corn yield (kg in 200 m\eqn{^2} of area). +#' +#' \item \code{block} a categorical unordered factor with 6 levels. +#' +#' \item \code{plow} a categorical unordered factor with 2 levels. +#' +#' \item \code{yield} corn yield (kg in 200 m\eqn{^2} of area). +#' #' } #' #' @docType data @@ -128,10 +137,10 @@ NULL #' @name defoliation #' -#' @title Bolls in cotton as function of artifitial defoliation +#' @title Bolls in cotton as function of artificial defoliation #' #' @description This dataset contais the result of a real experiment to -#' evaluate the effect of artifitial defoliation in combination with +#' evaluate the effect of artificial defoliation in combination with #' phenological stage of occurence on the production of cotton #' represented by the number of bolls produced at the end of the #' crop cycle. The experiment is a \eqn{5\times 5} factorial with 5 @@ -142,15 +151,21 @@ NULL #' variance less than the sample mean). #' #' \itemize{ -#' \item \code{phenol} a categorical ordered factor with 5 levels -#' that represent the phenological stages of the cotton plant in -#' which defoliation was applied. +#' +#' \item \code{phenol} a categorical ordered factor with 5 levels that +#' represent the phenological stages of the cotton plant in which +#' defoliation was applied. +#' #' \item \code{defol} a numeric factor with 5 levels that represents the #' artifical level of defoliation (percent in leaf area removed with #' scissors) applied for all leaves in the plant. -#' \item \code{rept} index for each experimenal unit in each treatment cell. +#' +#' \item \code{rept} index for each experimenal unit in each treatment +#' cell. +#' #' \item \code{bolls} the number of bolls produced (count variable) #' evaluated at harvest. +#' #' } #' #' @details The experiment was done in a greenhouse at Universidade @@ -221,10 +236,13 @@ NULL #' (t/ha) was recorded in each experimental unit. #' #' \itemize{ -#' \item \code{block} a categorical unordered factor with 4 levels. -#' \item \code{variety} a categorical unordered factor with 6 -#' levels. -#' \item \code{yield} cassava yield (t/ha). +#' +#' \item \code{block} a categorical unordered factor with 4 levels. +#' +#' \item \code{variety} a categorical unordered factor with 6 levels. +#' +#' \item \code{yield} cassava yield (t/ha). +#' #' } #' #' @docType data @@ -260,10 +278,13 @@ NULL #' (kg/plot) was recorded in each experimental unit. #' #' \itemize{ -#' \item \code{block} a categorical unordered factor with 4 levels. -#' \item \code{variety} a categorical unordered factor with 7 -#' levels. -#' \item \code{yield} sugarcane yield (kg/plot). +#' +#' \item \code{block} a categorical unordered factor with 4 levels. +#' +#' \item \code{variety} a categorical unordered factor with 7 levels. +#' +#' \item \code{yield} sugarcane yield (kg/plot). +#' #' } #' #' @docType data @@ -298,14 +319,18 @@ NULL #' experimental unit. #' #' \itemize{ -#' \item \code{row} the rows of the latin square that controls in -#' one dimention. A categorical unordered factor with 5 levels. -#' \item \code{col} the columns of the latin square that controls in -#' one dimention perpendicular to the previus. A categorical -#' unordered factor with 5 levels. -#' \item \code{variety} a categorical unordered factor with 5 -#' levels. -#' \item \code{yield} sugarcane yield (kg/plot). +#' +#' \item \code{row} the rows of the latin square that controls in one +#' dimention. A categorical unordered factor with 5 levels. +#' +#' \item \code{col} the columns of the latin square that controls in one +#' dimention perpendicular to the previus. A categorical unordered +#' factor with 5 levels. +#' +#' \item \code{variety} a categorical unordered factor with 5 levels. +#' +#' \item \code{yield} sugarcane yield (kg/plot). +#' #' } #' #' @docType data @@ -355,16 +380,21 @@ NULL #' experimental unit. #' #' \itemize{ -#' \item \code{row} the rows of the latin square that controls in -#' one dimention. A categorical unordered factor with 6 levels. -#' \item \code{col} the columns of the latin square that controls in -#' one dimention perpendicular to the previus. A categorical -#' unordered factor with 6 levels. -#' \item \code{fertil} a categorical unordered factor with 6 -#' levels that is the fertilization strategy applied. These levels -#' are a result of treatment cells in a three incomplete factorial +#' +#' \item \code{row} the rows of the latin square that controls in one +#' dimention. A categorical unordered factor with 6 levels. +#' +#' \item \code{col} the columns of the latin square that controls in one +#' dimention perpendicular to the previus. A categorical unordered +#' factor with 6 levels. +#' +#' \item \code{fertil} a categorical unordered factor with 6 levels that +#' is the fertilization strategy applied. These levels are a result +#' of treatment cells in a three incomplete factorial #' arrangrment. See detais for more information. -#' \item \code{yield} sugarcane yield (kg/plot). +#' +#' \item \code{yield} sugarcane yield (kg/plot). +#' #' } #' #' @details The levels of fertilization are in fact a combination of a @@ -406,7 +436,8 @@ NULL #' colors=brewer.pal(n=11, name="Spectral")))+ #' layer(with(sugarcaneYield3, #' panel.text(x=row, y=col, -#' label=sprintf("%s\n%0.2f", fertil, yield)))) +#' label=sprintf("%s\n%0.2f", +#' fertil, yield)))) #' #' aggregate(yield~row, data=sugarcaneYield3, FUN=mean) #' aggregate(yield~col, data=sugarcaneYield3, FUN=mean) @@ -435,15 +466,20 @@ NULL #' experiment. #' #' \itemize{ -#' \item \code{litter} a categorical factor with 4 levels that +#' +#' \item \code{litter} a categorical factor with 4 levels that #' represents the rows of the lattin square design and control for #' the differences among litters. -#' \item code{size} a categorical ordered variable that represents the +#' +#' \item code{size} a categorical ordered variable that represents the #' columns of latin square desing and control for the weight of the #' animals at the beggining of the experiment. -#' \item \code{age} age of the animal (days) when castration was +#' +#' \item \code{age} age of the animal (days) when castration was #' done. \code{controls} are the animals without castration. -#' \item \code{wg} weight gain (kg) after 252 days. +#' +#' \item \code{wg} weight gain (kg) after 252 days. +#' #' } #' #' @docType data @@ -479,11 +515,17 @@ NULL #' (K) on corn yield in a randomized block design. #' #' \itemize{ -#' \item \code{block} a factor with 4 levels. -#' \item \code{N} low (-1) and high (+1) levels of nitrogen. -#' \item \code{P} low (-1) and high (+1) levels of phosporus. -#' \item \code{K} low (-1) and high (+1) levels of potassium. -#' \item \code{yield} corn yield (ton/ha). +#' +#' \item \code{block} a factor with 4 levels. +#' +#' \item \code{N} low (-1) and high (+1) levels of nitrogen. +#' +#' \item \code{P} low (-1) and high (+1) levels of phosporus. +#' +#' \item \code{K} low (-1) and high (+1) levels of potassium. +#' +#' \item \code{yield} corn yield (ton/ha). +#' #' } #' #' @docType data @@ -528,13 +570,18 @@ NULL #' fertilization. #' #' \itemize{ -#' \item \code{block} a factor with 4 levels. -#' \item \code{mineral} low (-1) and high (+1) levels of mineral +#' +#' \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. +#' +#' \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 @@ -574,13 +621,18 @@ NULL #' fertilization. #' #' \itemize{ -#' \item \code{block} a factor with 4 levels. -#' \item \code{mineral} low (-1) and high (+1) levels of mineral +#' +#' \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. +#' +#' \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 @@ -619,12 +671,19 @@ NULL #' studing the effect of NPK on the yield of sugar cane. #' #' \itemize{ +#' #' \item \code{block} a local control factor with 3 levels. +#' #' \item \code{rept} factor with 2 levels. +#' #' \item \code{N} integer coded nitrogen levels (0, 1, 2). +#' #' \item \code{P} integer coded phosphorus levels (0, 1, 2). +#' #' \item \code{K} integer coded potassium levels (0, 1, 2). +#' #' \item \code{yield} sugar cane yield (ton/ha). +#' #' } #' #' @details There is a missprint in the book for the 9th entry, which @@ -668,11 +727,16 @@ NULL #' Novermber, December and January. #' #' \itemize{ -#' \item \code{variety} a categorical variable with 6 levels that +#' +#' \item \code{variety} a categorical variable with 6 levels that #' represents mango varieties studied. -#' \item \code{year} the year of harvesting. -#' \item \code{month} the month of harvesting. -#' \item \code{acid} mean of the acidity determined in 3 fruits. +#' +#' \item \code{year} the year of harvesting. +#' +#' \item \code{month} the month of harvesting. +#' +#' \item \code{acid} mean of the acidity determined in 3 fruits. +#' #' } #' #' @docType data @@ -720,11 +784,17 @@ NULL #' plus presence of limestone. #' #' \itemize{ -#' \item \code{N} content of nitrogen in the fertilizer. -#' \item \code{P} content of phosphorus in the fertilizer. -#' \item \code{K} content of potassium in the fertilizer. -#' \item \code{limestone} presence (1) or absence of limestone (0). -#' \item \code{acid} mean of corn yield in 16 locations (ton/ha). +#' +#' \item \code{N} content of nitrogen in the fertilizer. +#' +#' \item \code{P} content of phosphorus in the fertilizer. +#' +#' \item \code{K} content of potassium in the fertilizer. +#' +#' \item \code{limestone} presence (1) or absence of limestone (0). +#' +#' \item \code{acid} mean of corn yield in 16 locations (ton/ha). +#' #' } #' #' @details The experiment was carried out in 16 different locations but @@ -774,13 +844,19 @@ NULL #' branches in coffee trees. #' #' \itemize{ -#' \item \code{N} content of nitrogen in the fertilizer (low/high). -#' \item \code{P} content of phosphorus in the fertilizer (low/high). -#' \item \code{K} content of potassium in the fertilizer (low/high). -#' \item \code{block} an unordered factor representing the blocks +#' +#' \item \code{N} content of nitrogen in the fertilizer (low/high). +#' +#' \item \code{P} content of phosphorus in the fertilizer (low/high). +#' +#' \item \code{K} content of potassium in the fertilizer (low/high). +#' +#' \item \code{block} an unordered factor representing the blocks #' used. -#' \item \code{branches} an integer variable, the number of dry +#' +#' \item \code{branches} an integer variable, the number of dry #' branches in a coffee the. +#' #' } #' #' @details The experiment was carried out in a randomized block design @@ -816,3 +892,307 @@ NULL #' xlab="Nutrient level") #' NULL + +#' @name cottonFert +#' +#' @title A set of experiments in different locations studing NK on +#' cotton +#' +#' @description These data is a set of experiments carried out in +#' different locations studing NK fertilization in cotton. All the 5 +#' experiments are a complete randomized design with 4 replications +#' and 5 levels of fertilization based on N and K levels and a +#' control. +#' +#' \itemize{ +#' +#' \item \code{trt} unordered factor, treatment that consist of 4 cells +#' from a 2^2 factorial design (\eqn{N\times K}) and a control. +#' +#' \item \code{rept} integer, indexes experimental units. +#' +#' \item \code{loc} an unordered factor representing the locations where +#' the experiment was carried out. +#' +#' \item \code{y} numeric, the response variable of the experiment. The +#' text book didn't give details. +#' +#' } +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(cottonFert) +#' +#' @format a \code{data.frame} with 100 records and 4 variables. +#' +#' @source Pimentel Gomes, F. (2009). Curso de Estatística Experimental +#' (15th ed.). Piracicaba, São Paulo: FEALQ. (page 142) +#' +#' @examples +#' +#' library(lattice) +#' +#' data(cottonFert) +#' str(cottonFert) +#' +#' xyplot(y~trt|loc, +#' data=cottonFert, type=c("p", "a"), +#' ylab="y", xlab="Treatment") +#' +#' xyplot(log(y)~trt|loc, +#' data=cottonFert, type=c("p", "a"), +#' ylab="y", xlab="Treatment") +#' +NULL + +#' @name potatoYield2 +#' +#' @title Potato variety competition experiments in several locations +#' +#' @description These data are from a set of experiments done by the +#' engineer Oscar A. Garay at Balcare, Argentina. These experiments +#' were done in a randomized complete block design with 4 blocks and +#' at 7 locations on the potato production region at the Buenos +#' Aires province. +#' +#' \itemize{ +#' +#' \item \code{variety} a categorical unordered factor with 8 levels, +#' varieties of potato. +#' +#' \item \code{loc} a categorical unordered factor with 7 levels, the +#' locations that represent farms or experimental stations. +#' +#' \item \code{sumYield} is the sum of yield for a variety in each +#' experiment. Then, this sum values across 4 blocks in each +#' experiment. To get the mean yield you should divide by 4. Yield +#' is t/ha. +#' +#' } +#' +#' @details The data in the book was not complete because doesn't report +#' individual plot values but, instead, the sum for a variety in +#' each experiment. To do a joint or global analysis, with all +#' locations, varieties and blocks, its necessary all individual +#' plot values. The book report the Mean Square Error estimates for +#' each experiment as an attribute of the object, +#' \code{attr(potatoYield2, "MSE")} and they comes from the ANOVA +#' table in which the model is \code{~block+variety} for each +#' location. The data set \link[legTools]{potatoYield} correspond +#' the location 3. With these MSE is possible use them in a such a +#' way that a partial ANOVA table can be obtained to test the effect +#' of location, variety and its interaction. +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(potatoYield2) +#' +#' @format a \code{data.frame} with 56 records and 3 variables. There is +#' an attribute named \code{MSE}, a named vector containing the Mean +#' Squares Errors estimates for each experiment. +#' +#' @source Pimentel Gomes, F. (2009). Curso de Estatística Experimental +#' (15th ed.). Piracicaba, São Paulo: FEALQ. (page 147) +#' +#' @examples +#' +#' require(lattice) +#' +#' data(potatoYield2) +#' str(potatoYield2) +#' +#' xyplot(sumYield/4~variety, data=potatoYield2, +#' groups=loc, type="o", +#' ylab=expression(Yield~(t~ha^{-1})), +#' xlab="Variety") +#' +NULL + +#' @name castorbeansYield +#' +#' @title Castor beans variety competition experiments in some locations +#' +#' @description These data are from a set of experiments evaluating +#' varieties of castor beans in terms of yield (kg/ha) for some +#' locations (counties). +#' +#' \itemize{ +#' +#' \item \code{variety} a categorical unordered factor with 8 levels, +#' varieties and lines of castor beans. +#' +#' \item \code{loc} a categorical unordered factor with 5 levels, the +#' locations (counties) experimental stations. +#' +#' \item \code{meanYield} is the mean of yield for a variety in each +#' location. So, this the mean across all plots of the same variety +#' in each experiment. +#' +#' } +#' +#' @details The data in the book was not complete because doesn't report +#' individual plot values but the mean for a variety in each single +#' experiment. Neither mention which experimental design was used in +#' each station. The book report the Mean Square Error estimates for +#' each experiment. These values as provided as an attribute of the +#' object, \code{attr(peanut, "MSE")} and they comes from the ANOVA +#' table corresponding to an appropriate model for each +#' location. With these MSE is possible use them in a such a way +#' that a partial ANOVA table can be obtained to test the effect of +#' location, variety and its interaction. +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(castorbeansYield) +#' +#' @format a \code{data.frame} with 45 records and 3 variables. +#' +#' @source Pimentel Gomes, F. (2009). Curso de Estatística Experimental +#' (15th ed.). Piracicaba, São Paulo: FEALQ. (page 149) +#' +#' Souza, O. Ferreira de.; Canecchio, F. V. (1952). Melhoramento de +#' mamoeira, VII. Bragantia 12:301-307. +#' +#' @examples +#' +#' require(lattice) +#' +#' data(castorbeansYield) +#' str(castorbeansYield) +#' +#' xyplot(meanYield~variety, data=castorbeansYield, +#' groups=loc, type="o", +#' ylab=expression(Yield~(t~ha^{-1})), +#' xlab="Variety") +#' +NULL + +#' @name peanutYield +#' +#' @title Peanut variety competition experiments in some locations and +#' years +#' +#' @description These data are from a set of experiments evaluating +#' varieties of peanut in terms of yield (kg/ha) for some locations +#' and years. +#' +#' \itemize{ +#' +#' \item \code{variety} a categorical unordered factor with 4 levels, +#' peanut varieties. +#' +#' \item \code{loc} a categorical unordered factor with 3 levels, the +#' locations (counties) of the experimental stations. +#' +#' \item \code{year} a categorical factor, the crop year. +#' +#' \item \code{meanYield} is the adjusted mean of yield for a variety in +#' each location and year. +#' +#' } +#' +#' @details The data in the book was not complete because doesn't report +#' individual plot values but the adjusted mean for a variety in +#' each single experiment. Neither mention which experimental design +#' was used in each station. The book report the Mean Square Error +#' estimates for each experiment. These values as provided as an +#' attribute of the object, \code{attr(peanut, "MSE")} and they +#' comes from the ANOVA table corresponding to an appropriate model +#' for each location. With these MSE is possible use them in a such +#' a way that a partial ANOVA table can be obtained to test the +#' effect of location, variety and its interaction. +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(peanutYield) +#' +#' @format a \code{data.frame} with 36 records and 4 variables. +#' +#' @source Pimentel Gomes, F. (2009). Curso de Estatística Experimental +#' (15th ed.). Piracicaba, São Paulo: FEALQ. (page 150) +#' +#' Souza, O. Ferreira de.; Abramides, Eduardo. (1952). Ensaios de +#' variedades de amendoim. Bragantia 12:349-358. +#' +#' @examples +#' +#' require(lattice) +#' +#' data(peanutYield) +#' str(peanutYield) +#' +#' xyplot(meanYield~variety|year, data=peanutYield, +#' groups=loc, type="o", +#' ylab=expression(Yield~(t~ha^{-1})), +#' xlab="Variety") +#' +NULL + +#' @name peanutYield2 +#' +#' @title Peanut variety competition experiments in some locations +#' +#' @description These data are from a set of experiments evaluating +#' varieties of peanut in terms of yield (kg/ha) for some locations +#' in different years. +#' +#' \itemize{ +#' +#' \item \code{variety} a categorical unordered factor with 4 levels, +#' peanut varieties. +#' +#' \item \code{loc} a categorical unordered factor with 4 levels, the +#' location:year of the experiment. +#' +#' \item \code{meanYield} is mean of yield for a variety in each +#' location:year. +#' +#' } +#' +#' @details The data in the book was not complete because doesn't report +#' individual plot values but the adjusted mean for a variety in +#' each single experiment. Neither mention which experimental design +#' was used in each station. The book report the Mean Square Error +#' estimates for each experiment. These values as provided as an +#' attribute of the object, \code{attr(peanut, "MSE")} and they +#' comes from the ANOVA table corresponding to an appropriate model +#' for each location. With these MSE is possible use them in a such +#' a way that a partial ANOVA table can be obtained to test the +#' effect of location, variety and its interaction. +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(peanutYield2) +#' +#' @format a \code{data.frame} with 16 records and 3 variables. +#' +#' @source Pimentel Gomes, F. (2009). Curso de Estatística Experimental +#' (15th ed.). Piracicaba, São Paulo: FEALQ. (page 150) +#' +#' Souza, O. Ferreira de.; Abramides, Eduardo. (1952). Ensaios de +#' variedades de amendoim. Bragantia 12:349-358. +#' +#' @examples +#' +#' require(lattice) +#' +#' data(peanutYield2) +#' str(peanutYield2) +#' +#' xyplot(meanYield~variety, data=peanutYield2, +#' groups=loc, type="o", +#' ylab=expression(Yield~(t~ha^{-1})), +#' xlab="Variety") +#' +NULL + diff --git a/data-raw/RData2txt.R b/data-raw/RData2txt.R index 9a80af4869d8892c774488f3498cb7d406a841c9..ed442fec1786582c27bb8cdad50677969de5cd6b 100644 --- a/data-raw/RData2txt.R +++ b/data-raw/RData2txt.R @@ -3,6 +3,7 @@ ## the package. ##====================================================================== +setwd("~/GitLab/legTools/data-raw") f <- list.files(path="../data", pattern="*.RData") sapply(f, diff --git a/data-raw/castorbeansYield.R b/data-raw/castorbeansYield.R new file mode 100644 index 0000000000000000000000000000000000000000..c4069683f0cbe4777012583e1182435739d39f45 --- /dev/null +++ b/data-raw/castorbeansYield.R @@ -0,0 +1,48 @@ +##---------------------------------------------------------------------- +## Data generation. + +castorbeansYield <- expand.grid( + variety=c("V 38", "L 41", "L 168", "L 176", "L 178", "L 881", + "L 882", "L 883", "L 1.000"), + loc=c("Ribeirão Preto", "Pindorama", "Mococa", "Tietê", + "Santa Rita"), + KEEP.OUT.ATTRS=FALSE) + +castorbeansYield$meanYield <- + c(1186, 1219, 1005, 1264, 1272, 1151, 1246, 1223, 1168, 1460, 1598, + 1825, 1394, 1407, 1436, 1291, 1622, 1521, 1832, 1595, 1851, 1613, + 1747, 2297, 2233, 2391, 1992, 1644, 1422, 1458, 1567, 1532, 1532, + 1683, 1699, 1467, 2192, 2294, 1920, 1856, 2178, 2026, 2458, 2040, + 1963) + +addmargins(with(castorbeansYield, + tapply(meanYield, list(variety, loc), FUN=sum))) + +castorbeansYield <- castorbeansYield[with(castorbeansYield, + order(loc, variety)),] + +## Put MSE as an attibute to the data.frame. +mse <- c(29930, 69170, 88210, 35720, 64520) +names(mse) <- levels(castorbeansYield$loc) +attr(castorbeansYield, which="MSE") <- mse +str(castorbeansYield) + +save(castorbeansYield, file="../data/castorbeansYield.RData") + +##---------------------------------------------------------------------- +## Examples. + +require(lattice) + +data(castorbeansYield) +str(castorbeansYield) + +xyplot(meanYield~variety, data=castorbeansYield, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") + +rm(list=ls()) +load("../data/castorbeansYield.RData") +ls() +str(castorbeansYield) diff --git a/data-raw/cottonFert.R b/data-raw/cottonFert.R new file mode 100644 index 0000000000000000000000000000000000000000..b491d9c7fea40909f263ffc96bf4d5c664cc162f --- /dev/null +++ b/data-raw/cottonFert.R @@ -0,0 +1,59 @@ +##---------------------------------------------------------------------- +## Data generation. + +cottonFert <- expand.grid( + ## K=c(-1, 1), + ## N=c(-1, 1), + trt=c("N1K1", "N1K2", "N2K1", "N2K2", "CTRL"), + rept=1:4, + loc=gl(5, 1), + KEEP.OUT.ATTRS=FALSE) + +## x <- scan() +## dput(x/10) + +cottonFert$y <- c(4.2, 3.6, 3.2, 3.6, 2.4, 2.4, 2.2, 2.6, 2.8, 1.2, 2.8, + 1.8, 3, 3, 3, 3.2, 3.2, 2, 2.4, 2.8, 11, 10, 12, 10.5, + 8.5, 10.5, 9.5, 9, 11.5, 8, 9, 9, 9.5, 10.5, 10, 9, 8, + 9.5, 10, 7, 7, 8.5, 9, 9, 7, 7.5, 7, 6, 9.5, 7, 6.5, + 8, 6, 8, 4.5, 5.5, 5.5, 5.5, 7, 6, 8, 8, 7, 9, 3.5, + 6.9, 5.5, 4.7, 6.5, 3, 6, 7.5, 5.5, 5.5, 3.9, 6.5, 8, + 9, 7, 7, 1.72, 2.38, 2.52, 2.78, 1.48, 1.81, 2.56, + 2.88, 3.01, 1.62, 1.73, 2.48, 2.76, 2.83, 1.58, 1.62, + 2.43, 2.54, 2.79, 1.56) + +## Check using the totals. +aggregate(y~loc, data=cottonFert, FUN=sum) + +str(cottonFert) + +save(cottonFert, file="../data/cottonFert.RData") + +##---------------------------------------------------------------------- +## Examples. + +library(lattice) + +data(cottonFert) +str(cottonFert) + +xyplot(y~trt|loc, + data=cottonFert, type=c("p", "a"), + ylab="y", xlab="Treatment") + +xyplot(log(y)~trt|loc, + data=cottonFert, type=c("p", "a"), + ylab="y", xlab="Treatment") + +m0 <- by(data=cottonFert, INDICES=cottonFert$loc, + FUN=lm, formula=y~trt) +lapply(m0, anova) + +m1 <- lm(y~loc*trt, data=cottonFert) + +par(mfrow=c(2,2)); plot(m1); layout(1) +MASS::boxcox(m1) + +m2 <- lm(log(y)~loc*trt, data=cottonFert) +par(mfrow=c(2,2)); plot(m2); layout(1) +anova(m2) diff --git a/data-raw/peanutYield.R b/data-raw/peanutYield.R new file mode 100644 index 0000000000000000000000000000000000000000..d8d3fe5442048db19da024bebb9e68dd97186505 --- /dev/null +++ b/data-raw/peanutYield.R @@ -0,0 +1,42 @@ +##---------------------------------------------------------------------- +## Data generation. Pimentel page 149. + +peanutYield <- expand.grid( + variety=c("40-Roxo", "54-Roxo", "49-Cateto", "53-Tatu"), + loc=c("Campinas", "Ribeirão Preto", "Pindorama"), + year=c("1941-42", "1942-43", "1949-50"), + KEEP.OUT.ATTRS=FALSE) + +peanutYield$meanYield <- + c(1780, 1450, 1430, 790, 690, 470, 520, 280, 4400, 4330, 3440, 3710, + 2610, 2590, 2710, 1590, 1570, 1330, 1500, 1170, 1850, 2010, 2240, + 1790, 2570, 2320, 2130, 2220, 2650, 2740, 1890, 1570, 2100, 2160, + 1570, 870) + +addmargins(with(peanutYield, + tapply(meanYield, list(variety, loc), FUN=sum))) + +peanutYield <- peanutYield[with(peanutYield, + order(year, loc, variety)),] + +str(peanutYield) + +## save(peanutYield, file="../data/peanutYield.RData") + +##---------------------------------------------------------------------- +## Examples. + +require(lattice) + +data(peanutYield) +str(peanutYield) + +xyplot(meanYield~variety|year, data=peanutYield, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") + +rm(list=ls()) +load("../data/peanutYield.RData") +ls() +str(peanutYield) diff --git a/data-raw/peanutYield2.R b/data-raw/peanutYield2.R new file mode 100644 index 0000000000000000000000000000000000000000..86f2650313d3bf5863c786d09620c9c9f99d2600 --- /dev/null +++ b/data-raw/peanutYield2.R @@ -0,0 +1,46 @@ +##---------------------------------------------------------------------- +## Data generation. Pimentel page 156. + +peanutYield2 <- expand.grid( + variety=c("40-Roxo", "54-Roxo", "49-Cateto", "53-Tatu"), + loc=c("Pindorama 49/50", "Ribeirão Preto 49/50", + "Campinas 48/49", "Campinas 42/43"), + KEEP.OUT.ATTRS=FALSE) + +peanutYield2$meanYield <- + c(2100, 2160, 1570, 870, 2650, 2740, 1890, 1570, 2100, 1830, 1890, + 1370, 2710, 2610, 2590, 1590) + +addmargins(with(peanutYield2, + tapply(meanYield, list(variety, loc), FUN=sum))) + +peanutYield2 <- peanutYield2[with(peanutYield2, + order(loc, variety)),] + +str(peanutYield2) + +## Put MSE as an attibute to the data.frame. +mse <- c(52900, 84700, 3970, 106900) +names(mse) <- levels(peanutYield2$loc) +attr(peanutYield2, which="MSE") <- mse +str(peanutYield2) + +save(peanutYield2, file="../data/peanutYield2.RData") + +##---------------------------------------------------------------------- +## Examples. + +require(lattice) + +data(peanutYield2) +str(peanutYield2) + +xyplot(meanYield~variety, data=peanutYield2, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") + +rm(list=ls()) +load("../data/peanutYield2.RData") +ls() +str(peanutYield2) diff --git a/data-raw/potatoYield2.R b/data-raw/potatoYield2.R new file mode 100644 index 0000000000000000000000000000000000000000..1d8b166746df8cebdf9d59c12282ebc76e2584b9 --- /dev/null +++ b/data-raw/potatoYield2.R @@ -0,0 +1,47 @@ +##---------------------------------------------------------------------- +## Data generation. Pimentel page 147. + +potatoYield2 <- expand.grid( + variety=c("Kennebec", "B 25-50 E", "B 1-52", "Huinkul", + "B 116-51", "B 72-53 A", "S. Rafaela", "Buena Vista"), + loc=gl(7, 1), + KEEP.OUT.ATTRS=FALSE) + +potatoYield2$sumYield <- c(470, 483, 646, 822, 611, 694, 685, 477, + 318, 650, 1201, 1205, 1223, 1112, 1176, 426, + 428, 660, 891, 1002, 900, 912, 1018, 497, + 584, 780, 928, 970, 954, 865, 703, 682, + 364, 356, 386, 558, 546, 450, 558, 356, + 482, 358, 439, 624, 523, 519, 488, 496, + 492, 583, 940, 929, 928, 797, 929, 532)/10 + +addmargins(with(potatoYield2, + tapply(sumYield, list(variety, loc), FUN=sum))) + +potatoYield2 <- potatoYield2[with(potatoYield2, order(loc, variety)),] + +## Put MSE as an attibute to the data.frame. +mse <- c(315, 263, 855, 209, 325, 199, 535)/100 +names(mse) <- paste0("loc:", 1:length(mse)) +attr(potatoYield2, which="MSE") <- mse +str(potatoYield2) + +save(potatoYield2, file="../data/potatoYield2.RData") + +##---------------------------------------------------------------------- +## Examples. + +require(lattice) + +data(potatoYield2) +str(potatoYield2) + +xyplot(sumYield/4~variety, data=potatoYield2, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") + +rm(list=ls()) +load("../data/potatoYield2.RData") +ls() +str(potatoYield2) diff --git a/data/castorbeansYield.RData b/data/castorbeansYield.RData new file mode 100644 index 0000000000000000000000000000000000000000..837859cd8adc9ee3311821360b82942865d35f22 Binary files /dev/null and b/data/castorbeansYield.RData differ diff --git a/data/cottonFert.RData b/data/cottonFert.RData new file mode 100644 index 0000000000000000000000000000000000000000..bcaa7cc3daa034575c269eb08eeba25b8f71b353 Binary files /dev/null and b/data/cottonFert.RData differ diff --git a/data/peanutYield.RData b/data/peanutYield.RData new file mode 100644 index 0000000000000000000000000000000000000000..06a7b2e964aa7e469e96365a37982e24467701b4 Binary files /dev/null and b/data/peanutYield.RData differ diff --git a/data/peanutYield2.RData b/data/peanutYield2.RData new file mode 100644 index 0000000000000000000000000000000000000000..af9b2899941710a9a2f5a508afe2765b2917e042 Binary files /dev/null and b/data/peanutYield2.RData differ diff --git a/data/potatoYield2.RData b/data/potatoYield2.RData new file mode 100644 index 0000000000000000000000000000000000000000..ab576be922a9de310910771ac276d2e425f4d382 Binary files /dev/null and b/data/potatoYield2.RData differ diff --git a/man/cassavaYield.Rd b/man/cassavaYield.Rd index 286b7221910bd30610ff7e84a8e499cec3439c92..47eaf16b976943fcfd7b50ca56332560df5f672c 100644 --- a/man/cassavaYield.Rd +++ b/man/cassavaYield.Rd @@ -21,10 +21,13 @@ These data are from an experiment done by The Brazilian (t/ha) was recorded in each experimental unit. \itemize{ - \item \code{block} a categorical unordered factor with 4 levels. - \item \code{variety} a categorical unordered factor with 6 - levels. - \item \code{yield} cassava yield (t/ha). + +\item \code{block} a categorical unordered factor with 4 levels. + +\item \code{variety} a categorical unordered factor with 6 levels. + +\item \code{yield} cassava yield (t/ha). + } } \examples{ diff --git a/man/castorbeansYield.Rd b/man/castorbeansYield.Rd new file mode 100644 index 0000000000000000000000000000000000000000..9aeb846063aa4bf7552b81b2b1f9220a6c95b93a --- /dev/null +++ b/man/castorbeansYield.Rd @@ -0,0 +1,61 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{castorbeansYield} +\alias{castorbeansYield} +\title{Castor beans variety competition experiments in some locations} +\format{a \code{data.frame} with 45 records and 3 variables.} +\source{ +Pimentel Gomes, F. (2009). Curso de Estatística Experimental + (15th ed.). Piracicaba, São Paulo: FEALQ. (page 149) + +Souza, O. Ferreira de.; Canecchio, F. V. (1952). Melhoramento de + mamoeira, VII. Bragantia 12:301-307. +} +\usage{ +data(castorbeansYield) +} +\description{ +These data are from a set of experiments evaluating + varieties of castor beans in terms of yield (kg/ha) for some + locations (counties). + +\itemize{ + +\item \code{variety} a categorical unordered factor with 8 levels, + varieties and lines of castor beans. + +\item \code{loc} a categorical unordered factor with 5 levels, the + locations (counties) experimental stations. + +\item \code{meanYield} is the mean of yield for a variety in each + location. So, this the mean across all plots of the same variety + in each experiment. + +} +} +\details{ +The data in the book was not complete because doesn't report + individual plot values but the mean for a variety in each single + experiment. Neither mention which experimental design was used in + each station. The book report the Mean Square Error estimates for + each experiment. These values as provided as an attribute of the + object, \code{attr(peanut, "MSE")} and they comes from the ANOVA + table corresponding to an appropriate model for each + location. With these MSE is possible use them in a such a way + that a partial ANOVA table can be obtained to test the effect of + location, variety and its interaction. +} +\examples{ +require(lattice) + +data(castorbeansYield) +str(castorbeansYield) + +xyplot(meanYield~variety, data=castorbeansYield, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") +} +\keyword{datasets} + diff --git a/man/coffeeFert.Rd b/man/coffeeFert.Rd index 9632a965d942c237f721ab8542ee6056673d9136..3352cd09e8ad6f91d6ae3a0fc485bcf1f33e37ac 100644 --- a/man/coffeeFert.Rd +++ b/man/coffeeFert.Rd @@ -22,13 +22,19 @@ These data are from a \eqn{2^3} factorial experiment branches in coffee trees. \itemize{ - \item \code{N} content of nitrogen in the fertilizer (low/high). - \item \code{P} content of phosphorus in the fertilizer (low/high). - \item \code{K} content of potassium in the fertilizer (low/high). - \item \code{block} an unordered factor representing the blocks + +\item \code{N} content of nitrogen in the fertilizer (low/high). + +\item \code{P} content of phosphorus in the fertilizer (low/high). + +\item \code{K} content of potassium in the fertilizer (low/high). + +\item \code{block} an unordered factor representing the blocks used. - \item \code{branches} an integer variable, the number of dry + +\item \code{branches} an integer variable, the number of dry branches in a coffee the. + } } \details{ diff --git a/man/cornYield.Rd b/man/cornYield.Rd index 79457d6afe9309b1ce9b1c7163763d6b045afb8f..2ca17abe6b117188fd6849ecbaac6572dd9aca5f 100644 --- a/man/cornYield.Rd +++ b/man/cornYield.Rd @@ -18,11 +18,17 @@ These data are from an \eqn{2^3} factorial experiment (K) on corn yield in a randomized block design. \itemize{ - \item \code{block} a factor with 4 levels. - \item \code{N} low (-1) and high (+1) levels of nitrogen. - \item \code{P} low (-1) and high (+1) levels of phosporus. - \item \code{K} low (-1) and high (+1) levels of potassium. - \item \code{yield} corn yield (ton/ha). + +\item \code{block} a factor with 4 levels. + +\item \code{N} low (-1) and high (+1) levels of nitrogen. + +\item \code{P} low (-1) and high (+1) levels of phosporus. + +\item \code{K} low (-1) and high (+1) levels of potassium. + +\item \code{yield} corn yield (ton/ha). + } } \examples{ diff --git a/man/cornYield2.Rd b/man/cornYield2.Rd index c4f825233b6002cc72778c93ee0b7f1a306d169a..2eacfc1bc662851ea080cb528f34f8871ee7ceff 100644 --- a/man/cornYield2.Rd +++ b/man/cornYield2.Rd @@ -22,11 +22,17 @@ These data are from an axial 3 factorial experiment plus presence of limestone. \itemize{ - \item \code{N} content of nitrogen in the fertilizer. - \item \code{P} content of phosphorus in the fertilizer. - \item \code{K} content of potassium in the fertilizer. - \item \code{limestone} presence (1) or absence of limestone (0). - \item \code{acid} mean of corn yield in 16 locations (ton/ha). + +\item \code{N} content of nitrogen in the fertilizer. + +\item \code{P} content of phosphorus in the fertilizer. + +\item \code{K} content of potassium in the fertilizer. + +\item \code{limestone} presence (1) or absence of limestone (0). + +\item \code{acid} mean of corn yield in 16 locations (ton/ha). + } } \details{ diff --git a/man/cottonFert.Rd b/man/cottonFert.Rd new file mode 100644 index 0000000000000000000000000000000000000000..de1bb95845cff132639583ddec46ecf5bf68c601 --- /dev/null +++ b/man/cottonFert.Rd @@ -0,0 +1,53 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{cottonFert} +\alias{cottonFert} +\title{A set of experiments in different locations studing NK on + cotton} +\format{a \code{data.frame} with 100 records and 4 variables.} +\source{ +Pimentel Gomes, F. (2009). Curso de Estatística Experimental + (15th ed.). Piracicaba, São Paulo: FEALQ. (page 142) +} +\usage{ +data(cottonFert) +} +\description{ +These data is a set of experiments carried out in + different locations studing NK fertilization in cotton. All the 5 + experiments are a complete randomized design with 4 replications + and 5 levels of fertilization based on N and K levels and a + control. + +\itemize{ + +\item \code{trt} unordered factor, treatment that consist of 4 cells + from a 2^2 factorial design (\eqn{N\times K}) and a control. + +\item \code{rept} integer, indexes experimental units. + +\item \code{loc} an unordered factor representing the locations where + the experiment was carried out. + +\item \code{y} numeric, the response variable of the experiment. The + text book didn't give details. + +} +} +\examples{ +library(lattice) + +data(cottonFert) +str(cottonFert) + +xyplot(y~trt|loc, + data=cottonFert, type=c("p", "a"), + ylab="y", xlab="Treatment") + +xyplot(log(y)~trt|loc, + data=cottonFert, type=c("p", "a"), + ylab="y", xlab="Treatment") +} +\keyword{datasets} + diff --git a/man/defoliation.Rd b/man/defoliation.Rd index d6ea686b6656a2322a38fadc52b0bcfb9bd5170c..14b074e2bb9569f0568c65001536a1f2807b5fbd 100644 --- a/man/defoliation.Rd +++ b/man/defoliation.Rd @@ -3,14 +3,14 @@ \docType{data} \name{defoliation} \alias{defoliation} -\title{Bolls in cotton as function of artifitial defoliation} +\title{Bolls in cotton as function of artificial defoliation} \format{a \code{data.frame} with 125 records and 4 variables.} \usage{ data(defoliation) } \description{ This dataset contais the result of a real experiment to - evaluate the effect of artifitial defoliation in combination with + evaluate the effect of artificial defoliation in combination with phenological stage of occurence on the production of cotton represented by the number of bolls produced at the end of the crop cycle. The experiment is a \eqn{5\times 5} factorial with 5 @@ -21,15 +21,21 @@ This dataset contais the result of a real experiment to variance less than the sample mean). \itemize{ -\item \code{phenol} a categorical ordered factor with 5 levels - that represent the phenological stages of the cotton plant in - which defoliation was applied. + +\item \code{phenol} a categorical ordered factor with 5 levels that + represent the phenological stages of the cotton plant in which + defoliation was applied. + \item \code{defol} a numeric factor with 5 levels that represents the artifical level of defoliation (percent in leaf area removed with scissors) applied for all leaves in the plant. -\item \code{rept} index for each experimenal unit in each treatment cell. + +\item \code{rept} index for each experimenal unit in each treatment + cell. + \item \code{bolls} the number of bolls produced (count variable) evaluated at harvest. + } } \details{ diff --git a/man/filterCake.Rd b/man/filterCake.Rd index 8d859f0ae444722d9de14ac21e8d19a7058a9e45..1867586ae5b5b67506cb1706ac2ccf8ce98e3d6e 100644 --- a/man/filterCake.Rd +++ b/man/filterCake.Rd @@ -19,13 +19,18 @@ These data are from an \eqn{2^2} factorial experiment fertilization. \itemize{ - \item \code{block} a factor with 4 levels. - \item \code{mineral} low (-1) and high (+1) levels of mineral + +\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. + +\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{ diff --git a/man/mangoAcidity.Rd b/man/mangoAcidity.Rd index 2185e702f067566c1ce760c5a76e3a10e4ea95df..52cd5fa4c121841f61354e36b3044903155cfaba 100644 --- a/man/mangoAcidity.Rd +++ b/man/mangoAcidity.Rd @@ -21,11 +21,16 @@ These data are from an observational study along 3 years Novermber, December and January. \itemize{ - \item \code{variety} a categorical variable with 6 levels that + +\item \code{variety} a categorical variable with 6 levels that represents mango varieties studied. - \item \code{year} the year of harvesting. - \item \code{month} the month of harvesting. - \item \code{acid} mean of the acidity determined in 3 fruits. + +\item \code{year} the year of harvesting. + +\item \code{month} the month of harvesting. + +\item \code{acid} mean of the acidity determined in 3 fruits. + } } \examples{ diff --git a/man/peanutYield.Rd b/man/peanutYield.Rd new file mode 100644 index 0000000000000000000000000000000000000000..5feba59ba058a6446f2d0f755a249e6d68b91648 --- /dev/null +++ b/man/peanutYield.Rd @@ -0,0 +1,63 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{peanutYield} +\alias{peanutYield} +\title{Peanut variety competition experiments in some locations and + years} +\format{a \code{data.frame} with 36 records and 4 variables.} +\source{ +Pimentel Gomes, F. (2009). Curso de Estatística Experimental + (15th ed.). Piracicaba, São Paulo: FEALQ. (page 150) + +Souza, O. Ferreira de.; Abramides, Eduardo. (1952). Ensaios de + variedades de amendoim. Bragantia 12:349-358. +} +\usage{ +data(peanutYield) +} +\description{ +These data are from a set of experiments evaluating + varieties of peanut in terms of yield (kg/ha) for some locations + and years. + +\itemize{ + +\item \code{variety} a categorical unordered factor with 4 levels, + peanut varieties. + +\item \code{loc} a categorical unordered factor with 3 levels, the + locations (counties) of the experimental stations. + +\item \code{year} a categorical factor, the crop year. + +\item \code{meanYield} is the adjusted mean of yield for a variety in + each location and year. + +} +} +\details{ +The data in the book was not complete because doesn't report + individual plot values but the adjusted mean for a variety in + each single experiment. Neither mention which experimental design + was used in each station. The book report the Mean Square Error + estimates for each experiment. These values as provided as an + attribute of the object, \code{attr(peanut, "MSE")} and they + comes from the ANOVA table corresponding to an appropriate model + for each location. With these MSE is possible use them in a such + a way that a partial ANOVA table can be obtained to test the + effect of location, variety and its interaction. +} +\examples{ +require(lattice) + +data(peanutYield) +str(peanutYield) + +xyplot(meanYield~variety|year, data=peanutYield, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") +} +\keyword{datasets} + diff --git a/man/peanutYield2.Rd b/man/peanutYield2.Rd new file mode 100644 index 0000000000000000000000000000000000000000..ebd061cded8fbde9843ec256504ca657d62e58ff --- /dev/null +++ b/man/peanutYield2.Rd @@ -0,0 +1,60 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{peanutYield2} +\alias{peanutYield2} +\title{Peanut variety competition experiments in some locations} +\format{a \code{data.frame} with 16 records and 3 variables.} +\source{ +Pimentel Gomes, F. (2009). Curso de Estatística Experimental + (15th ed.). Piracicaba, São Paulo: FEALQ. (page 150) + +Souza, O. Ferreira de.; Abramides, Eduardo. (1952). Ensaios de + variedades de amendoim. Bragantia 12:349-358. +} +\usage{ +data(peanutYield2) +} +\description{ +These data are from a set of experiments evaluating + varieties of peanut in terms of yield (kg/ha) for some locations + in different years. + +\itemize{ + +\item \code{variety} a categorical unordered factor with 4 levels, + peanut varieties. + +\item \code{loc} a categorical unordered factor with 4 levels, the + location:year of the experiment. + +\item \code{meanYield} is mean of yield for a variety in each + location:year. + +} +} +\details{ +The data in the book was not complete because doesn't report + individual plot values but the adjusted mean for a variety in + each single experiment. Neither mention which experimental design + was used in each station. The book report the Mean Square Error + estimates for each experiment. These values as provided as an + attribute of the object, \code{attr(peanut, "MSE")} and they + comes from the ANOVA table corresponding to an appropriate model + for each location. With these MSE is possible use them in a such + a way that a partial ANOVA table can be obtained to test the + effect of location, variety and its interaction. +} +\examples{ +require(lattice) + +data(peanutYield2) +str(peanutYield2) + +xyplot(meanYield~variety, data=peanutYield2, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") +} +\keyword{datasets} + diff --git a/man/plowing.Rd b/man/plowing.Rd index 3330108ceb25433beb9f604f9c414ef22b4129e9..9af9b022c7f8bb9983276754ede7647ef18f64ed 100644 --- a/man/plowing.Rd +++ b/man/plowing.Rd @@ -22,9 +22,13 @@ These data are from an experiment done by the engineer units for each factor level in each block. \itemize{ - \item \code{block} a categorical unordered factor with 6 levels. - \item \code{plow} a categorical unordered factor with 2 levels. - \item \code{yield} corn yield (kg in 200 m\eqn{^2} of area). + +\item \code{block} a categorical unordered factor with 6 levels. + +\item \code{plow} a categorical unordered factor with 2 levels. + +\item \code{yield} corn yield (kg in 200 m\eqn{^2} of area). + } } \examples{ diff --git a/man/potatoYield.Rd b/man/potatoYield.Rd index 39588d387b36392e93ffd45ba231c855bb7e75f2..416c7135e404946fab568a4148724209adb1669e 100644 --- a/man/potatoYield.Rd +++ b/man/potatoYield.Rd @@ -19,10 +19,13 @@ These data are from an experiment done by the engineer (t/ha) was recorded in each experimental unit. \itemize{ - \item \code{block} a categorical unordered factor with 4 levels. - \item \code{variety} a categorical unordered factor with 8 - levels. - \item \code{yield} potato yield (t/ha). + +\item \code{block} a categorical unordered factor with 4 levels. + +\item \code{variety} a categorical unordered factor with 8 levels. + +\item \code{yield} potato yield (t/ha). + } } \examples{ diff --git a/man/potatoYield2.Rd b/man/potatoYield2.Rd new file mode 100644 index 0000000000000000000000000000000000000000..9dfc732ffe57a722453c1313792d0dd784a11d4b --- /dev/null +++ b/man/potatoYield2.Rd @@ -0,0 +1,65 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{potatoYield2} +\alias{potatoYield2} +\title{Potato variety competition experiments in several locations} +\format{a \code{data.frame} with 56 records and 3 variables. There is + an attribute named \code{MSE}, a named vector containing the Mean + Squares Errors estimates for each experiment.} +\source{ +Pimentel Gomes, F. (2009). Curso de Estatística Experimental + (15th ed.). Piracicaba, São Paulo: FEALQ. (page 147) +} +\usage{ +data(potatoYield2) +} +\description{ +These data are from a set of experiments done by the + engineer Oscar A. Garay at Balcare, Argentina. These experiments + were done in a randomized complete block design with 4 blocks and + at 7 locations on the potato production region at the Buenos + Aires province. + +\itemize{ + +\item \code{variety} a categorical unordered factor with 8 levels, + varieties of potato. + +\item \code{loc} a categorical unordered factor with 7 levels, the + locations that represent farms or experimental stations. + +\item \code{sumYield} is the sum of yield for a variety in each + experiment. Then, this sum values across 4 blocks in each + experiment. To get the mean yield you should divide by 4. Yield + is t/ha. + +} +} +\details{ +The data in the book was not complete because doesn't report + individual plot values but, instead, the sum for a variety in + each experiment. To do a joint or global analysis, with all + locations, varieties and blocks, its necessary all individual + plot values. The book report the Mean Square Error estimates for + each experiment as an attribute of the object, + \code{attr(potatoYield2, "MSE")} and they comes from the ANOVA + table in which the model is \code{~block+variety} for each + location. The data set \link[legTools]{potatoYield} correspond + the location 3. With these MSE is possible use them in a such a + way that a partial ANOVA table can be obtained to test the effect + of location, variety and its interaction. +} +\examples{ +require(lattice) + +data(potatoYield2) +str(potatoYield2) + +xyplot(sumYield/4~variety, data=potatoYield2, + groups=loc, type="o", + ylab=expression(Yield~(t~ha^{-1})), + xlab="Variety") +} +\keyword{datasets} + diff --git a/man/sugarcaneYield.Rd b/man/sugarcaneYield.Rd index c5fa0523d8f5495aeb00db6fc71615c9039eb475..38910e1ccbc27acd87efc6e101228d37a4eb1466 100644 --- a/man/sugarcaneYield.Rd +++ b/man/sugarcaneYield.Rd @@ -19,10 +19,13 @@ These data are from an experiment done by The West São (kg/plot) was recorded in each experimental unit. \itemize{ - \item \code{block} a categorical unordered factor with 4 levels. - \item \code{variety} a categorical unordered factor with 7 - levels. - \item \code{yield} sugarcane yield (kg/plot). + +\item \code{block} a categorical unordered factor with 4 levels. + +\item \code{variety} a categorical unordered factor with 7 levels. + +\item \code{yield} sugarcane yield (kg/plot). + } } \examples{ diff --git a/man/sugarcaneYield2.Rd b/man/sugarcaneYield2.Rd index 40272aabfac363a7e2382659cca2b77a05bab4ef..6479a1f392c7e6f7df9c727635cc9f867c7048fb 100644 --- a/man/sugarcaneYield2.Rd +++ b/man/sugarcaneYield2.Rd @@ -18,14 +18,18 @@ These data are from an experiment done in a latin square experimental unit. \itemize{ - \item \code{row} the rows of the latin square that controls in - one dimention. A categorical unordered factor with 5 levels. - \item \code{col} the columns of the latin square that controls in - one dimention perpendicular to the previus. A categorical - unordered factor with 5 levels. - \item \code{variety} a categorical unordered factor with 5 - levels. - \item \code{yield} sugarcane yield (kg/plot). + +\item \code{row} the rows of the latin square that controls in one + dimention. A categorical unordered factor with 5 levels. + +\item \code{col} the columns of the latin square that controls in one + dimention perpendicular to the previus. A categorical unordered + factor with 5 levels. + +\item \code{variety} a categorical unordered factor with 5 levels. + +\item \code{yield} sugarcane yield (kg/plot). + } } \examples{ diff --git a/man/sugarcaneYield3.Rd b/man/sugarcaneYield3.Rd index 48a9945d9b93f950c23bfe9bc13974093845cc04..ce7179df94b2482b1534c2b706c886e57e5e902b 100644 --- a/man/sugarcaneYield3.Rd +++ b/man/sugarcaneYield3.Rd @@ -18,16 +18,21 @@ These data are from an experiment done in a latin square experimental unit. \itemize{ - \item \code{row} the rows of the latin square that controls in - one dimention. A categorical unordered factor with 6 levels. - \item \code{col} the columns of the latin square that controls in - one dimention perpendicular to the previus. A categorical - unordered factor with 6 levels. - \item \code{fertil} a categorical unordered factor with 6 - levels that is the fertilization strategy applied. These levels - are a result of treatment cells in a three incomplete factorial + +\item \code{row} the rows of the latin square that controls in one + dimention. A categorical unordered factor with 6 levels. + +\item \code{col} the columns of the latin square that controls in one + dimention perpendicular to the previus. A categorical unordered + factor with 6 levels. + +\item \code{fertil} a categorical unordered factor with 6 levels that + is the fertilization strategy applied. These levels are a result + of treatment cells in a three incomplete factorial arrangrment. See detais for more information. - \item \code{yield} sugarcane yield (kg/plot). + +\item \code{yield} sugarcane yield (kg/plot). + } } \details{ @@ -58,7 +63,8 @@ levelplot(yield~row+col, colors=brewer.pal(n=11, name="Spectral")))+ layer(with(sugarcaneYield3, panel.text(x=row, y=col, - label=sprintf("\%s\\n\%0.2f", fertil, yield)))) + label=sprintf("\%s\\n\%0.2f", + fertil, yield)))) aggregate(yield~row, data=sugarcaneYield3, FUN=mean) aggregate(yield~col, data=sugarcaneYield3, FUN=mean) diff --git a/man/sugarcaneYield4.Rd b/man/sugarcaneYield4.Rd index 93ff7e03adc8b270f250fbdf9603f718b05c2207..d86df2ed284bcaed511dc6b781d9aec4ac990e2b 100644 --- a/man/sugarcaneYield4.Rd +++ b/man/sugarcaneYield4.Rd @@ -17,12 +17,19 @@ These data are from an \eqn{3^3} factorial experiment studing the effect of NPK on the yield of sugar cane. \itemize{ + \item \code{block} a local control factor with 3 levels. + \item \code{rept} factor with 2 levels. + \item \code{N} integer coded nitrogen levels (0, 1, 2). + \item \code{P} integer coded phosphorus levels (0, 1, 2). + \item \code{K} integer coded potassium levels (0, 1, 2). + \item \code{yield} sugar cane yield (ton/ha). + } } \details{ diff --git a/man/vinasseFert.Rd b/man/vinasseFert.Rd index def3ee5bcde5361b33d18d242fe70ee7b192b901..592c58f7bcda015b6762e48b2b129e3724d216f6 100644 --- a/man/vinasseFert.Rd +++ b/man/vinasseFert.Rd @@ -19,13 +19,18 @@ These data are from an \eqn{2^2} factorial experiment fertilization. \itemize{ - \item \code{block} a factor with 4 levels. - \item \code{mineral} low (-1) and high (+1) levels of mineral + +\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. + +\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{ diff --git a/man/wgPigs.Rd b/man/wgPigs.Rd index 5efbb505e2b01be6f723391fff87bffd2dd3200f..4478034b86c4b490f5e050352026d4b9e6361e6a 100644 --- a/man/wgPigs.Rd +++ b/man/wgPigs.Rd @@ -13,18 +13,20 @@ Pimentel Gomes, F. (2009). Curso de Estatística Experimental data(wgPigs) } \description{ -This is an artifial dataset corresponding a experiment - to study the effect of feeding type (factor with 4 categorical - nominal levels) in pig weight gain. The experiment was a - randomized complete design with five experimental units per +This is an artificial data set corresponding a + experiment to study the effect of feeding type (factor with 4 + categorical nominal levels) in pig weight gain. The experiment + was a randomized complete design with five experimental units per treatment level. The experimental unit was a pig. The response - measured was weight gain from the beggining to the end of the + measured was weight gain from the beginning to the end of the experiment. \itemize{ - \item \code{ft} feeding type, a categorical factor with 4 - levels. - \item \code{wg} weight gain (kg). + +\item \code{ft} feeding type, a categorical factor with 4 levels. + +\item \code{wg} weight gain (kg). + } } \examples{ diff --git a/man/wgPigs2.Rd b/man/wgPigs2.Rd index 697f2abd3a8b7f6ed2b907e3aa81bfc5c9142629..54cdb89c754ef45dc4635596487d401f215bc7a1 100644 --- a/man/wgPigs2.Rd +++ b/man/wgPigs2.Rd @@ -22,15 +22,20 @@ This is an artifial dataset corresponding a experiment experiment. \itemize{ - \item \code{litter} a categorical factor with 4 levels that + +\item \code{litter} a categorical factor with 4 levels that represents the rows of the lattin square design and control for the differences among litters. - \item code{size} a categorical ordered variable that represents the + +\item code{size} a categorical ordered variable that represents the columns of latin square desing and control for the weight of the animals at the beggining of the experiment. - \item \code{age} age of the animal (days) when castration was + +\item \code{age} age of the animal (days) when castration was done. \code{controls} are the animals without castration. - \item \code{wg} weight gain (kg) after 252 days. + +\item \code{wg} weight gain (kg) after 252 days. + } } \examples{