diff --git a/NAMESPACE b/NAMESPACE index b532e33515696adefe8e39d8db9887535e677382..e7def8d305e7fdaea655ca4109a1d38fb49c49ea 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,8 @@ # Generated by roxygen2 (4.1.1): do not edit by hand +export(apcMatrix) export(biasBox) +export(equalizeLevels) export(knit2wpCrayon) export(loessGui) export(panel.segplot.by) diff --git a/man/apcMatrix.Rd b/man/apcMatrix.Rd new file mode 100644 index 0000000000000000000000000000000000000000..93aaab8bc45e17ec05051995cf9685a847117e1b --- /dev/null +++ b/man/apcMatrix.Rd @@ -0,0 +1,61 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/apcMatrix.R +\name{apcMatrix} +\alias{apcMatrix} +\title{All pairwise comparisons matrix (Tukey contrasts)} +\usage{ +apcMatrix(lfm, lev = NULL) +} +\arguments{ +\item{lfm}{a \eqn{k\times p} matrix where each line defines a linear + function to estimate a lsmean (or any linear function). In + general, these matrices are obtained using + \code{doBy::LSmatrix()}.} + +\item{lev}{a character vector with dimension equals to the numbers of + lines of \code{lfm} matrix (\eqn{k}). Default is \code{NULL} and + the row names of code{lfm} is used. If row names is also + \code{NULL}, an integer sequence is used to identify the + comparisons.} +} +\value{ +a \eqn{K\times p} matrix with the linear functions that + define all pairwise contrasts. \eqn{K} is \eqn{k\choose 2}. +} +\description{ +This function takes a matrix where each line defines a + linear function of the parameters to estimate a marginal mean + (aka least squares means) and return the matrix that define the + contrasts among these means. All pairwise contrasts are returned + (aka Tukey contrasts). The matrix with these contrasts can be + passed to \code{multcomp::glht()} to estimate them or used in + explicit matricial calculus. +} +\examples{ +## A matrix of linear functions corresponding to the cell means +## parametrization. +X <- diag(4) + +## If no rownames an integer sequence is used. +rownames(X) +apcMatrix(X) + +## With rownames, those are used. +rownames(X) <- letters[nrow(X):1] +apcMatrix(X) + +## Passing names by the argument `lev=`. +apcMatrix(X, lev=LETTERS[1:nrow(X)]) + +## Using the special case with attribute "grid" present in matrices +## returned by doBy::LSmeans() and doBy::LSmatrix(). +attr(X, "grid") <- data.frame(n=LETTERS[1:nrow(X)]) +apcMatrix(X) +} +\author{ +Walmes Zeviani, \email{walmes@ufpr.br} +} +\seealso{ +\link[doBy]{LSmatrix}. +} + diff --git a/man/equalizeLevels.Rd b/man/equalizeLevels.Rd new file mode 100644 index 0000000000000000000000000000000000000000..3326c3332955207153eaeaaa2dea939b5fbc431f --- /dev/null +++ b/man/equalizeLevels.Rd @@ -0,0 +1,49 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/equalizeLevels.R +\name{equalizeLevels} +\alias{equalizeLevels} +\title{Make that to data frames have the same factor levels} +\usage{ +equalizeLevels(target, ref) +} +\arguments{ +\item{target}{the target data frame that will have factor levels +reordered.} + +\item{ref}{the reference data frame that contains the desired level + order.} +} +\value{ +the first data data frame with the levels in a new order. +} +\description{ +If two data frames have factor or character columns with + the same name, those in the first will have the same level order + as those in the second. So, in terms of factor columns, these + data frames will have the same levels in the same + order. Character columns in the first will be converted to factor + if they aren't. This function is useful to assing to the data + frame returned in the \code{grid} attribute returned by + \code{doBy::LSmeans()} or \code{doBy::LSmatrix()} the same order + to the levels present in the data frame used to fit the model and + estimate the parameters. +} +\examples{ +a <- data.frame( + Species=as.character(sample(iris$Species, size=10, replace=TRUE)), + stringsAsFactors=FALSE) +str(a) + +levels(a$Species) +levels(iris$Species) + +b <- equalizeLevels(target=a, ref=iris) +str(b) +} +\author{ +Walmes Zeviani, \email{walmes@ufpr.br} +} +\seealso{ +\link[doBy]{LSmeans}, \link[doBy]{LSmatrix}. +} +