From 74783f7e58723904b18fb7cc2edf8718a92ecfd9 Mon Sep 17 00:00:00 2001 From: Unknown author Date: Wed, 9 Feb 2000 00:00:00 +0000 Subject: [PATCH] version 0.1-1 --- DESCRIPTION | 12 + INDEX | 23 ++ R/zzz.R | 25 ++ TITLE | 1 + Usinglme.bib | 21 + Usinglme.tex | 285 ++++++++++++++ data/00Index | 23 ++ data/Animal.R | 21 + data/AvgDailyGain.R | 35 ++ data/BIB.R | 26 ++ data/Bond.R | 21 + data/Cultivation.R | 25 ++ data/Demand.R | 75 ++++ data/Genetics.R | 34 ++ data/HR.R | 67 ++++ data/IncBlk.R | 28 ++ data/Mississippi.R | 25 ++ data/Multilocation.R | 85 +++++ data/PBIB.R | 30 ++ data/SIMS.R | 717 +++++++++++++++++++++++++++++++++++ data/Semi2.R | 44 +++ data/Semiconductor.R | 40 ++ data/TeachingI.R | 62 +++ data/TeachingII.R | 57 +++ data/WWheat.R | 34 ++ data/WaferTypes.R | 104 +++++ data/Weights.R | 144 +++++++ defs.tex | 51 +++ man/Animal.Rd | 35 ++ man/AvgDailyGain.Rd | 59 +++ man/BIB.Rd | 55 +++ man/Bond.Rd | 45 +++ man/Cultivation.Rd | 55 +++ man/Demand.Rd | 66 ++++ man/Genetics.Rd | 42 ++ man/HR.Rd | 61 +++ man/IncBlk.Rd | 37 ++ man/Mississippi.Rd | 52 +++ man/Multilocation.Rd | 82 ++++ man/PBIB.Rd | 41 ++ man/SIMS.Rd | 43 +++ man/Semi2.Rd | 55 +++ man/Semiconductor.Rd | 53 +++ man/TeachingI.Rd | 47 +++ man/TeachingII.Rd | 45 +++ man/WWheat.Rd | 35 ++ man/WaferTypes.Rd | 53 +++ man/Weights.Rd | 66 ++++ transcripts/AvgDGain.St | 96 +++++ transcripts/AvgDGain.q | 11 + transcripts/Bond.St | 79 ++++ transcripts/Bond.q | 21 + transcripts/CultMiss.St | 93 +++++ transcripts/CultMiss.q | 17 + transcripts/Cultivar.St | 102 +++++ transcripts/Cultivar.q | 19 + transcripts/Demand.St | 59 +++ transcripts/Demand.q | 13 + transcripts/Genetics.St | 73 ++++ transcripts/Genetics.q | 10 + transcripts/HR.St | 200 ++++++++++ transcripts/HR.q | 21 + transcripts/Mississippi.St | 132 +++++++ transcripts/Mississippi.q | 23 ++ transcripts/Multilocation.St | 512 +++++++++++++++++++++++++ transcripts/Multilocation.q | 32 ++ transcripts/PBIB.St | 158 ++++++++ transcripts/PBIB.q | 18 + transcripts/README | 45 +++ transcripts/SIMS.St | 67 ++++ transcripts/SIMS.q | 14 + transcripts/Semi2.St | 174 +++++++++ transcripts/Semi2.q | 22 ++ transcripts/Semiconductor.St | 117 ++++++ transcripts/Semiconductor.q | 23 ++ transcripts/Weights.St | 217 +++++++++++ transcripts/Weights.q | 24 ++ 77 files changed, 5534 insertions(+) create mode 100644 DESCRIPTION create mode 100644 INDEX create mode 100644 R/zzz.R create mode 100644 TITLE create mode 100644 Usinglme.bib create mode 100644 Usinglme.tex create mode 100644 data/00Index create mode 100644 data/Animal.R create mode 100644 data/AvgDailyGain.R create mode 100644 data/BIB.R create mode 100644 data/Bond.R create mode 100644 data/Cultivation.R create mode 100644 data/Demand.R create mode 100644 data/Genetics.R create mode 100644 data/HR.R create mode 100644 data/IncBlk.R create mode 100644 data/Mississippi.R create mode 100644 data/Multilocation.R create mode 100644 data/PBIB.R create mode 100644 data/SIMS.R create mode 100644 data/Semi2.R create mode 100644 data/Semiconductor.R create mode 100644 data/TeachingI.R create mode 100644 data/TeachingII.R create mode 100644 data/WWheat.R create mode 100644 data/WaferTypes.R create mode 100644 data/Weights.R create mode 100644 defs.tex create mode 100644 man/Animal.Rd create mode 100644 man/AvgDailyGain.Rd create mode 100644 man/BIB.Rd create mode 100644 man/Bond.Rd create mode 100644 man/Cultivation.Rd create mode 100644 man/Demand.Rd create mode 100644 man/Genetics.Rd create mode 100644 man/HR.Rd create mode 100644 man/IncBlk.Rd create mode 100644 man/Mississippi.Rd create mode 100644 man/Multilocation.Rd create mode 100644 man/PBIB.Rd create mode 100644 man/SIMS.Rd create mode 100644 man/Semi2.Rd create mode 100644 man/Semiconductor.Rd create mode 100644 man/TeachingI.Rd create mode 100644 man/TeachingII.Rd create mode 100644 man/WWheat.Rd create mode 100644 man/WaferTypes.Rd create mode 100644 man/Weights.Rd create mode 100644 transcripts/AvgDGain.St create mode 100644 transcripts/AvgDGain.q create mode 100644 transcripts/Bond.St create mode 100644 transcripts/Bond.q create mode 100644 transcripts/CultMiss.St create mode 100644 transcripts/CultMiss.q create mode 100644 transcripts/Cultivar.St create mode 100644 transcripts/Cultivar.q create mode 100644 transcripts/Demand.St create mode 100644 transcripts/Demand.q create mode 100644 transcripts/Genetics.St create mode 100644 transcripts/Genetics.q create mode 100644 transcripts/HR.St create mode 100644 transcripts/HR.q create mode 100644 transcripts/Mississippi.St create mode 100644 transcripts/Mississippi.q create mode 100644 transcripts/Multilocation.St create mode 100644 transcripts/Multilocation.q create mode 100644 transcripts/PBIB.St create mode 100644 transcripts/PBIB.q create mode 100644 transcripts/README create mode 100644 transcripts/SIMS.St create mode 100644 transcripts/SIMS.q create mode 100644 transcripts/Semi2.St create mode 100644 transcripts/Semi2.q create mode 100644 transcripts/Semiconductor.St create mode 100644 transcripts/Semiconductor.q create mode 100644 transcripts/Weights.St create mode 100644 transcripts/Weights.q diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..6ba5e2a --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,12 @@ +Package: SASmixed +Version: 0.1-1 +Date: 2000/02/09 +Title: Data sets from "SAS System for Mixed Models" +Author: Original by Littel, Milliken, Stroup, and Wolfinger + modifications by Douglas Bates and + Jose Pinheiro +Description: Data sets and sample lme analyses corresponding + to the examples in Littel, Milliken, Stroup and Wolfinger + (1996), "SAS System for Mixed Models", SAS Institute. +Depends: nlme +License: GPL version 2 or later diff --git a/INDEX b/INDEX new file mode 100644 index 0000000..7cc8719 --- /dev/null +++ b/INDEX @@ -0,0 +1,23 @@ +Animal Animal breeding experiment +AvgDailyGain Average daily weight gain of steers on different + diets +BIB Data from a balanced incomplete block design +Bond Strengths of metal bonds +Cultivation Bacterial innoculation applied to grass + cultivars +Demand Per-capita demand deposits by state and year +Genetics Heritability data +HR Heart rates of patients on different drug + treatments +IncBlk An unbalanced incomplete block experiment +Mississippi Nitrogen concentrations in the Mississippi River +Multilocation A multilocation trial +PBIB A partially balanced incomplete block experiment +SIMS Second International Mathematics Study data +Semi2 Oxide layer thicknesses on semiconductors +Semiconductor Semiconductor split-plot experiment +TeachingI Teaching Methods I +TeachingII Teaching Methods II +WWheat Winter wheat +WaferTypes Data on different types of silicon wafers +Weights Data from a weight-lifting program diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..952491c --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,25 @@ +### $Id: zzz.R,v 1.1 2000/02/09 18:41:49 bates Exp $ +### +### Sample analyses of data from SAS System for Mixed Models +### +### Copyright 2000-2000 Douglas M. Bates +### +### +### This file is part of the SASmixed library for R and related languages. +### It is made available under the terms of the GNU General Public +### License, version 2, or at your option, any later version, +### incorporated herein by reference. +### +### This program is distributed in the hope that it will be +### useful, but WITHOUT ANY WARRANTY; without even the implied +### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +### PURPOSE. See the GNU General Public License for more +### details. +### +### You should have received a copy of the GNU General Public +### License along with this program; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA + +### Force loading of the nlme package for the examples. +require(nlme) diff --git a/TITLE b/TITLE new file mode 100644 index 0000000..000e758 --- /dev/null +++ b/TITLE @@ -0,0 +1 @@ +SASmixed Data sets from "SAS System for Mixed Models" diff --git a/Usinglme.bib b/Usinglme.bib new file mode 100644 index 0000000..8f4238b --- /dev/null +++ b/Usinglme.bib @@ -0,0 +1,21 @@ +@String{id = "$Id: Usinglme.bib,v 1.1 1999/10/13 00:50:09 saikat Exp $"} + +@Article{ lair:ware:1982, + author = {Laird, Nan M. and Ware, James H.}, + title = {Random-effects Models for Longitudinal Data}, + journal = {Biometrics}, + year = 1982, + volume = 38, + pages = {963--974}, + keywords = {Variance components; Repeated measurements; Empirical + Bayes; EM algorithm} +} + +@Book{litt:mill:stro:wolf:1996, + author = {Ramon C. Littell and George A. Milliken and Walter + W. Stroup and Russell D. Wolfinger}, + title = {SAS System for Mixed Models}, + publisher = {SAS Institute, Inc.}, + year = 1996 +} + diff --git a/Usinglme.tex b/Usinglme.tex new file mode 100644 index 0000000..bbfecdf --- /dev/null +++ b/Usinglme.tex @@ -0,0 +1,285 @@ +%%% $Id: Usinglme.tex,v 1.1 1999/10/13 00:50:09 saikat Exp $ +\documentclass[]{article} +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\usepackage[dcu,dcucite]{harvard} +\usepackage{times} +\usepackage{amsbsy} +\usepackage{amsmath} +\usepackage{graphicx} +\usepackage{alltt} +\graphicspath{{figs/}} +\DeclareGraphicsExtensions{.epsi.gz,.epsi,.eps.gz,.eps,.ps,.ps.gz} +\DeclareGraphicsRule{*}{eps}{*}{} +\DeclareGraphicsRule{.epsi.gz}{eps}{.bb}{`zcat #1} +\DeclareGraphicsRule{.eps.gz}{eps}{.bb}{`zcat #1} +\DeclareGraphicsRule{.ps.gz}{eps}{.bb}{`zcat #1} +\setkeys{Gin}{width=\textwidth} +\input{defs} +\newenvironment{Example}% +{\begin{list}{}{\setlength{\leftmargin}{.5\parindent}}% + \item\begin{alltt}\small}% + {\end{alltt}\end{list}} +\pagenumbering{arabic} +\begin{document} +\title{\textbf{\textsf{lme} for \textsf{SAS PROC MIXED} Users}} +\author{Douglas M.~Bates\smallskip\\ + \textsf{\normalsize Department of Statistics}\\[-0.3ex] + \textsf{\normalsize University of Wisconsin -- Madison} + \thanks{This research was supported by the National Science + Foundation through grant DMS-9704349.} + \and Jos\'e C.~Pinheiro\smallskip\\ + \textsf{\normalsize Bell Laboratories}\\[-0.3ex] + \textsf{\normalsize Lucent Technologies}} +\date{} +\maketitle + +\section{Introduction} +\label{sec:intro} + +The \Co{lme} function from the \Co{nlme} library for \Splus{} or the +\Co{lme} library for \R{} is used to fit linear mixed-effects models. +It is similar in scope to the \textsf{SAS} procedure \Co{PROC MIXED} +described in \citeasnoun{litt:mill:stro:wolf:1996}. + +A file on the SAS Institute web site (\textsf{http://www.sas.com}) +contains all the data sets in the book and all the SAS programs used +in \citeasnoun{litt:mill:stro:wolf:1996}. We have converted the data +sets from the tabular representation used for SAS to the +\Co{groupedData} objects used by \Co{lme}. To help users familiar +with \Co{SAS PROC MIXED} get up to speed with \Co{lme} more quickly, +we provide transcripts of some \Co{lme} analyses paralleling the +\Co{SAS PROC MIXED} analyses in \citeasnoun{litt:mill:stro:wolf:1996}. + +In this paper we highlight some of the similarities and differences of +\Co{lme} analysis and \Co{SAS PROC MIXED} analysis. + +\section{Similarities between lme and SAS PROC MIXED} +\label{sec:similarities} + +Both \Co{SAS PROC MIXED} and \Co{lme} can fit linear mixed-effects +models expressed in the Laird-Ware formulation. For a single level of +grouping \citeasnoun{lair:ware:1982} write the $n_i\/$-dimensional +response vector $\by_i$ for the $i\/$th experimental unit as +\begin{gather} + \label{eqn:oneLevel} + \by_i = \bX_i \bbeta + \bZ_i \bb_i + \beps_i,\quad i=1,\dots,M\\ + \bb_i\sim\gaus(\bzer,\bSigma), + \quad\beps_i\sim\gaus(\bzer,\sigma^2 \bI)\notag +\end{gather} +where $\bbeta$ is the $p$-dimensional vector of \emph{fixed effects}, +$\bb_i$ is the $q$-dimensional vector of \emph{random effects}, +$\bX_i$ (of size $n_i\times p$) and $\bZ_i$ (of size $n_i\times q$) +are known fixed-effects and random-effects regressor matrices, and +$\beps_i$ is the $n_i\/$-dimensional \emph{within-group error} vector +with a spherical Gaussian distribution. The assumption +$\mathrm{Var}(\beps_i)=\sigma^2\bI$ can be relaxed using additional +arguments in the model fitting. + +The basic specification of the model requires a linear model +expression for the fixed effects and a linear model expression for the +random effects. In \Co{SAS PROC MIXED} the fixed-effects part is +specified in the \Co{model} statement and the random-effects +part in the \Co{random} statement. In \Co{lme} the +arguments are called \Co{fixed} and \Co{random}. + +Both \Co{SAS PROC MIXED} and \Co{lme} allow a mixed-effects model to +be fit by maximum likelihood (\Co{method = ml} in SAS) or by maximum +residual likelihood, sometimes also called restricted maximum +likelihood or \textsf{REML}. This is the default criterion in \Co{SAS + PROC MIXED}. The default criterion in \Co{lme} is maximum +likelihood. To get \textsf{REML} estimates in \Co{lme}, set the +optional argument \Co{REML=TRUE}. + + +\section{Important differences} +\label{sec:differences} + +One of the most important differences has just been stated but is +worth repeating. SAS defaults to \textsf{REML} fits; \Co{lme} +defaults to maximum likelihood fits. + +The output from \Co{PROC MIXED} typically includes values of the +Akaike Information Criterion (\textsf{AIC}) and Schwartz's Bayesian +Criterion (\textsf{SBC}). These are used to compare different models +fit to the same data. The output of the \Co{summary} function applied +to the object created by \Co{lme} also produces values of \textsf{AIC} +and \textsf{BIC} but the definitions used in \Co{PROC MIXED} and in +\Co{lme} are different. In \Co{lme} the definitions are such that +``smaller is better''. In \Co{PROC MIXED} the definitions are such +that ``bigger is better''. + +When models are fit by \textsf{REML}, the values of \textsf{AIC}, +\textsf{SBC} (or \textsf{BIC}) and the log-likelihood can only be +compared between models with exactly the same fixed-effects structure. +When models are fit by maximum likelihood these criteria can be +compared between any models fit to the same data. That is, these +quality-of-fit criteria can be used to evaluate different +fixed-effects specifications or different random-effects +specifications or different specifications of both fixed effects and +random effects. The greater flexibility of model comparisons when +using maximum likelihood is the reason that this is the default +criterion in \Co{lme}. + +We encourage developing and testing the model using likelihood ratio +tests or the \textsf{AIC} and \textsf{BIC} criteria. Once a form +for both the random effects and the fixed effects has been determined, +the model can be refit with \Co{REML = TRUE} if the restricted +estimates of the variance components are desired. + +\section{Data manipulation} +\label{sec:data} + +Both \Co{PROC MIXED} and \Co{lme} work with data in a tabular form +with one row per observation. There are, however, important +differences in the internal representations of variables in the data. + +In \textsf{SAS} a qualitative factor can be stored either as numerical +values or alphanumeric labels. When a factor stored as numerical +values is used in \Co{PROC MIXED} it is listed in the \Co{class} +statement to indicate that it is a factor. In \s{} this information +is stored with the data itself by converting the variable to a factor +when it is first stored. If the factor represents an ordered set of +levels, it should be converted to an \Co{ordered} factor. + +For example the SAS code +\begin{Example} +data animal; + input trait animal y; + datalines; +1 1 6 +1 2 8 +1 3 7 +2 1 9 +2 2 5 +2 3 . +; +\end{Example} +would require that the \Co{trait} and \Co{animal} variables be +specified in a class statement in any model that is fit. + +In \s{} these data could be read from a file, say \texttt{animal.dat}, +and converted to factors by +\begin{Example} +S> animal <- read.table( "animal.dat", header = TRUE ) +S> class( animal ) +[1] "data.frame" +S> animal$trait <- as.factor( animal$trait ) +S> animal$animal <- as.factor( animal$animal ) +\end{Example} +In general it is a good idea to check the types of variables in a data +frame before working with it. One way of doing this is to apply +the function \textsf{data.class} to each variable in turn using the +\Co{sapply} function. +\begin{Example} +S> sapply( animal, data.class ) + trait animal y + "factor" "factor" "numeric" +\end{Example} + +To make specification of models in \Co{lme} easier and to make graphic +presentations more informative, we recommend converting from a +\Co{data.frame} object to a \Co{groupedData} object. This class of +objects contains a formula specifying the response, the primary +covariate (if there is one) and the grouping factor or factors. The +data sets from \citeasnoun{litt:mill:stro:wolf:1996} have been +converted to \Co{groupedData} objects in this directory. + +\subsection{Unique levels of factors} +\label{sec:nested} + +Designs with nested grouping factors are indicated differently in the +two languages. An example of such an experimental design is the +semiconductor experiment described in section 2.2 of +\citeasnoun{litt:mill:stro:wolf:1996} where twelve wafers are +assigned to four experimental treatments with three wafers per +treatment. The levels for the wafer factor are \Co{1}, \Co{2}, and +\Co{3} but the wafer factor is only meaningful within the same level +of the treatment factor, \Co{et}. There is nothing associating wafer +\Co{1} of the third treatment group with wafer \Co{1} of the first +treatment group. + +In \Co{SAS} this nesting of factors is denoted by \Co{wafer(et)}. In +\s{} the nesting is written with \Co{~ ET/Wafer} and read ``wafer +within ET''. If both levels of nested factors are to be associated +with random effects then this is all you need to know. You would use +an expression with a \Co{"/"} in the grouping factor part of the +formula for the \Co{groupedData} object. Then the random effects +could be specified as +\begin{Example} + random = list( ET = ~ 1, Wafer = ~ 1 ) +\end{Example} +or, equivalently +\begin{Example} + random = ~ 1 | ET/Wafer +\end{Example} + +In this case, however, there would not usually be any random effects +associated with the ``experimental treatment'' or \Co{ET} factor. The +only random effects are at the \Co{Wafer} level. It is necessary to +create a factor that will have unique levels for each \Co{Wafer} +within each level of \Co{ET}. One way to do this is to assign +\begin{Example} +S> Semiconductor$Grp <- ++ getGroups( Semiconductor, form = ~ ET / Wafer, level = 2 ) +S> levels( Semiconductor$Grp ) # check on the distinct levels + [1] "1/1" "1/2" "1/3" "2/1" "2/2" "2/3" "3/1" "3/2" "3/3" "4/1" +[11] "4/2" "4/3" +\end{Example} +after which we could specify \Co{random = ~ 1 | Grp}. + +\subsection{General approach} +\label{sec:generalApproach} + +As a general approach to importing data into \s{} for mixed-effects +analysis you should: +\begin{itemize} +\item Create a \Co{data.frame} with one row per observation and one + column per variable. +\item Use \Co{ordered} or \Co{as.ordered} to explicitly convert any + ordered factors to class \Co{ordered}. +\item Use \Co{ordered} or \Co{as.ordered} to explicitly convert any + ordered factors to class \Co{ordered}. +\item If necessary, use \Co{getGroups} to create a factor with unique + levels from inner nested factors. +\item Specify the formula for the response, the primary covariate and + the grouping structure to create a \Co{groupedData} object from the + data frame. Labels and units for the response and the primary + covariate can also be specified at this time as can \Co{outer} and + \Co{inner} factor expressions. +\item Plot the data. Plot it several ways. The use of trellis + graphics is closely integrated with the \Co{nlme} library. The + trellis plots can provide invaluable insight into the structure of + the data. Use them. +\end{itemize} + +\section{Contrasts} +\label{sec:contrasts} + +When comparing estimates produced by \Co{SAS PROC MIXED} and by +\Co{lme} one must be careful to consider the contrasts that are +used to define the effects of factors. In \textsf{SAS} a model with +an intercept and a qualitative factor is defined in terms of the +intercept and the indicator variables for all but the last level of +the factor. The default behaviour in \s{} is to use the Helmert +contrasts for the factor. On a balanced factor these provide a set of +orthogonal contrasts. In \R{} the default is the ``treatment'' +contrasts which are almost the same as the SAS parameterization except +that they drop the indicator of the first level, not the last level. + +When in doubt, check which contrasts are being used with the +\textsf{contrasts} function. + +To make comparisons easier, you may find it worthwhile to declare +\begin{Example} +S> options(contrasts = c(factor = "contr.SAS", ++ ordered = "contr.poly")) +\end{Example} +at the beginning of your session. + +\bibliography{Usinglme} +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/data/00Index b/data/00Index new file mode 100644 index 0000000..7cc8719 --- /dev/null +++ b/data/00Index @@ -0,0 +1,23 @@ +Animal Animal breeding experiment +AvgDailyGain Average daily weight gain of steers on different + diets +BIB Data from a balanced incomplete block design +Bond Strengths of metal bonds +Cultivation Bacterial innoculation applied to grass + cultivars +Demand Per-capita demand deposits by state and year +Genetics Heritability data +HR Heart rates of patients on different drug + treatments +IncBlk An unbalanced incomplete block experiment +Mississippi Nitrogen concentrations in the Mississippi River +Multilocation A multilocation trial +PBIB A partially balanced incomplete block experiment +SIMS Second International Mathematics Study data +Semi2 Oxide layer thicknesses on semiconductors +Semiconductor Semiconductor split-plot experiment +TeachingI Teaching Methods I +TeachingII Teaching Methods II +WWheat Winter wheat +WaferTypes Data on different types of silicon wafers +Weights Data from a weight-lifting program diff --git a/data/Animal.R b/data/Animal.R new file mode 100644 index 0000000..34dd671 --- /dev/null +++ b/data/Animal.R @@ -0,0 +1,21 @@ +### $Id: Animal.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Animal breeding experiment with two dams each mated to five randomly +### selected sires. Data set 6.4 from "SAS System for Mixed Models". +"Animal" <- + structure(list( + Sire = structure(factor(c(1, 1, 1, 1, 2, 2, 2, + 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5), levels=1:5), + class = "factor", .Label = c("1", "2", "3", "4", "5")), +Dam = structure(factor(c(1, 1, 2, 2, 1, + 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2), levels=1:2), + class = "factor", .Label = c("1", "2")), +AvgDailyGain = c(2.24, 1.85, 2.05, 2.41, 1.99, 1.93, 2.72, + 2.32, 2.33, 2.68, 2.69, 2.71, 2.42, 2.01, 1.86, 1.79, 2.82, 2.64, + 2.58, 2.56)), +class = c("nmGroupedData", "groupedData", "data.frame"), +row.names = 1:20, +formula = AvgDailyGain ~ 1 | Sire/Dam, +formulaList = list(Sire = ~Sire, Dam = ~Dam), +labels = list(y = "Average Daily Weight Gain"), +order.groups = list(Sire = TRUE, Dam = TRUE), +FUN = function (x) mean(x, na.rm = TRUE)) diff --git a/data/AvgDailyGain.R b/data/AvgDailyGain.R new file mode 100644 index 0000000..7a02e12 --- /dev/null +++ b/data/AvgDailyGain.R @@ -0,0 +1,35 @@ +### $Id: AvgDailyGain.R,v 1.1 2000/02/09 19:30:27 bates Exp $ +### Average daily weight gain (adg) of steers fed for 160 days. The Treatment +### is the level of medicated feed additive in the diet. It is given as both +### an ordered factor (Treatment) and a continuous covariate (Trt). The initial +### weight is also recorded. The steers were housed in 8 different barns, +### the Block factor. This is data set 5.3 from "SAS System for Mixed Models". +"AvgDailyGain" <- + structure(list( + Id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32), +Block = structure(c(1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, + 8, 8, 8), .Label = c("1", "2", "3", "4", "5", "6", "7", "8"), + class = c("ordered", "factor")), +Treatment = structure(c(1, 2, 3, 4, 1, 2, 3, 4, 1, + 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, + 3, 4), .Label = c("0", "10", "20", "30"), + class = c("ordered", "factor")), +adg = c(1.03, 1.54, 1.82, 1.86, 1.31, 2.16, 2.13, + 2.23, 1.59, 2.53, 2.33, 1.8, 2.09, 2.2, 2.21, 2.82, 1.66, 2.3, + 2.65, 2.18, 1.42, 1.93, 1.58, 1.49, 1.41, 1.65, 1.08, 1.34, 0.18, + 0.64, 0.76, 0.7), +InitWt = c(338, 477, 444, 370, 403, 451, 450, + 393, 394, 499, 482, 317, 499, 411, 391, 396, 371, 418, 486, 333, + 395, 325, 316, 311, 414, 313, 309, 323, 315, 376, 308, 439), +Trt = c(0, + 10, 20, 30, 0, 10, 20, 30, 0, 10, 20, 30, 0, 10, 20, 30, 0, 10, + 20, 30, 0, 10, 20, 30, 0, 10, 20, 30, 0, 10, 20, 30)), +row.names = as.character(1:32), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = adg ~ Trt | Block, +labels = list(x = "Level of medicated feed additive in diet", +y = "Average Daily Gain of steers fed for 160 days"), +FUN = function (x) max(x, na.rm = TRUE), order.groups = TRUE) diff --git a/data/BIB.R b/data/BIB.R new file mode 100644 index 0000000..208bea1 --- /dev/null +++ b/data/BIB.R @@ -0,0 +1,26 @@ +### $Id: BIB.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### A balanced incomplete block design for analysis of covariance. Data set 5.4 +### from "SAS System for Mixed Models". Perhaps artificial data. The Treatment +### is referred to as a "diet model" but no other information is given. +"BIB" <- + structure(list( + Block = structure(ordered(c(1, 1, 1, 2, 2, 2, + 3, 3, 3, 6, 6, 6, 5, 5, 5, 7, 7, 7, 8, 8, 8, 4, 4, 4), levels=1:8), + class = c("ordered", "factor"), + .Label = c("1", "2", "3", "8", "5", "4", "6", "7")), +Treatment = structure(factor(c(1, + 2, 3, 1, 2, 4, 1, 3, 4, 2, 3, 4, 1, 2, 3, 1, 2, 4, 1, 3, 4, 2, + 3, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +y = c(31, 29, 31, 29, 34, 33, 31, 28, 34, 39, 35, 32, + 33, 35, 38, 35, 31, 42, 42, 43, 42, 27, 37, 29), +x = c(20, 18, 11, 37, 37, 39, 29, 12, 31, 37, 29, 28, 12, 19, 16, 31, + 13, 39, 38, 30, 25, 13, 39, 21), +Grp = structure(factor(c(1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, + 1, 2, 2, 1, 1, 2, 2, 1, 2), levels=1:2), class = "factor", + .Label = c("13", "24"))), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:24, +formula = y ~ x | Block, +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Bond.R b/data/Bond.R new file mode 100644 index 0000000..02d1649 --- /dev/null +++ b/data/Bond.R @@ -0,0 +1,21 @@ +# $Id: Bond.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +# Pressure to break a bond of two pieces of metal that used one of the metals +# as the bonding agent. Example 1.2.4 in "SAS System for Mixed Models". +"Bond" <- + structure(list( + pressure = c(67, 71.9, 72.2, 67.5, 68.8, 66.4, + 76, 82.6, 74.5, 72.7, 78.1, 67.3, 73.1, 74.2, 73.2, 65.8, 70.8, + 68.7, 75.6, 84.9, 69), +Metal = structure(factor(c(3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, + 2, 1, 3, 2, 1, 3, 2, 1), levels=1:3), .Label = c("c", "i", "n"), + class = "factor"), +Ingot = structure(ordered(c(3, 3, 3, 1, 1, 1, 6, 6, 6, 5, 5, 5, 4, + 4, 4, 2, 2, 2, 7, 7, 7), levels=1:7), class = c("ordered", "factor"), + .Label = c("2", "6", "1", "5", "4", "3", "7"))), +row.names = 1:21, +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = pressure ~ 1 | Ingot, +inner = ~Metal, +labels = list(y = "Pressure required to break bond"), +FUN = function (x) mean(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Cultivation.R b/data/Cultivation.R new file mode 100644 index 0000000..30d0bcd --- /dev/null +++ b/data/Cultivation.R @@ -0,0 +1,25 @@ +### $Id: Cultivation.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Data Set 2.2(a) from SAS System for Mixed Models. A split-plot design +### with Cult as the whole-plot treatment and Inoc as the sub-plot treatment +"Cultivation" <- + structure(list( + Block = structure(factor(c(1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4), levels=1:4), + class = "factor", .Label = c("1", "2", "3", "4")), +Cult = structure(factor(c(1, 1, 1, 2, 2, 2, + 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2), levels=1:2), + .Label = c("a", "b"), class = "factor"), +Inoc = structure(factor(c(1, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3), levels=1:3), + .Label = c("con", "dea", "liv"), class = "factor"), +drywt = c(27.4, 29.7, 34.5, + 29.4, 32.5, 34.4, 28.9, 28.7, 33.4, 28.7, 32.4, 36.4, 28.6, 29.7, + 32.9, 27.2, 29.1, 32.6, 26.7, 28.9, 31.8, 26.8, 28.6, 30.7)), +class = c("nmGroupedData", "groupedData", "data.frame"), +row.names = 1:24, +formula = drywt ~ 1 | Block/Cult, +formulaList = list(Block = ~Block, Cult = ~Cult), +labels = list(y = "Yield"), +inner = list(Cult = ~Inoc), +order.groups = list(Block = TRUE, Cult = TRUE), +FUN = function (x) max(x, na.rm = TRUE)) diff --git a/data/Demand.R b/data/Demand.R new file mode 100644 index 0000000..3e1470c --- /dev/null +++ b/data/Demand.R @@ -0,0 +1,75 @@ +### $Id: Demand.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Doubly repeated measures or "panel data" on per capita demand deposits. +### Example 3.6 from "SAS System for Mixed Models" +"Demand" <- + structure(list( +State = structure(ordered(c(3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1), levels=1:7), + class = c("ordered", "factor"), + .Label = c("WA", "FL", "CA", "TX", "IL", "DC", "NY")), +Year = structure(ordered(c(1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), levels=1:11), + class = c("ordered", "factor"), + .Label = c("1949", "1950", "1951", "1952", "1953", + "1954", "1955", "1956", "1957", "1958", "1959")), +d = c(533, 603, 669, 651, 609, 634, 665, 676, 642, 678, 714, 854, 1013, + 1185, 1076, 1004, 1044, 1067, 1062, 1120, 1196, 1168, 408, 433, + 469, 470, 464, 465, 545, 567, 531, 533, 522, 843, 860, 887, 914, + 909, 928, 939, 944, 899, 919, 874, 1370, 1405, 1409, 1421, 1395, + 1415, 1431, 1416, 1443, 1453, 1417, 573, 634, 679, 668, 666, + 708, 722, 708, 675, 716, 703, 418, 501, 525, 519, 500, 537, 545, + 525, 494, 521, 515), +y = c(1347, 1464, 1608, 1636, 1669, 1716, + 1779, 1878, 1963, 2034, 2164, 1603, 1773, 2017, 1921, 1856, 1868, + 1931, 1951, 2085, 2144, 2167, 1024, 1007, 1068, 1068, 1138, 1137, + 1306, 1339, 1383, 1409, 1457, 1465, 1468, 1555, 1648, 1711, 1775, + 1815, 1915, 1980, 2001, 2035, 1492, 1515, 1566, 1659, 1744, 1802, + 1808, 1916, 2074, 2120, 2197, 995, 1052, 1154, 1176, 1228, 1285, + 1335, 1358, 1416, 1457, 1520, 1146, 1324, 1433, 1481, 1531, 1602, + 1649, 1656, 1711, 1754, 1809), +rd = c(0.343, 0.364, 0.367, 0.369, + 0.41, 0.499, 0.496, 0.533, 0.63, 0.667, 0.664, 0.261, 0.267, + 0.266, 0.267, 0.287, 0.308, 0.318, 0.322, 0.346, 0.36, 0.418, + 0.354, 0.342, 0.335, 0.328, 0.354, 0.374, 0.378, 0.399, 0.447, + 0.498, 0.523, 0.143, 0.146, 0.147, 0.144, 0.15, 0.164, 0.172, + 0.183, 0.203, 0.214, 0.231, 0.112, 0.119, 0.119, 0.12, 0.134, + 0.145, 0.146, 0.168, 0.189, 0.192, 0.203, 0.149, 0.147, 0.148, + 0.147, 0.16, 0.182, 0.191, 0.208, 0.25, 0.278, 0.303, 0.358, + 0.361, 0.365, 0.381, 0.414, 0.481, 0.529, 0.587, 0.681, 0.716, + 0.73), +rt = c(1.114, 1.162, 1.493, 1.567, 1.594, 1.609, 1.637, + 1.757, 2.641, 2.641, 2.648, 0.676, 0.662, 0.677, 0.729, 0.883, + 1.5, 1.504, 1.598, 2.231, 2.1, 2.342, 0.909, 0.957, 1.002, 1.052, + 1.118, 1.268, 1.339, 1.486, 2.42, 2.453, 2.489, 0.852, 0.847, + 0.936, 1.059, 1.091, 1.13, 1.141, 1.354, 1.628, 1.737, 2.054, + 0.687, 0.724, 0.795, 1.05, 1.241, 1.346, 1.406, 1.754, 2.231, + 2.36, 2.521, 0.839, 0.836, 0.812, 1.07, 1.17, 1.328, 1.368, 1.544, + 2.121, 2.241, 2.435, 0.937, 0.973, 1.039, 1.305, 1.342, 1.348, + 1.77, 1.779, 2.313, 2.302, 2.495), +rs = c(2.905, 2.935, 3.093, + 3.073, 3.357, 3.295, 3.451, 3.539, 3.93, 3.982, 4.047, 2.803, + 2.877, 3.006, 2.975, 3.035, 3.083, 3.177, 3.25, 3.368, 3.457, + 3.727, 2.314, 2.327, 2.428, 2.577, 2.625, 2.871, 2.882, 3.032, + 3.338, 3.353, 3.575, 2.504, 2.448, 2.449, 2.568, 2.703, 2.748, + 2.778, 2.932, 3.155, 3.402, 3.497, 2.099, 2.082, 2.218, 2.435, + 2.477, 2.54, 2.655, 2.774, 2.957, 3.073, 3.223, 2.755, 2.74, + 2.819, 2.88, 3.082, 3.093, 3.071, 3.068, 3.487, 3.413, 3.671, + 2.068, 2.229, 2.367, 2.553, 2.848, 2.865, 2.907, 3.011, 3.252, + 3.306, 3.507), +grp = structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1), .Label = "1", class = "factor")), +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = as.character(1:77), +formula = d ~ Year | State, +labels = list(y = "per capita demand deposits"), +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Genetics.R b/data/Genetics.R new file mode 100644 index 0000000..3581dd0 --- /dev/null +++ b/data/Genetics.R @@ -0,0 +1,34 @@ +### $Id: Genetics.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Randomized complete blocked design of wheat families assigned to blocks +### within locations. Data set 4.5 from "SAS System for Mixed Models" +"Genetics" <- + structure(list( + Location = structure(factor(c(1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +Block = structure(factor(c(1, 2, 3, 1, 2, 3, + 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, + 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, + 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3), levels=1:3), class = "factor", + .Label = c("1", "2", "3")), +Family = structure(factor(c(1, 1, 1, 2, 2, 2, 3, + 3, 3, 4, 4, 4, 5, 5, 5, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 5, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 1, 1, 1, 2, + 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5), levels=1:5), class = "factor", + .Label = c("1", "2", "3", "4", "5")), +Yield = c(268, 279, 261, 242, 261, 258, + 242, 245, 234, 225, 231, 219, 236, 260, 248, 238, 220, 243, 215, + 192, 226, 198, 151, 191, 195, 182, 202, 201, 161, 196, 221, 216, + 224, 208, 197, 201, 186, 173, 161, 207, 183, 186, 200, 207, 190, + 194, 194, 197, 203, 191, 204, 177, 170, 180, 180, 195, 193, 199, + 183, 208)), +class = c("nmGroupedData", "groupedData", "data.frame"), +row.names = 1:60, +formula = Yield ~ 1 | Location/Block, +formulaList = list(Location = ~Location, Block = ~Block), +labels = list(y = "Wheat yield"), +order.groups = list(Location = TRUE, Block = TRUE), +FUN = function (x) mean(x, na.rm = TRUE)) + diff --git a/data/HR.R b/data/HR.R new file mode 100644 index 0000000..74a0426 --- /dev/null +++ b/data/HR.R @@ -0,0 +1,67 @@ +### $Id: HR.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Heart rate repeated measures data. Example 3.5 from +### "SAS System for Mixed Models" +"HR" <- + structure(list( + Patient = structure(ordered(c(23, 23, 23, 23, + 23, 9, 9, 9, 9, 9, 21, 21, 21, 21, 21, 2, 2, 2, 2, 2, 12, 12, + 12, 12, 12, 17, 17, 17, 17, 17, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, + 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 24, 24, + 24, 24, 24, 6, 6, 6, 6, 6, 15, 15, 15, 15, 15, 3, 3, 3, 3, 3, + 22, 22, 22, 22, 22, 5, 5, 5, 5, 5, 16, 16, 16, 16, 16, 19, 19, + 19, 19, 19, 18, 18, 18, 18, 18, 14, 14, 14, 14, 14, 13, 13, 13, + 13, 13, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4), levels=1:24), + class = c("ordered", "factor"), + .Label = structure(c("208", "204", "216", "232", "218", + "214", "207", "209", "202", "210", "211", "205", "223", "222", + "215", "219", "206", "221", "220", "224", "203", "217", "201", + "212"), + .Names = c("a1", "a2", "a3", "a4", "a5", "a6", "a7", + "a8", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "p1", "p2", + "p3", "p4", "p5", "p6", "p7", "p8"))), +Drug = structure(factor(c(3, + 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1), levels=1:3), + .Label = c("a", "b", "p")), +baseHR = c(92, 92, 92, 92, 92, 54, 54, 54, 54, 54, + 84, 84, 84, 84, 84, 72, 72, 72, 72, 72, 80, 80, 80, 80, 80, 68, + 68, 68, 68, 68, 100, 100, 100, 100, 100, 60, 60, 60, 60, 60, + 88, 88, 88, 88, 88, 92, 92, 92, 92, 92, 88, 88, 88, 88, 88, 102, + 102, 102, 102, 102, 84, 84, 84, 84, 84, 104, 104, 104, 104, 104, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 80, 80, 80, 80, 80, 72, 72, 72, 72, 72, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 78, 78, 78, + 78, 78), +HR = c(76, 84, 88, 96, 84, 58, 60, 60, 60, 64, 86, 82, + 84, 86, 82, 72, 68, 68, 78, 72, 84, 84, 96, 92, 72, 72, 68, 68, + 64, 62, 104, 100, 92, 92, 68, 60, 58, 56, 50, 56, 104, 88, 88, + 78, 84, 82, 82, 76, 82, 80, 80, 84, 80, 80, 78, 86, 86, 96, 86, + 88, 92, 100, 88, 88, 80, 100, 96, 88, 92, 84, 80, 72, 64, 68, + 64, 88, 84, 76, 88, 84, 84, 78, 80, 80, 76, 100, 92, 84, 88, + 80, 80, 80, 78, 80, 78, 68, 76, 72, 72, 68, 88, 98, 98, 96, 88, + 88, 96, 88, 88, 80, 78, 84, 64, 68, 64, 72, 72, 78, 80, 68), +Time = c(0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1, 0.016667, + 0.083333, 0.25, 0.5, 1, 0.016667, 0.083333, 0.25, 0.5, 1)), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:120, +outer = ~Drug, +formula = HR ~ Time | Patient, +labels = list(y = "Heart Rate", x = "Time"), +units = list(y = "(beats/min)", x = "(min)"), +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/IncBlk.R b/data/IncBlk.R new file mode 100644 index 0000000..1865ff5 --- /dev/null +++ b/data/IncBlk.R @@ -0,0 +1,28 @@ +### $Id: IncBlk.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### An unbalanced incomplete block design. Data set 5.5 from "SAS System +### for Mixed Models". Probably artificial data. The treatment is +### described as a "diet model". +"IncBlk" <- + structure(list( + Block = structure(ordered(c(12, 12, 9, 9, 10, + 10, 4, 4, 8, 8, 11, 11, 6, 6, 1, 1, 3, 3, 5, 5, 7, 7, 2, 2), + levels=1:12), + class = c("ordered", "factor"), + .Label = c("8", "12", "9", "4", "10", "7", "11", "5", + "2", "3", "6", "1")), +Treatment = structure(factor(c(1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4), + levels=1:4), + class = "factor", + .Label = c("1", "2", "3", "4")), +y = c(0.62, 0.91, 0.41, 0.48, 0.41, 0.49, 0.26, 0.28, 0.29, + 0.37, 0.73, 0.72, 0.33, 0.31, 0.18, 0.18, 0.19, 0.25, 0.28, 0.32, + 0.33, 0.27, 0.24, 0.23), +x = c(0.078, 0.01, 0.032, 0.05, 0, 0.015, + 0.01, 0.016, 0.053, 0.069, 0.007, 0.062, 0.036, 0.068, 0.068, + 0.057, 0.077, 0.09, 0.023, 0.039, 0.017, 0.062, 0.058, 0.082)), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:24, +formula = y ~ x | Block, inner = ~Treatment, +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Mississippi.R b/data/Mississippi.R new file mode 100644 index 0000000..ae92a86 --- /dev/null +++ b/data/Mississippi.R @@ -0,0 +1,25 @@ +### $Id: Mississippi.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Nitrogen concentrations at several sampled sites of influents to the +### Mississippi River. Data set 4.2 in "SAS System for Mixed Models" +"Mississippi" <- + structure(list( + influent = structure(ordered(c(4, 4, 4, 4, 4, + 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, + 5, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6), levels=1:6), + class = c("ordered", "factor"), + .Label = c("3", "5", "2", "1", "4", "6")), +y = c(21, 27, 29, 17, 19, 12, + 29, 20, 20, 21, 11, 18, 9, 13, 23, 2, 20, 19, 20, 11, 14, 14, + 24, 30, 21, 31, 27, 7, 15, 18, 4, 28, 41, 42, 35, 34, 30), +Type = structure(factor(c(2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3), levels=1:3), + class = "factor", .Label = c("1", "2", "3"))), +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:37, +outer = ~Type, +formula = y ~ 1 | influent, +labels = list(y = "Nitrogen concentration in Mississippi River"), +units = list(y = "(ppm)"), +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Multilocation.R b/data/Multilocation.R new file mode 100644 index 0000000..1b5f7bf --- /dev/null +++ b/data/Multilocation.R @@ -0,0 +1,85 @@ +### $Id: Multilocation.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### A multilocation agricultural trial. Data set 2.8.1 from +### "SAS System for Mixed Models". +"Multilocation" <- + structure(list( + obs = c(3, 4, 6, 7, 9, 10, 12, 16, 19, 20, 21, + 22, 25, 27, 28, 31, 33, 35, 36, 40, 41, 44, 47, 48, 50, 51, 54, + 56, 58, 59, 61, 62, 66, 67, 69, 70, 74, 77, 79, 80, 81, 83, 85, + 88, 89, 90, 93, 94, 99, 100, 102, 103, 105, 106, 110, 112, 114, + 115, 116, 117, 122, 123, 125, 126, 130, 131, 133, 135, 139, 140, + 141, 143, 145, 147, 148, 151, 154, 155, 157, 160, 163, 164, 166, + 167, 169, 173, 175, 176, 177, 179, 182, 184, 188, 190, 191, 192, + 193, 196, 197, 198, 203, 204, 205, 208, 209, 212, 213, 214), +Location = structure(factor(c(6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4), levels=1:9), class = c("ordered", "factor"), + .Label = c("B", "D", "E", "I", "G", "A", "C", "F", "H")), +Block = structure(factor(c(1, + 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, + 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, + 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, + 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 3, 3), levels=1:3), class = "factor", + .Label = c("1", "2", "3")), +Trt = structure(factor(c(3, 4, 2, 1, 2, 1, 3, 4, 1, 2, 3, + 4, 3, 4, 2, 1, 4, 1, 3, 2, 2, 3, 4, 1, 4, 2, 3, 1, 3, 2, 1, 4, + 4, 3, 1, 2, 1, 3, 2, 4, 3, 2, 1, 4, 3, 4, 2, 1, 3, 4, 2, 1, 2, + 1, 4, 3, 1, 2, 3, 4, 1, 2, 4, 3, 2, 1, 4, 3, 3, 2, 1, 4, 2, 1, + 4, 3, 4, 3, 1, 2, 4, 3, 2, 1, 3, 2, 4, 1, 2, 3, 4, 1, 4, 1, 3, + 2, 2, 1, 4, 3, 1, 4, 3, 2, 2, 1, 4, 3), levels=1:4), + class = "factor", .Label = c("1", "2", "3", "4")), +Adj = c(3.1645, 3.125, 3.1594, 3.25, 2.713, + 3.2028, 3.0242, 2.8725, 2.6888, 2.8686, 2.8992, 3.0281, 2.1813, + 2.5191, 1.8874, 2.3468, 2.4561, 2.2523, 2.2365, 2.4752, 1.942, + 2.4324, 2.3018, 2.5338, 2.9601, 3.2355, 3.2464, 3.0471, 3.2645, + 2.7138, 3.0652, 2.7174, 3.0362, 3.1051, 3.1630, 3.029, 2.4916, + 2.5183, 2.3563, 2.3033, 2.7269, 2.5951, 2.5652, 2.9152, 2.5794, + 2.9816, 2.3537, 2.2195, 2.8416, 2.6526, 2.4711, 2.8977, 2.5734, + 2.9975, 2.9538, 3.0866, 2.7252, 2.7582, 3.0833, 3.1213, 3.206, + 2.895, 3.369, 3.12, 3.193, 3.298, 3.097, 3.385, 3.449, 3.05, + 3.435, 3.606, 2.5867, 3.1789, 2.9528, 3.1792, 2.6234, 2.6429, + 3.1276, 2.5499, 2.5832, 2.8481, 2.6928, 3.1442, 3.3997, 3.1237, + 3.1797, 3.7005, 2.9519, 3.4466, 3.2891, 3.375, 3.6510, 3.2773, + 3.4271, 3.0482, 2.2210, 3.1553, 2.4026, 3, 2.2908, 2.2540, 2.6053, + 2.3474, 2.5051, 2.3132, 2.4211, 2.7421), +Fe = c(7.1041, 6.6847, + 6.8338, 6.5254, 8.2505, 7.5922, 7.3894, 7.4604, 8.2785, 7.947, + 7.9739, 8.4331, 6.6691, 5.6281, 7.0723, 6.0295, 5.6195, 6.3978, + 6.1799, 5.9985, 7.2975, 6.435, 6.3339, 6.1564, 7.511, 7.4762, + 7.2063, 7.6389, 7.5466, 9.0895, 7.8723, 8.2318, 7.9426, 8.4608, + 8.5549, 8.5038, 9.5758, 9.5121, 10.326, 9.7715, 9.5628, 9.9414, + 9.3887, 8.3158, 10.442, 8.771, 11.015, 11.242, 8.7886, 8.6946, + 9.7143, 9.2401, 9.5353, 8.7538, 8.821, 8.9427, 9.4308, 9.7721, + 8.901, 8.4852, 6.3983, 6.6569, 6.0821, 6.5349, 6.6729, 6.5488, + 6.6598, 6.2998, 6.2849, 6.9957, 6.7302, 6.3827, 8.1394, 7.0972, + 7.314, 6.943, 7.515, 8.0237, 7.3169, 8.1957, 7.9687, 7.9284, + 8.5303, 7.3564, 6.5945, 6.753, 6.4279, 6.483, 7.3809, 6.7929, + 6.4807, 6.8139, 6.3068, 7.4789, 6.9327, 7.7264, 8.4243, 6.7119, + 7.7486, 6.9215, 8.8861, 8.685, 8.415, 8.7866, 8.5975, 8.9267, + 8.775, 8.1599), +Grp = structure(factor(c(16, 16, 16, 16, 17, + 17, 17, 17, 18, 18, 18, 18, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, + 3, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 4, 4, 4, 4, + 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 22, + 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 13, 13, 13, 13, 14, + 14, 14, 14, 15, 15, 15, 15, 25, 25, 25, 25, 26, 26, 26, 26, 27, + 27, 27, 27, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12), + levels=1:27), class = c("ordered", "factor"), + .Label = c("B/1", "B/2", "B/3", "D/1", "D/2", "D/3", + "E/1", "E/2", "E/3", "I/1", "I/2", "I/3", "G/1", "G/2", "G/3", + "A/1", "A/2", "A/3", "C/1", "C/2", "C/3", "F/1", "F/2", "F/3", + "H/1", "H/2", "H/3"))), +FUN = function (x) max(x, na.rm = TRUE), +class = c("nmGroupedData", "groupedData", "data.frame"), +formula = Adj ~ 1 | Location/Block, +inner = list(Block = ~Trt), +labels = list(y = "Adjusted yield"), +order.groups = list(Location = TRUE, Block = TRUE), +row.names = 1:108, +formulaList = list(Location = ~Location, Block = ~Block)) diff --git a/data/PBIB.R b/data/PBIB.R new file mode 100644 index 0000000..eb08e90 --- /dev/null +++ b/data/PBIB.R @@ -0,0 +1,30 @@ +# $Id: PBIB.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +# A partially balanced incomplete blocked design. +# Data set 1.5.1 from "SAS System for Mixed Models". +"PBIB" <- + structure(list( +response = c(2.4, 2.5, 2.6, 2, 2.7, 2.8, 2.4, + 2.7, 2.6, 2.8, 2.4, 2.4, 3.4, 3.1, 2.1, 2.3, 4.1, 3.3, 3.3, 2.9, + 3.4, 3.2, 2.8, 3, 3.2, 2.5, 2.4, 2.6, 2.3, 2.3, 2.4, 2.7, 2.8, + 2.8, 2.6, 2.5, 2.5, 2.7, 2.8, 2.6, 2.6, 2.6, 2.3, 2.4, 2.7, 2.7, + 2.5, 2.6, 3, 3.6, 3.2, 3.2, 3, 2.8, 2.4, 2.5, 2.4, 2.5, 3.2, + 3.1), +Treatment = structure(factor(c(15, 9, 1, 13, 5, 7, 8, 1, + 10, 1, 14, 2, 15, 11, 2, 3, 6, 15, 4, 7, 12, 4, 3, 1, 12, 14, + 15, 8, 6, 3, 14, 5, 5, 4, 2, 13, 10, 12, 13, 6, 9, 7, 10, 3, + 8, 6, 2, 9, 5, 9, 11, 12, 7, 13, 14, 11, 10, 4, 8, 11), + levels=1:15), class = "factor", + .Label = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", + "12", "13", "14", "15")), +Block = structure(ordered(c(1, 1, 1, 1, 5, 5, 5, + 5, 6, 6, 6, 6, 12, 12, 12, 12, 15, 15, 15, 15, 13, 13, 13, 13, + 10, 10, 10, 10, 3, 3, 3, 3, 7, 7, 7, 7, 8, 8, 8, 8, 2, 2, 2, + 2, 4, 4, 4, 4, 14, 14, 14, 14, 9, 9, 9, 9, 11, 11, 11, 11), + levels=1:15), + class = c("ordered", "factor"), + .Label = c("1", "11", "8", "12", "2", "3", "9", "10", "14", "7", + "15", "4", "6", "13", "5"))), +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = response ~ Treatment | Block, +row.names = 1:60, +FUN = function (x) max(x, na.rm = TRUE), order.groups = TRUE) diff --git a/data/SIMS.R b/data/SIMS.R new file mode 100644 index 0000000..cfa4182 --- /dev/null +++ b/data/SIMS.R @@ -0,0 +1,717 @@ +### $Id: SIMS.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Data from 190 classes in the Second International Mathematics Study +### These are used in section 7.2.2 of "SAS System for Mixed Models" +### and in Kreft, de Leeuw, and van der Leeden (1994) American Statistician +"SIMS" <- + structure(list( + Pretot = c(29, 38, 31, 31, 29, 23, 23, 33, 30, + 32, 22, 29, 34, 30, 35, 25, 22, 31, 33, 31, 35, 20, 18, 12, 9, + 11, 12, 12, 18, 13, 8, 21, 4, 10, 8, 12, 14, 9, 11, 11, 12, 12, + 17, 7, 17, 9, 16, 4, 5, 12, 7, 13, 16, 11, 9, 11, 6, 9, 5, 12, + 8, 12, 8, 9, 9, 11, 11, 16, 17, 21, 18, 21, 18, 11, 14, 11, 13, + 13, 10, 11, 17, 14, 17, 12, 12, 13, 10, 14, 12, 13, 20, 10, 16, + 10, 28, 11, 14, 24, 13, 5, 23, 11, 18, 21, 24, 18, 29, 18, 9, + 15, 25, 21, 20, 30, 18, 26, 23, 18, 19, 18, 24, 21, 19, 31, 14, + 24, 19, 22, 21, 20, 11, 10, 24, 24, 12, 15, 14, 8, 8, 16, 16, + 18, 4, 21, 21, 9, 14, 7, 13, 12, 4, 17, 13, 16, 17, 30, 19, 17, + 9, 17, 15, 12, 14, 24, 24, 6, 15, 20, 5, 8, 10, 14, 6, 18, 9, + 12, 9, 9, 16, 10, 5, 9, 9, 11, 13, 7, 27, 8, 12, 16, 14, 8, 11, + 16, 8, 11, 6, 9, 12, 27, 11, 10, 17, 10, 11, 15, 7, 7, 4, 2, + 7, 5, 16, 12, 19, 5, 6, 18, 3, 9, 6, 7, 13, 8, 7, 6, 9, 7, 9, + 8, 7, 22, 9, 18, 27, 28, 14, 13, 21, 20, 22, 19, 13, 20, 24, + 32, 17, 17, 12, 19, 8, 17, 20, 14, 12, 12, 17, 16, 26, 18, 12, + 12, 22, 16, 10, 14, 7, 6, 19, 12, 10, 17, 9, 13, 8, 8, 21, 12, + 12, 27, 10, 28, 15, 16, 13, 24, 11, 15, 19, 10, 17, 6, 17, 16, + 9, 11, 13, 9, 4, 6, 15, 10, 21, 13, 23, 21, 31, 19, 11, 5, 12, + 11, 14, 8, 16, 16, 8, 11, 9, 4, 13, 13, 12, 12, 16, 14, 16, 13, + 9, 8, 10, 23, 26, 15, 13, 31, 31, 22, 18, 26, 31, 22, 23, 19, + 21, 36, 22, 21, 15, 8, 12, 11, 7, 13, 12, 4, 7, 12, 7, 4, 8, + 8, 21, 11, 6, 12, 7, 18, 23, 34, 33, 30, 22, 31, 32, 30, 26, + 33, 22, 26, 29, 24, 34, 30, 30, 21, 21, 28, 22, 27, 16, 36, 26, + 37, 25, 30, 28, 32, 34, 30, 33, 36, 33, 35, 29, 30, 37, 30, 27, + 36, 27, 30, 26, 32, 35, 33, 27, 28, 34, 32, 27, 34, 26, 18, 26, + 7, 29, 33, 35, 17, 32, 11, 20, 24, 31, 20, 21, 14, 25, 15, 18, + 32, 30, 18, 23, 25, 24, 17, 15, 26, 25, 16, 12, 27, 13, 27, 26, + 24, 12, 24, 15, 15, 9, 26, 15, 11, 18, 16, 8, 14, 15, 5, 9, 21, + 23, 13, 13, 17, 16, 14, 18, 22, 20, 9, 16, 19, 22, 22, 24, 9, + 22, 19, 19, 19, 11, 7, 12, 16, 12, 7, 6, 10, 19, 13, 12, 13, + 14, 21, 22, 11, 18, 19, 23, 12, 12, 31, 9, 31, 17, 20, 28, 11, + 11, 25, 18, 13, 10, 14, 15, 7, 4, 15, 5, 14, 12, 8, 19, 8, 15, + 20, 16, 4, 15, 9, 7, 12, 7, 13, 20, 20, 8, 23, 23, 19, 12, 31, + 15, 9, 23, 12, 15, 11, 28, 10, 22, 17, 10, 12, 10, 21, 7, 28, + 12, 15, 9, 12, 29, 9, 11, 20, 20, 19, 18, 18, 21, 30, 21, 14, + 22, 9, 21, 9, 12, 17, 23, 13, 33, 23, 23, 28, 27, 11, 19, 31, + 14, 11, 14, 11, 25, 11, 22, 16, 17, 7, 28, 20, 11, 15, 23, 33, + 17, 21, 20, 25, 11, 25, 19, 29, 28, 9, 18, 21, 11, 6, 10, 14, + 28, 20, 17, 22, 10, 19, 11, 24, 9, 18, 16, 18, 13, 24, 31, 11, + 28, 17, 21, 23, 10, 8, 28, 22, 19, 27, 15, 18, 27, 25, 10, 26, + 16, 20, 19, 26, 9, 18, 9, 10, 32, 16, 16, 13, 15, 17, 20, 16, + 27, 28, 19, 16, 16, 15, 30, 36, 12, 23, 11, 13, 20, 23, 20, 21, + 20, 23, 23, 30, 7, 23, 12, 18, 21, 11, 20, 17, 17, 17, 10, 22, + 18, 19, 28, 23, 26, 15, 22, 5, 24, 18, 17, 17, 11, 26, 17, 17, + 26, 19, 16, 25, 20, 13, 29, 23, 28, 25, 24, 23, 21, 18, 8, 13, + 30, 17, 24, 26, 19, 17, 16, 10, 15, 16, 20, 20, 12, 10, 10, 13, + 11, 28, 25, 17, 18, 10, 6, 11, 25, 14, 24, 20, 20, 17, 20, 16, + 27, 11, 14, 13, 19, 8, 14, 18, 13, 11, 7, 11, 12, 12, 9, 28, + 15, 11, 14, 12, 24, 19, 8, 15, 9, 13, 22, 24, 16, 12, 9, 7, 6, + 11, 9, 6, 3, 18, 15, 11, 8, 10, 6, 9, 8, 10, 8, 6, 5, 15, 23, + 34, 15, 9, 18, 18, 8, 14, 9, 13, 25, 16, 12, 7, 16, 23, 14, 14, + 29, 20, 15, 13, 8, 26, 25, 12, 20, 14, 11, 17, 7, 15, 17, 15, + 10, 28, 17, 15, 17, 16, 18, 14, 20, 37, 17, 9, 27, 26, 16, 25, + 35, 22, 30, 27, 26, 29, 19, 24, 28, 29, 14, 16, 24, 15, 25, 19, + 14, 10, 16, 17, 23, 22, 17, 10, 16, 25, 7, 14, 12, 23, 16, 16, + 25, 10, 21, 12, 19, 19, 26, 31, 26, 27, 19, 22, 22, 21, 29, 14, + 15, 31, 22, 19, 33, 25, 19, 23, 24, 16, 30, 29, 23, 30, 16, 23, + 25, 19, 28, 20, 21, 26, 27, 23, 9, 12, 18, 27, 11, 8, 11, 25, + 11, 11, 15, 22, 14, 13, 9, 10, 13, 15, 13, 19, 27, 21, 35, 28, + 7, 15, 18, 8, 28, 12, 17, 25, 10, 17, 9, 15, 30, 22, 17, 25, + 22, 26, 17, 16, 27, 14, 24, 17, 25, 36, 18, 27, 17, 13, 22, 24, + 11, 25, 17, 23, 16, 11, 11, 23, 22, 18, 31, 27, 16, 31, 22, 28, + 23, 29, 22, 30, 24, 29, 27, 28, 24, 10, 10, 9, 18, 19, 12, 10, + 14, 6, 21, 14, 12, 14, 21, 6, 17, 11, 12, 12, 11, 18, 16, 27, + 21, 20, 30, 23, 18, 31, 15, 9, 22, 21, 13, 26, 16, 26, 29, 24, + 18, 21, 21, 25, 9, 10, 15, 10, 17, 5, 10, 12, 6, 10, 11, 7, 6, + 7, 8, 10, 15, 7, 7, 8, 10, 7, 9, 9, 4, 3, 12, 5, 4, 7, 3, 10, + 8, 14, 10, 9, 9, 8, 16, 17, 11, 8, 23, 10, 15, 16, 19, 8, 18, + 18, 15, 18, 10, 18, 12, 10, 23, 19, 18, 10, 26, 13, 17, 18, 15, + 10, 17, 20, 18, 10, 12, 14, 12, 10, 14, 13, 11, 14, 16, 19, 16, + 10, 6, 5, 3, 4, 12, 6, 28, 24, 24, 23, 23, 25, 30, 30, 34, 34, + 33, 24, 27, 25, 16, 31, 25, 22, 15, 19, 27, 17, 24, 31, 37, 11, + 7, 16, 16, 11, 13, 10, 23, 10, 11, 13, 11, 15, 23, 18, 25, 16, + 14, 6, 14, 14, 14, 19, 11, 19, 7, 2, 13, 8, 11, 5, 6, 8, 12, + 10, 13, 16, 15, 18, 17, 11, 15, 12, 16, 14, 15, 17, 16, 15, 13, + 11, 12, 15, 13, 7, 6, 14, 12, 16, 16, 6, 14, 8, 14, 16, 13, 6, + 9, 12, 15, 18, 14, 13, 12, 15, 14, 27, 9, 12, 12, 8, 8, 7, 10, + 12, 7, 6, 11, 12, 17, 9, 8, 15, 9, 11, 9, 6, 13, 4, 7, 9, 5, + 6, 8, 6, 16, 9, 22, 19, 18, 18, 13, 10, 13, 19, 25, 19, 13, 8, + 13, 17, 26, 18, 21, 10, 17, 10, 18, 9, 13, 11, 15, 11, 17, 16, + 19, 22, 13, 8, 9, 23, 18, 14, 12, 15, 17, 21, 13, 8, 17, 18, + 17, 15, 7, 17, 19, 6, 15, 14, 14, 21, 11, 6, 20, 25, 12, 13, + 15, 19, 8, 9, 26, 24, 16, 6, 7, 24, 10, 9, 13, 19, 17, 21, 18, + 13, 4, 20, 14, 24, 20, 14, 27, 31, 25, 15, 16, 7, 17, 22, 12, + 8, 9, 9, 8, 8, 8, 20, 9, 4, 5, 8, 6, 12, 7, 6, 17, 11, 3, 13, + 22, 16, 10, 10, 10, 8, 13, 10, 14, 23, 14, 13, 11, 4, 11, 15, + 18, 7, 4, 16, 17, 9, 7, 12, 12, 13, 14, 8, 10, 16, 6, 9, 5, 3, + 7, 6, 8, 8, 4, 6, 6, 15, 16, 7, 8, 4, 7, 22, 15, 11, 13, 7, 14, + 11, 17, 11, 14, 9, 17, 19, 24, 17, 19, 15, 32, 21, 10, 25, 13, + 18, 20, 16, 13, 28, 15, 6, 15, 11, 13, 6, 10, 6, 13, 13, 13, + 10, 5, 14, 10, 15, 11, 15, 19, 10, 23, 24, 11, 19, 16, 16, 14, + 10, 25, 12, 12, 18, 21, 12, 14, 19, 11, 17, 19, 12, 12, 16, 22, + 18, 12, 20, 5, 7, 11, 10, 6, 7, 14, 6, 6, 19, 8, 17, 10, 13, + 26, 13, 19, 12, 12, 17, 19, 16, 12, 18, 20, 11, 28, 10, 11, 18, + 24, 9, 8, 6, 8, 6, 9, 7, 9, 9, 8, 5, 9, 6, 13, 9, 9, 7, 13, 9, + 7, 5, 12, 6, 7, 10, 14, 6, 11, 11, 6, 8, 9, 11, 7, 8, 18, 7, + 10, 11, 5, 14, 14, 12, 11, 10, 10, 9, 5, 9, 6, 5, 7, 8, 5, 7, + 4, 8, 9, 6, 10, 12, 3, 9, 8, 11, 8, 17, 8, 16, 27, 21, 13, 23, + 29, 29, 14, 14, 31, 16, 22, 28, 29, 26, 14, 32, 22, 17, 9, 26, + 16, 21, 15, 12, 11, 12, 7, 8, 10, 9, 19, 10, 8, 8, 11, 7, 18, + 9, 11, 12, 9, 8, 9, 6, 20, 14, 17, 9, 13, 18, 11, 10, 12, 10, + 10, 16, 12, 14, 28, 12, 11, 10, 12, 13, 10, 18, 17, 16, 31, 16, + 13, 11, 7, 21, 21, 9, 10, 14, 12, 12, 23, 23, 25, 12, 22, 21, + 11, 9, 27, 15, 27, 12, 13, 25, 11, 20, 6, 15, 12, 15, 3, 23, + 8, 10, 10, 7, 7, 7, 8, 7, 9, 15, 13, 10, 10, 19, 5, 13, 7, 8, + 6, 9, 8, 16, 8, 17, 9, 11, 10, 9, 10, 11, 27, 14, 9, 8, 9, 8, + 6, 9, 8, 12, 17, 12, 13, 17, 11, 11, 8, 10, 7, 13, 11, 7, 7, + 6, 8, 14, 14, 15, 13, 16, 36, 28, 24, 29, 21, 26, 19, 21, 33, + 29, 22, 23, 31, 22, 18, 24, 14, 31, 13, 36, 19, 36, 29, 29, 23, + 10, 9, 1, 10, 6, 6, 8, 8, 3, 9, 6, 5, 4, 10, 13, 14, 15, 13, + 13, 10, 17, 9, 16, 13, 14, 14, 16, 10, 16, 19, 12, 12, 13, 10, + 14, 16, 18, 14, 15, 10, 15, 22, 6, 21, 21, 11, 13, 15, 13, 15, + 14, 16, 16, 12, 11, 11, 18, 15, 13, 12, 7, 8, 11, 14, 8, 9, 8, + 7, 10, 5, 17, 24, 33, 17, 17, 23, 21, 10, 28, 23, 13, 16, 20, + 24, 20, 21, 16, 14, 25, 23, 13, 27, 18, 16, 31, 29, 21, 26, 12, + 8, 17, 7, 26, 10, 9, 14, 8, 14, 8, 7, 12, 9, 18, 15, 13, 17, + 13, 16, 15, 12, 13, 9, 26, 23, 16, 16, 24, 24, 10, 18, 17, 22, + 19, 27, 24, 17, 17, 4, 9, 10, 20, 10, 30, 32, 7, 21, 13, 24, + 15, 10, 8, 16, 9, 33, 22, 10, 20, 12, 15, 16, 23, 21, 10, 16, + 23, 11, 8, 19, 26, 13, 30, 10, 18, 29, 14, 16, 29, 16, 16, 12, + 14, 22, 15, 30, 37, 32, 25, 26, 24, 22, 32, 32, 30, 27, 31, 24, + 25, 17, 25, 20, 12, 23, 13, 18, 14, 11, 14, 20, 18, 15, 12, 12, + 18, 16, 13, 6, 19, 16, 26, 14, 15, 24, 20, 10, 16, 19, 21, 16, + 6, 15, 24, 23, 2, 15, 11, 13, 14, 11, 17, 17, 21, 16, 25, 21, + 16, 22, 19, 11, 18, 17, 14, 23, 20, 23, 12, 3, 7, 8, 23, 13, + 22, 15, 13, 6, 16, 9, 10, 10, 10, 9, 12, 17, 18, 8, 18, 15, 10, + 10, 9, 14, 16, 20, 8, 7, 12, 20, 10, 13, 5, 11, 13, 25, 13, 14, + 15, 9, 5, 12, 9, 19, 15, 9, 8, 3, 10, 12, 12, 12, 6, 19, 7, 13, + 5, 6, 11, 24, 11, 13, 9, 32, 15, 8, 6, 22, 11, 17, 19, 10, 5, + 13, 24, 14, 17, 12, 19, 9, 11, 6, 26, 7, 14, 9, 19, 17, 12, 20, + 10, 8, 5, 8, 13, 10, 8, 5, 10, 7, 14, 8, 9, 11, 20, 16, 21, 11, + 19, 17, 27, 22, 25, 24, 16, 21, 28, 17, 19, 21, 21, 18, 25, 27, + 18, 24, 22, 19, 28, 34, 25, 20, 22, 28, 20, 25, 26, 27, 20, 11, + 17, 13, 12, 10, 16, 15, 10, 15, 12, 13, 17, 22, 9, 7, 17, 18, + 10, 18, 20, 6, 14, 10, 21, 8, 15, 13, 13, 17, 13, 15, 9, 18, + 7, 19, 18, 31, 17, 25, 13, 16, 14, 10, 14, 23, 11, 18, 16, 17, + 13, 18, 17, 17, 21, 24, 24, 21, 13, 18, 10, 11, 10, 6, 7, 7, + 5, 14, 11, 11, 9, 13, 27, 10, 9, 12, 12, 29, 27, 22, 19, 19, + 28, 27, 25, 20, 19, 16, 21, 27, 29, 16, 23, 30, 33, 30, 28, 27, + 27, 22, 25, 16, 19, 14, 19, 17, 14, 13, 13, 17, 13, 21, 18, 10, + 17, 12, 18, 17, 30, 14, 27, 29, 15, 6, 12, 14, 15, 10, 10, 7, + 13, 10, 18, 15, 19, 6, 9, 16, 10, 8, 13, 8, 13, 8, 9, 13, 18, + 22, 22, 30, 13, 20, 27, 23, 16, 19, 21, 14, 14, 10, 15, 7, 18, + 34, 14, 11, 22, 20, 16, 16, 14, 14, 11, 20, 15, 10, 6, 24, 18, + 8, 21, 12, 31, 24, 25, 9, 16, 15, 24, 27, 16, 17, 12, 13, 32, + 8, 18, 24, 21, 22, 10, 15, 22, 31, 23, 9, 8, 18, 11, 10, 9, 14, + 28, 20, 20, 27, 17, 20, 11, 28, 19, 12, 19, 6, 5, 11, 7, 14, + 24, 10, 6, 10, 11, 20, 13, 17, 30, 11, 30, 32, 30, 18, 11, 20, + 8, 14, 18, 17, 10, 21, 22, 22, 16, 19, 33, 30, 26, 34, 10, 14, + 28, 12, 33, 21, 14, 25, 24, 24, 20, 25, 25, 32, 33, 13, 18, 28, + 22, 31, 16, 35, 21, 32, 22, 16, 10, 8, 8, 6, 9, 8, 7, 8, 7, 5, + 26, 29, 31, 32, 28, 10, 30, 18, 27, 25, 16, 22, 30, 22, 23, 29, + 30, 20, 22, 19, 19, 18, 10, 25, 23, 27, 15, 26, 20, 26, 13, 23, + 15, 20, 26, 21, 25, 19, 16, 7, 17, 18, 19, 25, 26, 12, 16, 30, + 16, 28, 25, 26, 26, 28, 18, 33, 11, 29, 14, 25, 22, 31, 27, 24, + 15, 25, 23, 19, 26, 29, 29, 18, 30, 21, 16, 23, 31, 31, 25, 21, + 19, 26, 18, 22, 16, 19, 27, 25, 19, 20, 19, 20, 23, 20, 18, 22, + 18, 21, 14, 31, 31, 34, 27, 26, 25, 35, 32, 26, 29, 33, 32, 29, + 21, 32, 38, 34, 24, 29, 10, 4, 7, 6, 10, 11, 6, 16, 10, 8, 8, + 15, 12, 18, 7, 18, 7, 9, 3, 8, 23, 15, 8, 13, 9, 7, 4, 9, 12, + 9, 11, 8, 7, 8, 5, 4, 6, 6, 6, 28, 9, 12, 16, 5, 13, 4, 6, 10, + 24, 11, 13, 11, 17, 14, 6, 13, 16, 12, 13, 21, 13, 16, 20, 14, + 9, 27, 18, 15, 9, 5, 10, 12, 12, 13, 10, 6, 11, 7, 4, 10, 8, + 7, 12, 23, 27, 20, 17, 17, 16, 18, 19, 18, 16, 25, 11, 20, 26, + 12, 23, 19, 20, 14, 25, 28, 13, 24, 23, 20, 22, 18, 29, 23, 18, + 16, 11, 13, 14, 29, 4, 1, 8, 5, 7, 8, 10, 12, 9, 7, 7, 4, 4, + 4, 10, 6, 7, 7, 14, 26, 18, 33, 14, 27, 25, 26, 25, 22, 20, 21, + 22, 38, 22, 21, 26, 33, 27, 25, 25, 19, 20, 19, 7, 11, 8, 12, + 11, 22, 6, 17, 12, 11, 8, 18, 13, 15, 17, 21, 15, 22, 8, 26, + 7, 10, 14, 13, 15, 13, 19, 34, 21, 26, 20, 24, 9, 7, 14, 12, + 14, 23, 30, 29, 9, 5, 13, 14, 18, 9, 12, 10, 19, 30, 12, 9, 23, + 14, 16, 26, 8, 6, 11, 13, 10, 12, 29, 22, 16, 13, 18, 15, 16, + 12, 20, 9, 26, 10, 4, 7, 7, 13, 10, 8, 11, 9, 11, 10, 5, 4, 13, + 5, 7, 7, 10, 4, 9, 8, 9, 14, 11, 5, 15, 19, 6, 7, 14, 8, 11, + 4, 11, 12, 14, 9, 6, 12, 24, 23, 13, 14, 22, 12, 19, 7, 16, 15, + 27, 16, 12, 8, 15, 10, 2, 17, 19, 16, 14, 10, 14, 8, 13, 9, 17, + 12, 30, 6, 15, 7, 9, 8, 11, 9, 8, 9, 18, 4, 14, 20, 7, 9, 8, + 21, 21, 11, 16, 17, 22, 16, 14, 9, 25, 30, 24, 31, 26, 16, 27, + 22, 22, 16, 17, 29, 35, 31, 21, 16, 26, 26, 25, 32, 18, 22, 20, + 24, 30, 27, 15, 27, 21, 16, 24, 32, 13, 18, 19, 8, 10, 20, 12, + 14, 24, 15, 12, 14, 15, 16, 9, 15, 19, 21, 11, 9, 18, 19, 18, + 29, 20, 26, 19, 27, 12, 19, 11, 10, 6, 12, 11, 19, 21, 14, 12, + 15, 21, 11, 7, 18, 12, 16, 18, 26, 13, 19, 27, 23, 17, 16, 12, + 16, 23, 9, 17, 21, 6, 8, 19, 32, 25, 29, 24, 21, 32, 18, 19, + 30, 24, 22, 15, 20, 22, 17, 19, 11, 16, 15, 23, 24, 31, 23, 24, + 19, 9, 12, 24, 17, 16, 25, 11, 11, 20, 8, 15, 23, 20, 16, 10, + 15, 21, 20, 14, 11, 20, 13, 25, 17, 13, 12, 29, 7, 9, 16, 13, + 8, 7, 17, 17, 15, 16, 7, 8, 10, 11, 9, 14, 9, 17, 12, 15, 8, + 8, 13, 13, 10, 8, 9, 9, 9, 5, 18, 12, 9, 11, 5, 9, 17, 23, 17, + 10, 7, 11, 6, 11, 15, 17, 23, 16, 10, 12, 11, 9, 18, 23, 13, + 7, 4, 13, 6, 10, 13, 8, 10, 6, 10, 6, 6, 18, 21, 8, 4, 11, 16, + 24, 30, 19, 27, 25, 30, 20, 28, 23, 24, 22, 28, 35, 30, 27, 26, + 35, 21, 25, 30, 18, 27, 23, 24, 22, 24, 17, 15, 12, 13, 27, 10, + 18, 19, 19, 13, 11, 13, 17, 14, 15, 22, 11, 22, 14, 25, 23, 20, + 33, 25, 16, 25, 24, 31, 24, 37, 35, 33, 28, 32, 31, 15, 33, 36, + 30, 18, 28, 32, 28, 32, 30, 34, 33, 14, 32, 22, 21, 6, 12, 18, + 14, 20, 14, 14, 15, 14, 12, 13, 23, 13, 13, 25, 17, 22, 13, 12, + 18, 15, 26, 25, 25, 22, 20, 20, 18, 16, 14, 21, 21, 12, 29, 22, + 35, 23, 27, 14, 31, 18, 20, 12, 15, 6, 15, 21, 15, 13, 7, 13, + 10, 11, 10, 12, 12, 16, 6, 7, 11, 13, 16, 18, 8, 10, 11, 14, + 14, 6, 7, 11, 21, 14, 10, 10, 6, 8, 18, 22, 15, 24, 9, 17, 17, + 22, 12, 17, 22, 15, 17, 20, 22, 10, 6, 22, 20, 13, 24, 27, 24, + 27, 17, 14, 10, 27, 13, 33, 5, 9, 27, 7, 16, 32, 15, 17, 18, + 16, 15, 24, 16, 9, 21, 8, 12, 18, 33, 12, 12, 20, 10, 27, 21, + 12, 17, 13, 14, 8, 18, 17, 14, 22, 13, 9, 14, 11, 17, 24, 15, + 21, 11, 15, 16, 19, 16, 13, 15, 24, 16, 19, 15, 14, 15, 15, 10, + 16, 7, 13, 16, 20, 16, 15, 21, 18, 11, 14, 20, 20, 9, 15, 11, + 16, 21, 17, 13, 19, 16, 19, 30, 23, 15, 20, 21, 25, 15, 9, 11, + 10, 12, 12, 16, 9, 14, 9, 3, 7, 17, 8, 10, 10, 14, 13, 14, 11, + 10, 14, 10, 13, 14, 10, 11, 12, 13, 9, 7, 4, 12, 6, 13, 6, 13, + 6, 8, 2, 9, 7, 5, 4, 8, 10, 13, 9, 10, 8, 5, 11, 10, 7, 9, 12, + 6, 8, 8, 7, 8, 8, 8, 10, 6, 8, 7, 4, 7, 4, 5, 6, 11, 10, 2, 5, + 8, 13, 8, 5, 8, 4, 6, 4, 9, 8, 7, 10, 12, 13, 9, 10, 9, 5, 14, + 9, 18, 18, 12, 12, 8, 12, 12, 12, 7, 10, 7, 8, 7, 7, 15, 11, + 9, 9, 9, 11, 11, 6, 7, 13, 9, 14, 8, 11, 7, 10, 10, 6, 5, 9, + 12, 8, 7, 6, 7, 12, 11, 9, 9, 7, 8, 4, 6, 5, 10, 12, 11, 10, + 16, 11, 5, 6, 6, 11, 11, 7, 12, 9, 9, 10, 11, 13, 17, 14, 4, + 8, 11, 4, 4, 26, 8, 5, 6, 7, 9, 5, 8, 11, 7, 21, 10, 14, 7, 5, + 11, 9, 12, 12, 5, 13, 14, 19, 6, 5, 12, 7, 6, 31, 33, 20, 30, + 32, 29, 29, 13, 31, 22, 31, 37, 32, 28, 37, 29, 32, 31, 28, 29, + 22, 35, 29, 33, 31, 31, 28, 24, 30, 36, 32, 31, 16, 13, 11, 14, + 10, 13, 8, 15, 5, 18, 8, 6, 7, 17, 20, 10, 9, 11, 20, 7, 13, + 11, 12, 16, 12), +Gain = c(2, 0, 6, 6, 5, 9, 7, 2, 1, 3, 4, 6, + 2, -1, 1, 1, 3, 1, 3, 1, 2, 2, -3, 5, 1, -3, 3, -8, -6, -4, 4, + 1, 4, 1, 4, -6, -2, 2, 3, -5, 7, 2, -7, 3, -6, 2, 2, 1, 8, -4, + -2, 1, -10, -4, -1, 6, 1, 3, 9, -5, 1, -4, 4, 2, 5, -4, 1, 13, + 4, 6, 9, 0, -2, 9, 10, -4, 4, 4, 7, 3, 9, 2, 4, 1, 8, -2, 5, + 6, 15, -5, 5, 9, 1, 7, -4, 5, -2, 5, 7, 5, 8, 5, 4, 5, 4, 12, + 4, 0, 11, 2, 4, 0, 10, -3, -10, -2, -4, -4, 8, -6, 1, 8, -1, + 0, -5, 0, -13, -10, 6, 2, 6, 7, -10, -7, 5, -4, -3, 0, -2, 14, + -4, 4, 0, -15, -12, -5, -6, -1, -7, -5, 10, -4, -7, 5, 10, 0, + 10, -7, 2, 0, -8, 10, -2, -11, 1, 4, -4, 3, 3, 2, 5, 8, 4, 2, + 0, 5, 3, 1, 10, 6, 11, 0, 1, 1, 0, 5, -4, -2, 2, -7, 5, 4, 4, + 4, 2, 7, 0, 4, 3, 1, 2, -1, -2, -1, -1, 4, -3, 1, 8, 16, 8, 1, + 0, -5, -2, 3, 2, 7, 5, 4, 5, 2, -7, 3, 7, 3, 1, 1, 5, 5, 6, 2, + 16, 7, 6, 8, 7, 0, 11, 5, 5, 3, 15, 3, 2, 4, 0, 11, 13, 3, 7, + 7, -1, 0, 3, 12, -8, 12, -2, 11, 17, 9, 9, 5, 3, 6, 2, 6, 5, + 9, 8, -3, 3, 10, 2, 5, 10, 1, 2, 6, 6, 3, 7, 3, 9, 12, 11, 4, + 8, -8, -10, -4, -6, -1, 1, 2, -3, 4, 2, 1, -3, 1, 2, 1, 3, -7, + -4, -4, 1, 6, 2, 4, 9, 1, 1, 4, 4, 1, 0, 6, 8, 1, -4, -2, 2, + 9, 5, -1, 0, 7, 9, 6, 7, 9, 5, 2, 4, 5, 13, 6, 4, 2, 9, 1, 10, + 3, -2, 6, 5, 2, -1, 7, 15, -5, -2, 11, -1, 0, 3, 7, 3, 5, -6, + 5, 5, 11, 2, 4, -7, -5, -1, -23, 6, -22, 6, 5, 6, 3, 1, -2, 4, + 7, 0, 7, 4, 6, 4, 5, 12, -3, 9, 2, -1, -1, -2, 6, 8, 2, 2, 2, + 4, 1, 2, 0, 1, 5, 1, 1, 3, -2, 8, 1, 9, -1, -2, 3, 7, 4, 3, 6, + 6, 3, 7, 10, 8, 17, 8, -1, 1, -9, -1, 10, 7, 1, 6, 4, 10, 12, + 11, 12, 11, 4, 4, 13, 8, 6, 5, 10, 9, 11, 5, 2, 18, 6, 5, 7, + 3, 5, 4, -1, -10, -1, 7, -1, -1, 1, 1, 3, 0, 7, 1, 10, 5, -12, + 5, 1, -1, 7, 5, 5, 7, 0, 1, 9, 4, 3, 6, 8, 4, 11, 4, 4, 4, 6, + 6, 5, 8, 7, 1, 2, 15, 0, -1, 4, 9, -3, 9, 2, 5, 4, 6, 4, 1, -5, + 9, -2, 8, 4, 4, 7, 8, 0, 14, 6, -5, 2, 3, -3, -11, 0, 1, 4, 9, + 3, -1, 10, 4, 7, 11, -12, 6, 3, 4, -3, -4, 11, 3, 6, 4, 11, 7, + 5, 9, 5, 6, 0, 4, 11, 8, 11, 8, 16, 4, 8, 9, 13, 14, -2, 22, + -1, 4, -13, 19, 13, 17, -5, 1, 10, 11, 14, 11, 7, 4, 14, 2, -3, + 9, 11, 4, 16, 7, 3, 4, 5, 6, 7, 0, 2, 7, 3, 2, 1, 6, 0, 3, -3, + 8, 7, 5, 13, -7, 15, 11, 24, -6, -7, 8, 3, 4, 2, 3, -9, 2, 6, + 19, -1, 13, 9, 5, 2, 11, 11, 14, 16, -1, 5, 7, 14, 16, 4, 2, + 6, 6, 9, 6, 8, 15, 7, 4, 5, 6, 4, -6, 13, 5, 7, -4, 5, 6, -6, + 6, 0, 5, 9, 3, -2, 10, 7, 2, 2, 10, 7, 3, 16, 12, 17, 2, 6, 10, + -3, 14, -1, 5, 10, -3, 2, 0, 0, 11, 1, 2, -1, 9, 10, 1, 10, 9, + 11, 14, 8, 7, 7, 9, 7, 4, 6, 11, 13, 7, 4, 10, 4, 4, 3, 3, 3, + 7, 7, 7, 6, 6, 7, 6, 7, 10, 2, 16, 0, -4, 4, 6, 9, 2, -1, 3, + -1, -1, 10, -2, 1, 7, 8, 1, 11, 2, 5, 5, 5, 4, 7, 5, 8, 5, -9, + 10, 4, 3, 8, 14, 3, 11, 4, 8, 3, 3, 8, 6, 14, 13, 9, 6, 16, 10, + 12, 4, 3, 10, 17, 14, 9, 4, 7, -4, 4, 2, 11, 5, 8, 2, 2, 7, 2, + 7, 8, 3, 4, 5, 7, -4, 6, 5, 5, 4, -6, 18, 3, 4, 8, 9, 3, -2, + 3, -2, -6, -2, 2, 3, 5, -1, 0, -1, 7, -2, -2, 5, 1, 2, -1, 0, + 5, 5, 0, 8, 3, 6, 11, 2, 1, 3, -4, 7, 4, 1, 6, 1, 1, -3, 2, 4, + 10, 4, -3, 0, -3, 3, 6, 2, 17, 13, 4, 2, 8, 11, 0, 15, 5, 8, + 11, 15, 4, 7, 8, 10, 0, 6, 12, 8, 0, 12, 7, -2, 12, 1, 10, 0, + 1, 6, 11, 4, 7, 8, 12, 5, 5, -5, 6, 5, 6, 0, 8, 10, 9, 8, 6, + 15, -2, 10, 5, 9, 3, 2, 1, 8, 13, -5, 11, 3, 7, -3, 4, 4, 2, + 11, 7, 10, 11, 6, 8, 3, 3, 1, 5, -24, 7, 12, 5, 1, 10, 4, 4, + 4, 4, 12, 10, 6, 9, 4, -4, 12, 2, -1, 0, 2, 4, 9, 2, -5, 4, 7, + 1, -1, 1, 5, 2, 9, 2, 2, -1, 3, 3, 10, 10, 7, 5, -2, -2, 7, 5, + -2, 3, 1, 9, 8, 2, -2, 6, 5, 4, 0, -1, 0, 1, -3, 4, 1, 4, 8, + 9, -1, 10, 9, 2, 5, 2, 8, 11, 3, 7, 6, 4, 13, 1, 6, 11, 7, 8, + 11, 15, 2, 6, 12, 3, 15, 8, 8, 1, 8, 4, 5, -20, 6, 6, 12, 8, + 11, 6, 9, 3, 13, 13, 7, 15, 9, 4, 9, 14, 10, 6, 9, 11, 10, 6, + 8, 9, 10, 8, 6, 9, 1, 7, 10, 6, 10, 6, 12, 1, 14, 6, 10, 6, 5, + 10, 11, 0, 0, 7, 2, 1, 1, -1, -5, 8, 10, 3, 1, 6, 5, 3, 9, 0, + 0, -4, -2, 0, 8, 0, 3, 0, -2, 1, 6, 6, -7, 6, 6, -5, 6, -5, -7, + -13, -2, 3, 5, 11, 4, 16, 5, 6, 9, 6, -10, -3, 2, 9, 3, 14, -2, + 10, 20, -4, 6, 0, 13, 1, 12, 12, 2, -2, 2, 11, 5, 14, 7, 0, 2, + -5, 8, 6, -5, 12, 15, 4, 6, 0, 11, 7, 14, 4, -2, 1, 3, -4, -8, + -1, 4, 1, 12, 0, -1, 5, -11, -3, -3, 0, 3, 4, -12, 1, 6, -4, + -5, 4, 2, -1, 6, -5, -3, -14, -9, -1, -3, 4, 3, -4, 8, 10, 1, + 7, -5, -1, 2, -1, 3, -13, -2, 9, -1, 0, -1, 9, -4, -1, -4, 0, + 2, 0, 4, 6, 2, 0, 0, 1, -2, 2, 8, 13, 0, 3, 4, 12, 4, 2, 14, + 5, 8, 6, 4, 11, 7, 6, 5, 2, 6, 5, 3, 1, 2, 4, -5, -1, -4, 5, + 6, -4, -4, 5, 1, 5, 5, 8, 2, 0, 5, 10, 13, 4, 9, 3, 2, 1, 0, + 18, 10, 4, 5, 13, 15, 13, 4, 6, 16, 13, 7, 4, 4, -2, -3, 2, 2, + 4, 0, 5, -1, 0, 6, 1, 10, 4, -1, -14, 5, -1, -3, 6, 0, -10, 4, + 3, -8, 2, -6, 2, 1, 1, 7, 0, -3, 6, 1, -4, 15, 2, 5, 10, 11, + 9, 16, 19, 14, 10, 14, 7, 5, 21, 11, 11, 6, 12, 16, 18, 11, 11, + 19, 16, 4, 16, 16, 5, 11, 5, 17, 11, 10, 6, 1, -1, 10, 4, 6, + 20, 7, 6, 10, 7, 3, 7, 3, 13, 7, 9, 11, 11, 6, 0, 6, 11, 12, + 1, 10, 4, 6, 5, 8, 11, -1, 0, 9, 0, -6, 1, 5, 5, 7, 5, 12, 2, + 0, 4, 1, 8, 2, -1, 6, 8, 9, 5, 9, -9, 1, 4, 4, 1, -2, 11, 5, + 2, 7, 9, 2, 9, 13, 9, 0, 2, 7, -1, 12, 6, 8, 8, 3, -1, -4, 1, + 3, -2, -10, -5, 1, -3, 1, 7, -2, 2, -2, -1, 2, 9, -6, -7, 9, + -2, -1, 8, 3, 3, 4, -1, -7, 2, -8, 5, 7, -3, 1, 8, 2, 6, -5, + -13, -10, -1, 1, 3, 4, -12, 2, 3, 5, 1, -2, -5, 3, 5, -9, -8, + -2, 1, 6, 3, 1, -2, 6, -1, 11, 4, -3, 3, 4, -2, -2, -5, 3, -1, + 5, 9, 10, 6, 6, 9, -3, 5, 12, 8, 9, 4, 1, 5, 5, 4, -3, 2, 1, + 3, 4, 3, 4, 10, 5, 11, 1, 8, 9, 3, 4, 4, 5, -2, 7, 5, 4, 3, 6, + 7, 6, 2, 8, 5, 9, 12, 10, 1, 13, 11, 4, 12, 13, 8, 2, 5, 3, 6, + 2, 11, -2, 6, 3, 5, -6, 7, 1, 2, 0, -5, 3, 4, -1, 7, 5, 0, -6, + 2, 2, -3, 1, 4, 4, 1, 5, -1, 0, 1, 7, 4, 4, 2, 1, 7, 2, 2, -1, + 1, 0, -2, -1, 1, -1, 4, 1, 1, 8, -2, 2, 1, 3, 1, -1, -3, 0, 1, + 5, -1, 0, -3, -4, 6, 4, 1, 3, 0, 9, -3, -10, 5, 8, 4, 3, 10, + 4, 1, 9, 3, -3, 4, 5, 10, 9, 3, 11, 12, 3, -2, 9, -3, -2, 1, + -2, -2, 4, 2, 2, -5, -2, 2, 0, -1, 2, 0, 1, 2, 1, 2, 5, -2, 1, + 12, -1, 0, 4, 6, 2, 8, 2, 14, 2, 16, 5, 15, -1, 6, 9, 7, 16, + 0, 6, 4, 4, 11, 6, 14, 1, 3, 4, 7, 5, 7, 11, 0, 4, 1, 4, 4, 0, + 3, 11, -4, 4, 7, 4, 7, 0, 1, -1, 0, 14, 4, 8, -1, 9, -5, 11, + 10, 5, 6, 11, 15, 19, 12, 15, 18, 6, 3, 8, 6, 16, 4, 5, 12, 6, + 11, 13, 13, 10, 8, 8, 8, 3, 8, 16, 17, 2, 3, 19, 19, 9, 11, 14, + 15, 5, 9, -9, 5, 6, -5, -2, -4, 1, 7, -1, -3, -1, 2, 5, 7, -1, + 2, 2, -3, 0, 1, -2, 3, 2, 2, 5, 1, -18, 9, 6, 6, -19, 6, -1, + 3, 9, 6, 2, 1, 8, 1, 5, -5, -4, -22, 1, -3, -1, 2, -3, 0, 3, + 4, 4, 3, 0, 3, 1, 6, -2, 13, 4, -3, 14, 14, 3, 5, 7, 4, 17, 4, + 3, 13, 0, 1, 5, 11, 8, 10, 13, 3, 12, 5, -6, 1, 4, 13, 5, 10, + 1, -2, 9, 8, -2, 8, 9, 3, 9, 3, 4, 14, 7, 11, 7, -5, 2, 0, 0, + 6, -1, 15, -1, -1, 12, 4, 3, 0, 5, 4, 5, 4, 6, 13, 12, 8, 5, + 8, 3, 5, 4, 10, 9, 4, 8, 10, 5, 9, 2, 2, 4, 2, 4, 6, 2, 9, 4, + 8, 5, 1, 5, 2, -1, 8, 2, 2, 3, 1, 8, 3, 10, 4, 12, -7, 10, 11, + 9, 16, 15, 9, 12, 9, 6, 4, 4, 10, 12, 2, 7, 6, 1, 2, 6, 4, 8, + 3, 0, 9, 8, 2, 0, 5, 3, 7, 2, -1, -2, -3, 1, 4, 3, 6, 9, 1, 3, + 11, -10, 0, 11, 3, 4, 8, 3, 11, 7, 1, -3, -4, 14, 2, 1, 2, 12, + 5, 8, 1, 6, 9, 12, 9, 0, 2, 1, 9, 8, 6, 10, -1, -3, 8, 9, 1, + 2, 1, -4, 5, 6, 15, 5, 4, 5, 14, 15, 8, 6, 10, 2, 6, -4, 10, + 8, 3, 4, 15, 10, 10, 7, 16, 5, 4, 6, 4, 8, 5, 4, 12, 10, 9, 10, + 4, 0, 9, 10, 3, 6, 6, 11, 4, 8, 10, 1, 0, 5, 7, 10, -2, 6, 9, + 3, 8, -16, 16, 3, 9, 4, 12, 6, 4, -1, 5, 25, 5, 5, 5, 0, -3, + -2, 0, -1, -1, 2, -5, -2, -1, -4, 11, 5, 5, 2, 5, 2, 4, 1, 9, + 5, -1, -5, 8, 2, 2, 10, 0, 2, 6, 7, 8, -2, 0, 0, 4, 9, 4, 2, + 4, 1, 7, 4, 16, 9, 11, 4, 0, 2, 14, 0, 8, 0, 11, 1, 12, 1, -3, + 9, -6, 2, 6, -3, -6, 9, 5, 5, 7, -3, 3, -1, 1, 4, 5, 9, 11, 8, + -5, 9, 3, 2, 8, 7, 4, 4, 0, 7, 17, 7, 4, 1, 1, 5, 14, 8, 8, 10, + -9, 7, -3, 4, 6, 8, 10, 2, 3, 0, 3, 13, 12, 8, 8, 3, 9, 3, 1, + 0, 6, 3, 3, 9, 4, 7, 13, 7, -8, 0, 3, 9, -3, 4, 1, 12, 0, 5, + 1, 9, 1, -1, -5, 2, 1, 3, -1, 5, -1, 5, 3, 7, 9, 4, 3, -1, -5, + 1, -3, -1, -4, 0, 8, -3, -1, 13, 9, 3, 3, 2, 6, 1, 9, 10, 5, + 10, 2, 4, 11, 10, 5, 12, 11, 15, 5, 9, 5, 7, -1, 9, -1, -3, 5, + -1, 2, 4, 0, 11, -3, 3, 3, -2, 7, 4, 0, -4, 2, 1, 4, 12, 10, + 5, 2, 4, 11, -2, 2, 9, 8, 4, 5, 16, 6, 3, 2, 5, 5, -2, 7, 8, + 6, 1, -1, 9, 4, 9, 8, 6, 9, -1, 3, 1, 10, 4, 8, 12, 5, 4, 3, + 3, 7, -3, 8, 0, 6, 2, -2, 5, 4, 0, 0, 10, 0, 0, 5, 7, 3, 0, 8, + 6, 1, 5, -5, 7, 8, 16, 3, 10, 1, 3, 1, 8, 6, -8, -5, 11, 3, 9, + -7, 5, 0, 9, -13, 0, 1, 6, 6, 2, 6, -5, 2, 19, 13, 9, 6, 11, + 3, 4, 12, 4, 13, -2, 0, 8, 4, 1, 6, 13, 12, 2, 8, 2, 13, 1, 6, + 12, 10, 11, 7, 8, 14, 12, 10, 5, 8, 4, 0, 10, 16, 7, 14, 13, + 4, 8, 3, 4, 16, 6, 3, 8, 8, 7, -3, 2, 6, -5, 5, 6, 12, -10, 0, + 7, 7, -3, -2, -1, 3, 13, 1, 4, 2, 0, 8, 9, 25, 15, 19, 14, 2, + 6, 5, 12, 13, -5, -1, -4, 6, 0, 8, 11, 6, 12, 2, 4, 6, 6, 7, + 1, 7, 7, 9, 2, 3, 6, -2, 9, 9, 0, 6, 3, 12, 3, 12, 8, 6, 12, + 0, 8, 10, 1, 7, 4, 5, 12, 1, 6, 3, -7, 8, 13, 7, 16, 4, 7, 12, + 6, 2, 9, 11, 6, 5, 6, 7, 8, 13, 6, 16, 7, 3, 4, 7, 6, 11, 8, + 0, 11, 4, 0, 9, 12, 6, 13, 16, 4, 8, 4, 3, 5, 4, 11, 8, 6, 5, + 10, 12, 8, 6, 4, 4, 1, 11, 0, 16, 1, 8, 6, 4, -5, 4, 7, 7, 1, + 3, -1, 7, 1, 5, -4, 12, 10, 4, 3, 7, 7, 8, 7, 10, 4, 9, 8, 2, + 11, 9, 6, 7, 10, 4, 3, 6, 10, 12, 6, 14, 5, 8, 3, 6, 5, 2, -4, + -1, 4, 8, 2, 2, 6, 5, 2, -2, 1, 5, 1, 10, 3, 3, 4, 17, -1, 10, + 0, 5, 4, 1, 12, 12, 12, 8, 8, 1, 3, 1, 12, 8, 10, 3, 15, 2, 0, + 5, 0, -6, 4, 14, -1, 8, -1, 3, 2, -1, 2, 4, 6, 6, 1, 0, 9, 2, + 7, 0, 1, 11, -5, 5, 0, -3, -1, 11, 7, 13, -2, 3, 8, 0, 9, 9, + 12, 2, 10, -6, 8, 10, 13, 7, 4, 2, 0, -6, -3, 6, -1, 1, 0, 4, + 6, 3, 5, 5, 4, 5, 1, 5, 2, 7, 0, 9, 4, 6, 1, -6, 0, 0, 8, 2, + 11, 7, 8, 6, 8, 8, 12, 3, 5, 4, 5, 4, 6, 8, 1, 6, 4, 6, 5, 3, + 5, 1, -2, -2, -5, -6, -3, 1, 5, 6, 10, 2, 9, 3, 1, 4, 9, 9, 0, + 5, 6, -6, 7, 1, 8, 9, 6, 12, 0, 10, 3, 6, 5, 6, 2, 11, 14, 12, + 7, 6, 7, 4, 3, 9, 7, 6, 10, 5, 4, 5, 13, 6, -10, 6, 8, 5, 9, + -1, 4, 3, 0, 11, 13, 10, 6, 14, 4, 4, 11, 0, 6, 17, 16, 4, 8, + 8, -2, -1, 3, 6, 7, 15, -7, 3, 1, -5, -1, -11, -1, -9, -2, 3, + -6, 15, 4, -1, 8, -2, 8, 0, 1, 0, 4, 3, -7, 3, 6, -4, 1, 8, 3, + -9, -2, 8, 1, 0, -6, -3, 3, -6, -4, 0, -3, -1, 2, -1, 2, 3, 4, + -6, 10, -2, 0, 4, -2, 4, 6, 11, 6, 6, 5, 6, 13, 1, 9, 3, 6, 3, + 3, 3, 1, -2, -1, -1, 6, -3, -1, -1, 7, 6, -5, -2, 2, -1, 1, 5, + 9, 6, -3, 3, -6, 3, 2, 4, 2, -5, 2, 11, 14, 5, 4, 18, 7, 3, 2, + -3, 3, -1, -3, 6, 6, 2, 2, -3, 1, 12, 6, 10, 0, 12, 2, 5, 2, + 2, 6, -1, 1, -7, 6, -6, 13, 3, -13, 3, 3, 5, 1, -3, 0, -3, 2, + -7, -4, 2, 3, 12, -7, 7, 8, 1, 4, 0, -1, 4, 8, 9, 5, 5, 14, 6, + 3, 9, 5, 16, 12, 13, 9, 8, 6, 14, 1, 6, 10, 7, 11, -3, 8, 11, + 8, 9, 0, 6, 9, 8, 6, 20, 7, 6, 7, -2, -2, 5, 11, 6, 4, 6, 4, + 0, 9, 26, -3, 7, 5, 7, 6, 4, 2, 8, 0, 9, 4, 7, 0, 9, 8, 8, 1, + 15, 14, 11, 5, 12, 6, 10, 7, 6, 8, 2, 4, 11, 9, 15, 8, 12, -1, + 11, 13, 9, 18, 9, 5, -1, 4, 7, 13, 20, 11, 8, -1, 8, 7, 19, 12, + 15, 5, 7, 10, 5, 14, 14, 9, 3, 9, 2, 6, 8, 7, 5, 9, 4, 9, 3, + 9, 1, -1, 2, 2, 11, 7, 9, -2, 3, 8, 8, 3, -2, 8, 13, 10, 7, 8, + 15, 2, 8, 5, 4, -2, -4, 3, 0, 1, 6, 12, 9, 4, 4, 8, -4, 9, 5, + 4, 12, 6, 5, 11, 4, 16, 15, 7, 6, 0, 3, 6, 6, 9, 9, -1, 7, 8, + 5, 3, 4, -2, 6, 3, 7, -2, 10, 0, 0, -11, -2, 8, -2, 14, 9, 2, + 13, 6, 4, 8, 8, 8, 4, -2, 3, 4, 1, 5, 3, 3, 3, 4, 9, 3, 11, 6, + 10, 7, 6, 9, 4, 5, 10, 6, 4, 3, 8, 2, 6, 11, 3, 12, 13, 15, 7, + -3, 3, 10, 6, 6, 3, 12, 4, 4, 12, 2, 5, 1, 8, -1, 0, 2, 6, -2, + 1, -3, 3, 0, 0, 7, 6, 3, 7, 3, 1, 4, -1, 12, -8, 10, 3, 2, 13, + 0, 6, 4, -7, 6, 9, 0, -1, 9, 2, -2, 1, 1, -4, 2, 9, 11, -5, -1, + -14, -5, 2, 0, 9, -3, 7, -2, -1, 4, -5, 1, 3, 0, 0, 2, 3, 3, + 4, 3, 6, 2, 5, 10, 1, 2, -4, -2, 7, 3, 7, 10, -2, 2, -2, 3, 5, + 5, 17, 15, 7, 11, 13, 8, 4, -4, 8, 7, 11, 1, 7, 0, 3, 1, 3, 0, + 14, 7, 1, -8, 10, -2, 7, 6, 9, 4, 8, -5, 3, 6, -2, 5, 5, 6, -4, + 5, 6, 6, 9, 2, 8, 6, 11, 7, 0, 6, 14, 3, 0, 11, 15, 4, 11, 17, + 11, 7, 8, 8, 15, 3, 8, 7, 5, 1, -3, 11, 3, 12, 8, 4, 10, 12, + 10, 5, 0, 5, 11, 11, 15, 6, 4, 18, 2, 14, 6, 7, 11, 5, 10, 7, + 0, 3, 3, 9, 7, 6, 9, 12, 4, 5, 3, 8, 14, 2, 9, 5, 14, 4, 15, + 16, 7, 3, 0, -5, -1, -8, 1, 3, 1, -4, -14, -1, 5, 5, -3, -2, + 0, -8, -6, -2, -2, -10, 3, 1, 3, 5, 9, 0, 1, 1, -1, -3, 1, 9, + 7, 6, -2, 7, 1, -3, -6, 8, 3, 1, 3, 10, 11, 8, 6, -1, 3, -3, + -1, -1, -9, -1, -8, 4, -6, 2, 1, 1, -5, -1, 4, 5, -2, -4, -7, + -5, 4, 4, 6, -5, 3, 1, 0, -3, 4, 1, 3, 4, 2, -1, 0, -5, 1, 1, + 5, 4, -3, 0, 3, -1, -3, -2, 4, 0, -1, -1, -7, 0, 0, 4, 2, 6, + -1, 3, 0, 0, -3, 1, -1, 1, 6, 3, -1, 1, -2, -1, -3, -3, 7, 7, + -1, 6, 7, 5, 9, 2, 0, 2, -3, -1, 2, -2, -2, -3, 5, 12, 10, -2, + 2, -9, -3, 6, 2, 2, -2, -1, 2, -5, 5, 0, 4, 1, -2, 3, 8, 5, 1, + -1, -1, 1, 2, 4, 1, -1, -1, 4, 4, -4, 0, 5, 1, -1, 7, 2, -5, + -2, 2, -3, 11, -1, 5, -4, 5, 0, -3, 1, 4, 5, -5, 5, 3, 3, 4, + 0, 3, 5, -2, 3, 0, 1, 2, 3, -2, 3, 1, -4, 3, -4, 3, -1, -1, -1, + 1, 1, 2, 4, 4, 5, 2, 1, 2, 6, 7, -2, 5, 6, 1, 1, 7, 0, 5, 2, + 0, -2, 3, 11, -2, 4, -1, 3, -6, 4, 2, 2, -2, 0, 6, 5, 5, -2, + -1, 1, 7, 9, 9, 14, 3, 6, 0, 15, 1, 6, 6, 6, 1, -3, -1, 8, 1, + 5, 3, 12), +Class = structure(ordered(c(71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2, 2, 2, 2, 2, 2, 2, 2, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 149, 149, 149, 149, 149, 149, 149, 149, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 1, 1, 1, + 1, 1, 1, 1, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 10, 10, 10, 10, + 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 26, 26, 26, 26, 26, 26, 26, 26, 26, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 20, 20, 20, 20, 20, 20, 20, 20, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 81, 81, 81, 81, 81, 81, 81, 81, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, + 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 154, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 124, 124, 124, + 124, 124, 124, 124, 27, 27, 27, 27, 27, 27, 27, 27, 27, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 163, 163, 163, 163, 163, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 179, 179, 179, + 179, 179, 179, 179, 179, 111, 111, 111, 111, 111, 111, 111, 111, + 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, + 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 169, 169, 169, 169, 169, + 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 118, + 118, 118, 118, 118, 118, 118, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104), levels=1:190), + class = c("ordered", "factor"), + .Label = c("59", +"8", "176", "179", "17", "81", "7", "18", "6", "62", "63", "148", +"182", "2", "3", "180", "97", "147", "71", "79", "88", "90", +"45", "188", "82", "70", "140", "65", "96", "64", "22", "150", +"169", "181", "98", "185", "80", "186", "183", "26", "125", "152", +"111", "187", "67", "184", "9", "58", "118", "116", "86", "10", +"78", "143", "52", "163", "11", "167", "87", "189", "101", "23", +"168", "28", "122", "177", "12", "57", "170", "172", "1", "134", +"13", "41", "112", "19", "121", "21", "178", "29", "93", "46", +"76", "137", "33", "161", "51", "105", "103", "107", "37", "141", +"68", "89", "132", "113", "50", "4", "35", "44", "151", "92", +"136", "190", "5", "77", "83", "106", "115", "138", "155", "84", +"27", "114", "47", "120", "149", "166", "20", "42", "15", "119", +"91", "139", "159", "145", "60", "49", "142", "38", "127", "100", +"75", "164", "110", "31", "53", "16", "61", "102", "144", "156", +"54", "160", "40", "66", "108", "14", "34", "129", "24", "131", +"128", "135", "48", "171", "165", "109", "126", "56", "99", "173", +"146", "175", "123", "117", "25", "74", "162", "32", "39", "104", +"85", "133", "130", "30", "153", "36", "154", "174", "124", "69", +"157", "43", "55", "158", "72", "94", "95", "73"))), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = as.character(1:3691), +formula = Gain ~ Pretot | Class, +labels = list(x = "Sum of pre-test core item scores", +y = "Gain in mathematics achievement score"), +FUN = function (x) mean(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Semi2.R b/data/Semi2.R new file mode 100644 index 0000000..edff061 --- /dev/null +++ b/data/Semi2.R @@ -0,0 +1,44 @@ +### $Id: Semi2.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### A three-level nested design for the thickness of an oxide coating on a +### semiconductor. The levels Wafer within Lot. Source is an outer factor. +### Data set 4.4 from "SAS System for Mixed Models". +"Semi2" <- + structure(list( + Source = structure(factor(c(1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2), levels=1:2), class = "factor", .Label = c("1", "2")), +Lot = structure(factor(c(1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, + 8, 8, 8, 8, 8, 8, 8, 8), levels=1:8), class = "factor", + .Label = c("1", "2", "3", "4", "5", "6", "7", "8")), +Wafer = structure(factor(c(1, + 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, + 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, + 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, + 1, 1, 2, 2, 2, 3, 3, 3), levels=1:3), class = "factor", + .Label = c("1", "2", "3")), +Site = structure(factor(c(1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3), levels=1:3), class = "factor", .Label = c("1", "2", "3")), +Thickness = c(2006, + 1999, 2007, 1980, 1988, 1982, 2000, 1998, 2007, 1991, 1990, 1988, + 1987, 1989, 1988, 1985, 1983, 1989, 2000, 2004, 2004, 2001, 1996, + 2004, 1999, 2000, 2002, 1997, 1994, 1996, 1996, 2000, 2002, 1987, + 1990, 1995, 2013, 2004, 2009, 2023, 2018, 2010, 2020, 2023, 2015, + 2032, 2036, 2030, 2018, 2022, 2026, 2009, 2010, 2011, 1984, 1993, + 1993, 1992, 1992, 1990, 1996, 1993, 1987, 1996, 1989, 1996, 1997, + 1993, 1996, 1990, 1989, 1992)), +class = c("nmGroupedData", "groupedData", "data.frame"), +row.names = 1:72, +formula = Thickness ~ 1 | Lot/Wafer, +formulaList = list(Lot = ~Lot, Wafer = ~Wafer), +labels = list(y = "Thickness of oxide layer"), +outer = ~ Source, +order.groups = list(Lot = TRUE, Wafer = TRUE), +FUN = function (x) mean(x, na.rm = TRUE)) diff --git a/data/Semiconductor.R b/data/Semiconductor.R new file mode 100644 index 0000000..0c7c287 --- /dev/null +++ b/data/Semiconductor.R @@ -0,0 +1,40 @@ +### $Id: Semiconductor.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Resistance in a semiconductor - data set 2.2(b) in +### "SAS System for Mixed Models" +"Semiconductor" <- + structure(list( + resistance = c(5.22, 5.61, 6.11, 6.33, 6.13, 6.14, + 5.6, 5.91, 5.49, 4.6, 4.95, 5.42, 5.78, 6.52, 5.9, 5.67, 5.77, + 6.23, 5.57, 5.96, 6.43, 5.81, 5.83, 6.12, 5.66, 6.25, 5.46, 5.08, + 6.53, 6.5, 6.23, 6.84, 6.22, 6.29, 5.63, 6.36, 6.75, 6.97, 6.02, + 6.88, 6.22, 6.54, 6.12, 6.61, 6.05, 6.15, 5.55, 6.13), +ET = structure(factor(c(1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4), levels=1:4), + class = "factor", .Label = c("1", "2", "3", "4")), +Wafer = structure(factor(c(1, 1, 1, 1, 2, 2, + 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, + 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3 + ), levels=1:3), + class = "factor", .Label = c("1", "2", "3")), +position = structure(factor(c(1, + 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, + 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, + 4, 1, 2, 3, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +Grp = structure(factor(c(1, 1, 1, 1, 2, 2, 2, + 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, + 12, 12), levels=1:12), + class = c("ordered", "factor"), + .Label = c("1/1", + "1/2", "1/3", "2/1", "2/2", "2/3", "3/1", "3/2", "3/3", "4/1", + "4/2", "4/3"))), +row.names = 1:48, +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = resistance ~ 1 | Grp, +outer = ~ET, +inner = ~position, +FUN = function (x) mean(x, na.rm = T), +order.groups = TRUE) diff --git a/data/TeachingI.R b/data/TeachingI.R new file mode 100644 index 0000000..8dec9dd --- /dev/null +++ b/data/TeachingI.R @@ -0,0 +1,62 @@ +### $Id: TeachingI.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Split-plot analysis of covariance data for different teachers (uTeacher) +### using different methods (Method) on Students of different genders. +### Data set 5.6 in "SAS System for Mixed Models" +"TeachingI" <- + structure(list( + Method = structure(factor(c(1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3), levels=1:3), class = "factor", + .Label = c("1", "2", "3")), +Teacher = structure(factor(c(1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, + 4, 4, 4, 4, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +Gender = structure(factor(c(1, 1, 1, 1, 2, 2, + 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, + 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, + 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, + 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, + 1, 1, 2, 2, 2, 2), levels=1:2), .Label = c("f", "m"), class = "factor"), +Student = structure(factor(c(1, + 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, + 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, + 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, + 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, + 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +score = c(15, 17, 16, 16, 17, 16, 17, 17, 18, + 17, 17, 16, 16, 17, 18, 17, 15, 15, 15, 16, 15, 15, 15, 16, 16, + 17, 16, 15, 14, 17, 17, 16, 21, 22, 22, 21, 20, 20, 21, 22, 21, + 20, 20, 21, 18, 19, 20, 19, 23, 23, 24, 23, 21, 20, 21, 22, 23, + 22, 22, 22, 19, 19, 19, 20, 33, 31, 31, 32, 27, 28, 27, 27, 28, + 27, 27, 29, 23, 23, 24, 23, 30, 29, 29, 30, 25, 25, 26, 24, 28, + 27, 28, 30, 25, 25, 22, 25), +Experience = c(11, 11, 11, 11, 11, + 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 17, + 17, 17, 17, 17, 17, 17, 17, 6, 6, 6, 6, 6, 6, 6, 6, 11, 11, 11, + 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, + 18, 18, 18, 18, 18, 8, 8, 8, 8, 8, 8, 8, 8, 18, 18, 18, 18, 18, + 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 12, 6, 6, 6, 6, 6, 6, + 6, 6), +uTeacher = structure(ordered(c(1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, + 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12), levels=1:12), + class = c("ordered", "factor"), + .Label = c("1/1", "1/2", "1/3", "1/4", "2/1", "2/2", + "2/3", "2/4", "3/1", "3/2", "3/3", "3/4"))), +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = as.character(1:96), +formula = score ~ 1 | uTeacher, +inner = ~Gender, +FUN = function (x) max(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/TeachingII.R b/data/TeachingII.R new file mode 100644 index 0000000..20b61f0 --- /dev/null +++ b/data/TeachingII.R @@ -0,0 +1,57 @@ +### $Id: TeachingII.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Split-plot analysis of covariance data for different teachers (uTeacher) +### using different methods (Method) on Students of different genders. +### Data set 5.7 in "SAS System for Mixed Models" +"TeachingII" <- + structure(list( + Method = structure(factor(c(1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3), levels=1:3), class = "factor", + .Label = c("1", "2", "3")), +Teacher = structure(factor(c(1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, + 4, 4, 4, 4, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +Gender = structure(factor(c(1, 1, 1, 1, 2, 2, + 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, + 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, + 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, + 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, + 1, 1, 2, 2, 2, 2), levels=1:2), .Label = c("f", "m"), + class = "factor"), +IQ = c(89, 105, 108, 116, 95, 103, 91, 82, 83, 103, 123, 103, 118, 101, + 101, 82, 115, 91, 109, 85, 98, 84, 91, 110, 120, 98, 99, 91, + 80, 112, 105, 94, 97, 105, 120, 92, 91, 96, 95, 84, 105, 110, + 98, 92, 104, 105, 82, 109, 141, 107, 116, 105, 93, 113, 92, 115, + 112, 96, 103, 105, 111, 121, 87, 90, 87, 78, 117, 108, 92, 111, + 126, 123, 126, 112, 108, 92, 95, 109, 115, 115, 102, 96, 113, + 127, 112, 96, 114, 101, 95, 105, 95, 102, 80, 97, 114, 100), +score = c(54, 55, 54, 64, 59, 58, 42, 48, + 48, 56, 67, 54, 65, 65, 50, 55, 71, + 66, 69, 59, 76, 64, 63, 74, 75, 60, 64, 59, 55, 70, 63, 62, 67, + 74, 78, 69, 67, 64, 65, 52, 73, 78, 75, 65, 75, 78, 58, 75, 97, + 68, 82, 86, 71, 82, 72, 77, 74, 76, 78, 77, 75, 86, 68, 74, 71, + 71, 85, 87, 65, 72, 85, 78, 91, 80, 75, 65, 73, 73, 78, 71, 82, + 72, 87, 91, 85, 68, 86, 78, 86, 91, 81, 85, 68, 81, 89, 87), +uTeacher = structure(ordered(c(1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12), levels=1:12), + class = c("ordered", "factor"), + .Label = c("1/1", "1/2", "1/3", "1/4", "2/1", "2/2", + "2/3", "2/4", "3/1", "3/2", "3/3", "3/4"))), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:96, +formula = score ~ IQ | uTeacher, +labels = list(x = "Intelligence Quotient"), +inner = ~ Gender, +FUN = function (x) mean(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/WWheat.R b/data/WWheat.R new file mode 100644 index 0000000..1e55549 --- /dev/null +++ b/data/WWheat.R @@ -0,0 +1,34 @@ +# $Id: WWheat.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +# Winter wheat yields versus preplant soil moisture for 10 varieties +# Data set 7.2 from "SAS System for Mixed Models". +"WWheat" <- + structure(list( +Variety = structure(c(6, 6, 6, 6, 6, 6, 2, 2, + 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, + 9, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 5, 5, + 5, 5, 5, 5, 10, 10, 10, 10, 10, 10), + .Label = c("7", "2", "4", "8", "9", "1", "3", "6", "5", "10"), + class = c("ordered", "factor")), +Yield = c(41, 69, 53, 66, 64, 64, 49, 44, 44, 46, 57, 42, + 69, 62, 50, 76, 48, 55, 48, 60, 45, 47, 62, 43, 65, 63, 71, 68, + 52, 68, 76, 46, 45, 67, 65, 79, 35, 37, 30, 30, 57, 49, 75, 64, + 46, 54, 52, 52, 51, 63, 42, 61, 67, 69, 60, 73, 66, 71, 67, 74 + ), +Moisture = c(10, 57, 32, 52, 47, 48, 30, 21, 20, 26, 44, 19, + 50, 40, 23, 58, 21, 30, 22, 40, 17, 21, 44, 13, 49, 44, 57, 51, + 27, 52, 55, 11, 11, 43, 38, 60, 17, 20, 11, 10, 48, 36, 57, 41, + 15, 28, 23, 23, 26, 44, 13, 40, 48, 53, 37, 58, 44, 53, 48, 59 + )), +row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", +"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", +"21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", +"32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", +"43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", +"54", "55", "56", "57", "58", "59", "60"), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = Yield ~ Moisture | Variety, +labels = list(x = "Preplant moisture content of top 36 inches of soil", +y = "Winter Wheat Yield"), +units = list(y = "Bu/Acre"), +FUN = function (x) mean(x, na.rm = FALSE), +order.groups = TRUE) diff --git a/data/WaferTypes.R b/data/WaferTypes.R new file mode 100644 index 0000000..6b60a32 --- /dev/null +++ b/data/WaferTypes.R @@ -0,0 +1,104 @@ +### $Id: WaferTypes.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### A complex split plot design in semiconductor wafer fabrication. +### There are crossed factors of Type and Temperatures within Group. +### Data set 5.8 from "SAS System for Mixed Models" +"WaferTypes" <- + structure(list( + Group = structure(factor(c(1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), levels=1:4), class = "factor", + .Label = c("1", "2", "3", "4")), +Temperature = structure(ordered(c(1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), levels=1:3), + class = c("ordered", "factor"), + .Label = c("900", "1000", "1100")), +Type = structure(factor(c(1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2), levels=1:2), + .Label = c("A", "B"), class = "factor"), +Wafer = c(1, 1, 1, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 1, 1, 1, 2, 2, 2), +Site = c(1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, 2, 3), +delta = c(291, 295, 294, 318, + 315, 315, 349, 348, 345, 332, 334, 331, 319, 315, 321, 290, 289, + 292, 358, 357, 362, 365, 367, 367, 264, 266, 268, 276, 280, 278, + 352, 353, 350, 330, 330, 334, 306, 302, 305, 342, 341, 336, 342, + 341, 340, 366, 363, 361, 299, 296, 297, 329, 330, 332, 348, 346, + 346, 350, 346, 347, 285, 292, 289, 306, 303, 304, 357, 360, 359, + 361, 361, 360, 318, 323, 323, 307, 308, 308, 372, 371, 370, 348, + 349, 352, 264, 265, 265, 274, 268, 275, 332, 337, 335, 322, 326, + 321, 273, 275, 276, 276, 273, 273, 333, 332, 332, 349, 350, 352, + 295, 297, 296, 326, 326, 328, 322, 325, 327, 335, 332, 334, 258, + 260, 260, 280, 276, 278, 319, 322, 317, 311, 313, 313, 282, 282, + 279, 271, 271, 270, 335, 339, 338, 304, 303, 303), +Thick = c(1919, + 1919, 1919, 2113, 2113, 2113, 1965, 1965, 1965, 1829, 1829, 1829, + 2098, 2098, 2098, 1823, 1823, 1823, 2059, 2059, 2059, 2145, 2145, + 2145, 1846, 1846, 1846, 2028, 2028, 2028, 2086, 2086, 2086, 1899, + 1899, 1899, 1841, 1841, 1841, 2170, 2170, 2170, 1981, 1981, 1981, + 2190, 2190, 2190, 1915, 1915, 1915, 2161, 2161, 2161, 2072, 2072, + 2072, 2082, 2082, 2082, 1854, 1854, 1854, 2046, 2046, 2046, 2062, + 2062, 2062, 2055, 2055, 2055, 2019, 2019, 2019, 1872, 1872, 1872, + 2182, 2182, 2182, 1973, 1973, 1973, 1828, 1828, 1828, 1827, 1827, + 1827, 2109, 2109, 2109, 2003, 2003, 2003, 1925, 1925, 1925, 1942, + 1942, 1942, 1893, 1893, 1893, 2170, 2170, 2170, 1862, 1862, 1862, + 2149, 2149, 2149, 1888, 1888, 1888, 1998, 1998, 1998, 1815, 1815, + 1815, 1981, 1981, 1981, 2012, 2012, 2012, 1892, 1892, 1892, 2083, + 2083, 2083, 2036, 2036, 2036, 2174, 2174, 2174, 1802, 1802, 1802), +uWafer = structure(ordered(c(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, + 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, + 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, + 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, + 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, + 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, + 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, + 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, + 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, + 48, 48), levels=1:48), + class = c("ordered", "factor"), + .Label = c("1/900/A/1", + "1/900/A/2", "1/900/B/1", "1/900/B/2", "1/1000/A/1", "1/1000/A/2", + "1/1000/B/1", "1/1000/B/2", "1/1100/A/1", "1/1100/A/2", "1/1100/B/1", + "1/1100/B/2", "2/900/A/1", "2/900/A/2", "2/900/B/1", "2/900/B/2", + "2/1000/A/1", "2/1000/A/2", "2/1000/B/1", "2/1000/B/2", "2/1100/A/1", + "2/1100/A/2", "2/1100/B/1", "2/1100/B/2", "3/900/A/1", "3/900/A/2", + "3/900/B/1", "3/900/B/2", "3/1000/A/1", "3/1000/A/2", "3/1000/B/1", + "3/1000/B/2", "3/1100/A/1", "3/1100/A/2", "3/1100/B/1", "3/1100/B/2", + "4/900/A/1", "4/900/A/2", "4/900/B/1", "4/900/B/2", "4/1000/A/1", + "4/1000/A/2", "4/1000/B/1", "4/1000/B/2", "4/1100/A/1", "4/1100/A/2", + "4/1100/B/1", "4/1100/B/2"))), +class = c("nffGroupedData", "nfGroupedData", "groupedData", "data.frame"), +row.names = 1:144, +formula = delta ~ 1 | uWafer, +labels = list(y = "Rate of deposition of polysilicon"), +FUN = function (x) mean(x, na.rm = TRUE), +order.groups = TRUE) diff --git a/data/Weights.R b/data/Weights.R new file mode 100644 index 0000000..3080713 --- /dev/null +++ b/data/Weights.R @@ -0,0 +1,144 @@ +### $Id: Weights.R,v 1.1 2000/02/09 18:36:49 bates Exp $ +### Strength over time for subjects in three different weight-training +### programs. Data set 3.2(a) from "SAS System for Mixed Models" +"Weights" <- + structure(list( +strength = c(85, 85, 86, 85, 87, 86, 87, 80, 79, + 79, 78, 78, 79, 78, 78, 77, 77, 77, 76, 76, 77, 84, 84, 85, 84, + 83, 84, 85, 80, 81, 80, 80, 79, 79, 80, 76, 78, 77, 78, 78, 77, + 74, 79, 79, 80, 79, 80, 79, 81, 76, 76, 76, 75, 75, 74, 74, 77, + 78, 78, 80, 80, 81, 80, 79, 79, 79, 79, 77, 78, 79, 81, 81, 80, + 80, 80, 81, 82, 77, 76, 77, 78, 77, 77, 77, 82, 83, 83, 83, 84, + 83, 83, 84, 84, 83, 82, 81, 79, 78, 79, 81, 81, 82, 82, 82, 80, + 79, 79, 78, 77, 77, 78, 78, 83, 82, 83, 85, 84, 83, 82, 78, 78, + 79, 79, 78, 77, 77, 80, 80, 79, 79, 80, 80, 80, 78, 79, 80, 81, + 80, 79, 80, 79, 79, 79, 80, 80, 78, 80, 83, 83, 85, 85, 86, 87, + 87, 81, 83, 82, 82, 83, 83, 82, 81, 81, 81, 82, 82, 83, 81, 80, + 81, 82, 82, 82, 84, 86, 76, 76, 76, 76, 76, 76, 75, 81, 84, 83, + 83, 85, 85, 85, 77, 78, 79, 79, 81, 82, 81, 84, 85, 87, 89, 88, + 85, 86, 74, 75, 78, 78, 79, 78, 78, 76, 77, 77, 77, 77, 76, 76, + 84, 84, 86, 85, 86, 86, 86, 79, 80, 79, 80, 80, 82, 82, 78, 78, + 77, 76, 75, 75, 76, 78, 80, 77, 77, 75, 75, 75, 84, 85, 85, 85, + 85, 83, 82, 84, 85, 84, 83, 83, 83, 84, 74, 75, 75, 76, 75, 76, + 76, 83, 84, 82, 81, 83, 83, 82, 86, 87, 87, 87, 87, 87, 86, 82, + 83, 84, 85, 84, 85, 86, 79, 80, 79, 79, 80, 79, 80, 79, 79, 79, + 81, 81, 83, 83, 87, 89, 91, 90, 91, 92, 92, 81, 81, 81, 82, 82, + 83, 83, 82, 82, 82, 84, 86, 85, 87, 79, 79, 80, 81, 81, 81, 81, + 79, 80, 81, 82, 83, 82, 82, 83, 84, 84, 84, 84, 83, 83, 81, 81, + 82, 84, 83, 82, 85, 78, 78, 79, 79, 78, 79, 79, 83, 82, 82, 84, + 84, 83, 84, 80, 79, 79, 81, 80, 80, 80, 80, 82, 82, 82, 81, 81, + 81, 85, 86, 87, 86, 86, 86, 86, 77, 78, 80, 81, 82, 82, 82, 80, + 81, 80, 81, 81, 82, 83), +Subject = structure(factor(c(1, 1, 1, + 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, + 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, + 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, + 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 2, 2, 2, 2, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, + 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, + 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, + 1, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 16, + 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, + 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, + 20, 20, 21, 21, 21, 21, 21, 21, 21, 2, 2, 2, 2, 2, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 1, 1, + 1, 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, + 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, + 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 2, 2, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 14, 14), levels=1:21), class = "factor", + .Label = c("1", + "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", + "20", "21", "3", "4", "5", "6", "7", "8", "9")), +Program = structure(factor(c(1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), + levels=1:3), class = "factor", .Label = c("CONT", "RI", "WI")), +Subj = structure(ordered(c(20, 20, 20, 20, 20, + 20, 20, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 19, 19, 19, + 19, 19, 19, 19, 13, 13, 13, 13, 13, 13, 13, 3, 3, 3, 3, 3, 3, + 3, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, + 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, + 4, 4, 4, 4, 4, 4, 4, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, + 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 5, 5, 5, 5, 5, 5, + 5, 18, 18, 18, 18, 18, 18, 18, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, + 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 26, 26, 26, 26, 26, + 26, 26, 34, 34, 34, 34, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, + 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 21, 21, + 21, 21, 21, 21, 21, 32, 32, 32, 32, 32, 32, 32, 27, 27, 27, 27, + 27, 27, 27, 36, 36, 36, 36, 36, 36, 36, 25, 25, 25, 25, 25, 25, + 25, 23, 23, 23, 23, 23, 23, 23, 35, 35, 35, 35, 35, 35, 35, 28, + 28, 28, 28, 28, 28, 28, 22, 22, 22, 22, 22, 22, 22, 24, 24, 24, + 24, 24, 24, 24, 33, 33, 33, 33, 33, 33, 33, 52, 52, 52, 52, 52, + 52, 52, 37, 37, 37, 37, 37, 37, 37, 49, 49, 49, 49, 49, 49, 49, + 56, 56, 56, 56, 56, 56, 56, 54, 54, 54, 54, 54, 54, 54, 39, 39, + 39, 39, 39, 39, 39, 43, 43, 43, 43, 43, 43, 43, 57, 57, 57, 57, + 57, 57, 57, 47, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, + 53, 41, 41, 41, 41, 41, 41, 41, 45, 45, 45, 45, 45, 45, 45, 51, + 51, 51, 51, 51, 51, 51, 48, 48, 48, 48, 48, 48, 48, 38, 38, 38, + 38, 38, 38, 38, 50, 50, 50, 50, 50, 50, 50, 40, 40, 40, 40, 40, + 40, 40, 46, 46, 46, 46, 46, 46, 46, 55, 55, 55, 55, 55, 55, 55, + 42, 42, 42, 42, 42, 42, 42, 44, 44, 44, 44, 44, 44, 44), levels=1:57), + class = c("ordered", "factor"), + .Label = c("CONT/8", "CONT/3", "CONT/6", + "CONT/12", "CONT/16", "CONT/18", "CONT/10", "CONT/2", "CONT/9", + "CONT/20", "CONT/7", "CONT/19", "CONT/5", "CONT/11", "CONT/15", + "CONT/14", "CONT/13", "CONT/17", "CONT/4", "CONT/1", "RI/6", + "RI/14", "RI/11", "RI/15", "RI/10", "RI/1", "RI/8", "RI/13", + "RI/4", "RI/3", "RI/5", "RI/7", "RI/16", "RI/2", "RI/12", "RI/9", + "WI/2", "WI/15", "WI/6", "WI/17", "WI/11", "WI/20", "WI/7", "WI/21", + "WI/12", "WI/18", "WI/9", "WI/14", "WI/3", "WI/16", "WI/13", + "WI/1", "WI/10", "WI/5", "WI/19", "WI/4", "WI/8")), +Time = c(1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, + 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, + 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, + 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, + 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, + 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, + 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, + 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, + 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, + 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, + 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, + 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, + 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, + 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, + 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, + 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, + 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, + 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, + 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, + 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, + 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 1, + 3, 5, 7, 9, 11, 13)), +FUN = function (x) mean(x, na.rm = TRUE), +class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), +formula = strength ~ Time | Subj, +order.groups = TRUE, +outer = ~Program, +row.names = 1:399, +labels = list(x = "Time since beginning of study", y = "Strength"), +units = list(x = "(days)")) diff --git a/defs.tex b/defs.tex new file mode 100644 index 0000000..0bfe8b3 --- /dev/null +++ b/defs.tex @@ -0,0 +1,51 @@ +%%% $Id: defs.tex,v 1.1 1999/10/13 00:50:09 saikat Exp $ +\newcommand{\abs}{\operatorname{abs}} +\newcommand{\tr}{\operatorname{tr}} +\newcommand{\bm}[1]{{\boldsymbol {#1}}} +\newcommand{\Ti}[1]{\centerline{\textbf{\large\blue #1}}} +\newcommand{\mg}[1]{{\magenta #1}} +\newcommand{\gaus}{{\cal N}} +\newcommand{\Cf}[1]{\textsf{#1}} +\newcommand{\E}[1]{\mbox{E}\left(#1\right)} +\newcommand{\bA}{{\bm A}} +\newcommand{\bB}{{\bm B}} +\newcommand{\bD}{{\bm D}} +\newcommand{\bDelta}{{\bm\Delta}} +\newcommand{\bI}{{\bm I}} +\newcommand{\bLambda}{\bm\Lambda} +\newcommand{\bSigma}{\bm\Sigma} +\newcommand{\bQ}{{\bm Q}} +\newcommand{\bR}{{\bm R}} +\newcommand{\bS}{{\bm S}} +\newcommand{\bT}{{\bm T}} +\newcommand{\bU}{{\bm U}} +\newcommand{\bX}{{\bm X}} +\newcommand{\bZ}{{\bm Z}} +\newcommand{\ba}{{\bm a}} +\newcommand{\balpha}{\bm\alpha} +\newcommand{\bbeta}{\bm\beta} +\newcommand{\bbf}{\bm f} +\newcommand{\bb}{{\bm b}} +\newcommand{\bc}{{\bm c}} +\newcommand{\bd}{{\bm d}} +\newcommand{\bdelta}{{\bm \delta}} +\newcommand{\beps}{\bm\epsilon} +\newcommand{\bphi}{\bm\phi} +\newcommand{\brho}{\bm\rho} +\newcommand{\btau}{\bm{\tau}} +\newcommand{\btheta}{\bm{\theta}} +\newcommand{\bv}{{\bm v}} +\newcommand{\bx}{{\bm x}} +\newcommand{\by}{{\bm y}} +\newcommand{\bz}{{\bm z}} +\newcommand{\bzer}{{\bm 0}} +\newcommand{\simind}{\mbox{$\stackrel{\rm ind}{\sim}$}} +\newcommand{\s}{\textsf{S}} +\newcommand{\R}{\textsf{R}} +\newcommand{\Splus}{\textsf{S-PLUS}} +\newcommand{\Co}[1]{{\small\texttt{#1}}} +\newcommand{\trans}{^\prime{}} +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "all" +%%% End: diff --git a/man/Animal.Rd b/man/Animal.Rd new file mode 100644 index 0000000..0a9d316 --- /dev/null +++ b/man/Animal.Rd @@ -0,0 +1,35 @@ +\name{Animal} +\alias{Animal} +\non_function{} +\title{Animal breeding experiment} +\description{ + The \code{Animal} data frame has 20 rows and 3 columns giving the + average daily weight gains for animals with different genetic + backgrounds. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Sire}{ + a factor denoting the sire. (5 levels) + } + \item{Dam}{ + a factor denoting the dam. (2 levels) + } + \item{AvgDailyGain}{ + a numeric vector of average daily weight gains + } + } +}\details{ + This appears to be constructed data. +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 6.4). +} +\examples{ +library(SASmixed) +data(Animal) +} +\keyword{datasets} diff --git a/man/AvgDailyGain.Rd b/man/AvgDailyGain.Rd new file mode 100644 index 0000000..0374cf1 --- /dev/null +++ b/man/AvgDailyGain.Rd @@ -0,0 +1,59 @@ +\name{AvgDailyGain} +\alias{AvgDailyGain} +\non_function{} +\title{Average daily weight gain of steers on different diets} +\description{ + The \code{AvgDailyGain} data frame has 32 rows and 6 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Id}{ + the animal number + } + \item{Block}{ + an ordered factor indicating the barn in which the steer was housed. + } + \item{Treatment}{ + an ordered factor with levels + \code{0} < \code{10} < \code{20} < \code{30} + indicating the amount of medicated feed additive added to + the base ration. + } + \item{adg}{ + a numeric vector of average daily weight gains over a period + of 160 days. + } + \item{InitWt}{ + a numeric vector giving the initial weight of the animal + } + \item{Trt}{ + the \code{Treatment} as a numeric variable + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.3). +} +\examples{ +library(SASmixed) +data(AvgDailyGain) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +## plot of adg versus Treatment by Block +coplot(adg ~ as.numeric(Treatment) | Block, data = AvgDailyGain, + show = FALSE) +fm1Adg <- lme( adg ~ InitWt * Treatment - 1, + data = AvgDailyGain, random = ~ 1 | Block) +summary( fm1Adg ) # compare with output 5.1, p. 178 +VarCorr( fm1Adg ) # show the variance component estimates +anova( fm1Adg ) # checking significance of terms +fm2Adg <- update( fm1Adg, adg ~ InitWt + Treatment ) # common slope model +summary( fm2Adg ) +VarCorr( fm2Adg ) +anova( fm2Adg ) +summary( update( fm1Adg, adg ~ InitWt + Treatment - 1 ) ) +} +\keyword{datasets} diff --git a/man/BIB.Rd b/man/BIB.Rd new file mode 100644 index 0000000..4995132 --- /dev/null +++ b/man/BIB.Rd @@ -0,0 +1,55 @@ +\name{BIB} +\alias{BIB} +\non_function{} +\title{Data from a balanced incomplete block design} +\description{ + The \code{BIB} data frame has 24 rows and 5 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Block}{ + an ordered factor with levels + \code{1} < \code{2} < \code{3} < \code{8} < \code{5} < \code{4} < \code{6} < \code{7} + } + \item{Treatment}{ + a treatment factor with levels \code{1} to \code{4}. + } + \item{y}{ + a numeric vector representing the response + } + \item{x}{ + a numeric vector representing the covariate + } + \item{Grp}{ + a factor with levels + \code{13} and + \code{24} + } + } +} +\details{ + These appear to be constructed data. +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.4). +} +\examples{ +library(SASmixed) +data(BIB) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +coplot(y ~ x | Block, data = BIB, show = FALSE) +fm1BIB <- lme(y ~ Treatment * x, data = BIB, random = ~ 1 | Block) +summary(fm1BIB) # compare with Output 5.7, p. 188 +VarCorr(fm1BIB) +anova(fm1BIB) # strong evidence of different slopes +fm2BIB <- lme(y ~ Treatment + x : Grp, data = BIB, + random = ~ 1 | Block) +summary(fm2BIB) # compare with Output 5.9, p. 193 +VarCorr(fm2BIB) +anova(fm2BIB) +} +\keyword{datasets} diff --git a/man/Bond.Rd b/man/Bond.Rd new file mode 100644 index 0000000..64f5d63 --- /dev/null +++ b/man/Bond.Rd @@ -0,0 +1,45 @@ +\name{Bond} +\alias{Bond} +\non_function{} +\title{Strengths of metal bonds} +\description{ + The \code{Bond} data frame has 21 rows and 3 columns of data on the + strength required to break metal bonds according to the metal and + the ingot. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{pressure}{ + a numeric vector of pressures required to break the bond + } + \item{Metal}{ + a factor with levels \code{c}, \code{i} and \code{n} + indicating the metal involved (copper, iron or nickel). + } + \item{Ingot}{ + an ordered factor indicating the ingot of the composition + material. + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 1.2.4). + + Mendenhall, M., Wackerly, D. D. and Schaeffer, R. L. (1990), + \emph{Mathematical Statistics}, Wadsworth (Exercise 13.36). +} +\examples{ +library(SASmixed) +data(Bond) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +formula(Bond) # check the formula +fm1Bond <- lme( pressure ~ Metal, data = Bond, random = ~ 1 | Ingot) +summary( fm1Bond ) # compare with output 1.1 on p. 6 +VarCorr( fm1Bond ) # variance component estimates +anova( fm1Bond ) +} +\keyword{datasets} diff --git a/man/Cultivation.Rd b/man/Cultivation.Rd new file mode 100644 index 0000000..d6ff37f --- /dev/null +++ b/man/Cultivation.Rd @@ -0,0 +1,55 @@ +\name{Cultivation} +\alias{Cultivation} +\non_function{} +\title{Bacterial innoculation applied to grass cultivars} +\description{ + The \code{Cultivation} data frame has 24 rows and 4 columns of data + from an experiment on the effect on dry weight yield of three + bacterial inoculation treatments applied to two grass cultivars. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Block}{ + a factor with levels \code{1} to \code{4} + } + \item{Cult}{ + the cultivar factor with levels \code{a} and \code{b} + } + \item{Inoc}{ + the innoculant factor with levels \code{con}, \code{dea} and + \code{liv} + } + \item{drywt}{ + a numeric vector of dry weight yields + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 2.2(a)). + + Littel, R. C., Freund, R. J., and Spector, P. C. (1991), \emph{SAS + System for Linear Models, Third Ed.}, SAS Institute. +} +\examples{ +library(SASmixed) +data(Cultivation) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +names( Cultivation ) +formula( Cultivation ) +fm1Cult <- lme( drywt ~ Inoc * Cult, data = Cultivation, + random = list( Block = ~ 1, Cult = ~ 1 ) ) +summary( fm1Cult ) # compare with Output 2.10, page 58 +VarCorr( fm1Cult ) +anova( fm1Cult ) +fm2Cult <- update( fm1Cult, drywt ~ Inoc + Cult ) +anova( fm2Cult ) +fm3Cult <- update( fm1Cult, drywt ~ Inoc ) +anova( fm3Cult ) +summary( fm3Cult ) +VarCorr( fm3Cult ) +} +\keyword{datasets} diff --git a/man/Demand.Rd b/man/Demand.Rd new file mode 100644 index 0000000..a7ee1da --- /dev/null +++ b/man/Demand.Rd @@ -0,0 +1,66 @@ +\name{Demand} +\alias{Demand} +\non_function{} +\title{Per-capita demand deposits by state and year} +\description{ + The \code{Demand} data frame has 77 rows and 8 columns of data on + per-capita demand deposits by state and year. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{State}{ + an ordered factor with levels + \code{WA} < \code{FL} < \code{CA} < \code{TX} < \code{IL} < \code{DC} < \code{NY} + } + \item{Year}{ + an ordered factor with levels + \code{1949} < \dots{} < \code{1959} + } + \item{d}{ + a numeric vector of per-capita demand deposits + } + \item{y}{ + a numeric vector of permanent per-capita personal income + } + \item{rd}{ + a numeric vector of service charges on demand deposits + } + \item{rt}{ + a numeric vector of interest rates on time deposits + } + \item{rs}{ + a numeric vector of interest rates on savings and loan + association shares. + } + \item{grp}{ + a dummy factor with a single level. This is used to + construct crossed random effects in \code{lme}. + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 1.2.4). + + Feige, E. L. (1964), \emph{The Demand for Liquid Assets: A Temporal + Cross-Sectional Analysis. +} +\examples{ +library(SASmixed) +data(Demand) +names( Demand ) +formula( Demand ) +# the "grp" factor is a dummy factor with only one level. +unique( Demand$grp ) +# Crossed random-effects factors have to be created by pdIdent +# applied to the indicator variables and joined by pdBlocked. +fm1Demand <- + lme( log(d) ~ log(y) + log(rd) + log(rt) + log(rs), data = Demand, + random = list(grp = pdBlocked(list(pdIdent(~ State - 1), + pdIdent(~ Year - 1))))) +summary( fm1Demand ) # compare to output 3.13, p. 132 +VarCorr( fm1Demand ) +} +\keyword{datasets} diff --git a/man/Genetics.Rd b/man/Genetics.Rd new file mode 100644 index 0000000..f4c38d6 --- /dev/null +++ b/man/Genetics.Rd @@ -0,0 +1,42 @@ +\name{Genetics} +\alias{Genetics} +\non_function{} +\title{Heritability data} +\description{ +The \code{Genetics} data frame has 60 rows and 4 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Location}{ + a factor with levels \code{1} to \code{4} + } + \item{Block}{ + a factor with levels \code{1} to \code{3} + } + \item{Family}{ + a factor with levels \code{1} to \code{5} + } + \item{Yield}{ + a numeric vector of crop yields + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 4.5). +} +\examples{ +library(SASmixed) +data(Genetics) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +formula( Genetics ) +fm1Gen <- lme( Yield ~ 1, data = Genetics, + random = list(Location = pdCompSymm(~ Family - 1), Block = ~ 1) ) +summary( fm1Gen ) +VarCorr( fm1Gen ) # compare with Output 4.18, p. 165 +anova( fm1Gen ) +} +\keyword{datasets} diff --git a/man/HR.Rd b/man/HR.Rd new file mode 100644 index 0000000..3eca97d --- /dev/null +++ b/man/HR.Rd @@ -0,0 +1,61 @@ +\name{HR} +\alias{HR} +\non_function{} +\title{Heart rates of patients on different drug treatments} +\description{ + The \code{HR} data frame has 120 rows and 5 columns of the heart + rates of patients under one of three possible drug treatments. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Patient}{ + an ordered factor indicating the patient. + } + \item{Drug}{ + the drug treatment - a factor with levels \code{a}, + \code{b} and \code{p} where \code{p} represents the placebo. + } + \item{baseHR}{ + the patient's base heart rate + } + \item{HR}{ + the observed heart rate at different times in the experiment + } + \item{Time}{ + the time of the observation + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 3.5). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(HR) +coplot(HR ~ Time | Patient, type = "b", data = HR, show = FALSE) +formula(HR) +fm1HR <- lme( HR ~ Time * Drug + baseHR, data = HR, # linear trend in time + random = ~ Time | Patient) +summary( fm1HR ) +VarCorr( fm1HR ) +anova( fm1HR ) +fm2HR <- update( fm1HR, weights = varPower(0) ) # use power-of-mean variance +summary( fm2HR ) +VarCorr( fm1HR ) +intervals( fm2HR ) # variance function does not seem significant +anova( fm1HR, fm2HR ) # confirm with likelihood ratio +fm3HR <- update( fm1HR, HR ~ Time + Drug + baseHR ) # remove interaction +anova( fm3HR ) +summary( fm3HR ) +VarCorr( fm3HR ) +fm4HR <- update( fm3HR, HR ~ Time + baseHR ) # remove Drug term +anova( fm4HR ) +summary( fm4HR ) +VarCorr( fm4HR ) +} +\keyword{datasets} diff --git a/man/IncBlk.Rd b/man/IncBlk.Rd new file mode 100644 index 0000000..b3b0796 --- /dev/null +++ b/man/IncBlk.Rd @@ -0,0 +1,37 @@ +\name{IncBlk} +\alias{IncBlk} +\non_function{} +\title{An unbalanced incomplete block experiment} +\description{ + The \code{IncBlk} data frame has 24 rows and 4 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Block}{ + an ordered factor giving the block + } + \item{Treatment}{ + a factor with levels \code{1} to \code{4} + } + \item{y}{ + a numeric vector + } + \item{x}{ + a numeric vector + } + } +} +\details{ + These data are probably constructed data. +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.5). +} +\examples{ +library(SASmixed) +data(IncBlk) +} +\keyword{datasets} diff --git a/man/Mississippi.Rd b/man/Mississippi.Rd new file mode 100644 index 0000000..ed36262 --- /dev/null +++ b/man/Mississippi.Rd @@ -0,0 +1,52 @@ +\name{Mississippi} +\alias{Mississippi} +\non_function{} +\title{Nitrogen concentrations in the Mississippi River} +\description{ +The \code{Mississippi} data frame has 37 rows and 3 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{influent}{ + an ordered factor with levels + \code{3} < \code{5} < \code{2} < \code{1} < \code{4} < \code{6} + } + \item{y}{ + a numeric vector + } + \item{Type}{ + a factor with levels + \code{1} + \code{2} + \code{3} + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 4.2). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(Mississippi) +formula( Mississippi ) +#plot( Mississippi ) +fm1Miss <- lme( y ~ 1, data = Mississippi, random = ~ 1 | influent ) +summary( fm1Miss ) # compare with output 4.1, p. 142 +fm1MLMiss <- update( fm1Miss, method = "ML" ) +summary( fm1MLMiss ) # compare with output 4.2, p. 143 +random.effects( fm1MLMiss ) # BLUP's of random effects on p. 144 +random.effects( fm1MLMiss , aug = TRUE ) # including covariates +random.effects( fm1Miss ) # BLUP's of random effects on p. 142 +intervals( fm1Miss ) # interval estimates of variance components +VarCorr( fm1Miss ) # compare to output 4.7, p. 148 +fm2Miss <- lme( y ~ Type, data = Mississippi, random = ~ 1 | influent, + method = "REML" ) +summary( fm2Miss ) # compare to output 4.8 and 4.9, pp. 150-152 +anova( fm2Miss ) +} +\keyword{datasets} diff --git a/man/Multilocation.Rd b/man/Multilocation.Rd new file mode 100644 index 0000000..2829819 --- /dev/null +++ b/man/Multilocation.Rd @@ -0,0 +1,82 @@ +\name{Multilocation} +\alias{Multilocation} +\non_function{} +\title{A multilocation trial} +\description{ + The \code{Multilocation} data frame has 108 rows and 7 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{obs}{ + a numeric vector + } + \item{Location}{ + an ordered factor with levels + \code{B} < \code{D} < \code{E} < \code{I} < \code{G} < + \code{A} < \code{C} < \code{F} < \code{H} + } + \item{Block}{ + a factor with levels \code{1} to \code{3} + } + \item{Trt}{ + a factor with levels \code{1} to \code{4} + } + \item{Adj}{ + a numeric vector + } + \item{Fe}{ + a numeric vector + } + \item{Grp}{ + an ordered factor with levels + \code{B/1} < \code{B/2} < \code{B/3} < \code{D/1} < + \code{D/2} < \code{D/3} < \code{E/1} < \code{E/2} < + \code{E/3} < \code{I/1} < \code{I/2} < \code{I/3} < + \code{G/1} < \code{G/2} < \code{G/3} < \code{A/1} < + \code{A/2} < \code{A/3} < \code{C/1} < \code{C/2} < + \code{C/3} < \code{F/1} < \code{F/2} < \code{F/3} < + \code{H/1} < \code{H/2} < \code{H/3} + } + } +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 2.8.1). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(Multilocation) +formula( Multilocation ) +names( Multilocation ) +### Create a Block %in% Location factor +Multilocation$Grp <- + getGroups( Multilocation, form = ~ Location/Block, level = 2 ) +fm1Mult <- lme( Adj ~ Location * Trt, data = Multilocation, ~ 1 | Grp) +summary( fm1Mult ) +VarCorr( fm1Mult ) +anova( fm1Mult ) +fm2Mult <- update( fm1Mult, Adj ~ Location + Trt ) +fm3Mult <- update( fm1Mult, Adj ~ Location ) +fm4Mult <- update( fm1Mult, Adj ~ Trt ) +fm5Mult <- update( fm1Mult, Adj ~ 1 ) +summary( fm2Mult ) +VarCorr( fm2Mult ) +anova( fm2Mult ) +### Treating the location as a random effect +fm1MultR <- lme( Adj ~ Trt, data = Multilocation, + random = list( Location = pdCompSymm( ~ Trt - 1 ), Block = ~ 1 ) ) +summary( fm1MultR ) +intervals( fm1MultR ) +VarCorr( fm1MultR ) +anova( fm1MultR ) +\dontrun{ +fm2MultR <- + update( fm1MultR, random = list( Location = ~ Trt - 1, Block = ~ 1 )) +anova( fm1MultR, fm2MultR ) +} +} +\keyword{datasets} diff --git a/man/PBIB.Rd b/man/PBIB.Rd new file mode 100644 index 0000000..3d2048e --- /dev/null +++ b/man/PBIB.Rd @@ -0,0 +1,41 @@ +\name{PBIB} +\alias{PBIB} +\non_function{} +\title{A partially balanced incomplete block experiment} +\description{ + The \code{PBIB} data frame has 60 rows and 3 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{response}{ + a numeric vector + } + \item{Treatment}{ + a factor with levels \code{1} to \code{15} + } + \item{Block}{ + an ordered factor with levels \code{1} to \code{15} + } + } +} +\details{ +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 1.5.1). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(PBIB) +formula( PBIB ) +fm1PBIB <- + lme( response ~ Treatment, data = PBIB, random = ~ 1 | Block) +summary( fm1PBIB ) # compare with output 1.7 pp. 24-25 +VarCorr( fm1PBIB ) +anova( fm1PBIB ) +} +\keyword{datasets} diff --git a/man/SIMS.Rd b/man/SIMS.Rd new file mode 100644 index 0000000..9bf5290 --- /dev/null +++ b/man/SIMS.Rd @@ -0,0 +1,43 @@ +\name{SIMS} +\alias{SIMS} +\non_function{} +\title{Second International Mathematics Study data} +\description{ + The \code{SIMS} data frame has 3691 rows and 3 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Pretot}{ + a numeric vector giving the student's pre-test total score + } + \item{Gain}{ + a numeric vector giving gains from pre-test to the final test + } + \item{Class}{ + an ordered factor giving the student's class + } + } +} +\details{ +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (section 7.2.2) + + Kreft, I. G. G., De Leeuw, J. and Var Der Leeden, R. (1994), + ``Review of five multilevel analysis programs: BMDP-5V, GENMOD, HLM, + ML3, and VARCL'', \emph{American Statistician}, \bold{48}, 324--335. +} +\examples{ +library(SASmixed) +data(SIMS) +fm1SIMS <- lme(Gain ~ Pretot, data = SIMS, + random = ~ Pretot | Class, control = list(msVerbose = TRUE)) +summary(fm1SIMS) # compare to output 7.4, p. 262 +VarCorr(fm1SIMS) +anova(fm1SIMS) +intervals( fm1SIMS ) +} +\keyword{datasets} diff --git a/man/Semi2.Rd b/man/Semi2.Rd new file mode 100644 index 0000000..9ccad86 --- /dev/null +++ b/man/Semi2.Rd @@ -0,0 +1,55 @@ +\name{Semi2} +\alias{Semi2} +\non_function{} +\title{Oxide layer thicknesses on semiconductors} +\description{ + The \code{Semi2} data frame has 72 rows and 5 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Source}{ + a factor with levels \code{1} and \code{2} + } + \item{Lot}{ + a factor with levels \code{1} to \code{8} + } + \item{Wafer}{ + a factor with levels \code{1} to \code{3} + } + \item{Site}{ + a factor with levels \code{1} to \code{3} + } + \item{Thickness}{ + a numeric vector + } + } +} +\details{ + +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 4.4). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(Semi2) +formula(Semi2) +fm1Semi2 <- lme( Thickness ~ 1, data = Semi2, + random = ~ 1 | Lot/Wafer ) +summary( fm1Semi2 ) # compare with output 4.13, p. 156 +VarCorr( fm1Semi2 ) +anova( fm1Semi2 ) +fm2Semi2 <- update( fm1Semi2, Thickness ~ Source ) +summary( fm2Semi2 ) # compare with output 4.15, p. 159 +VarCorr( fm2Semi2 ) +fm3Semi2 <- update( fm2Semi2, + random = list(Lot = pdDiag( ~ Source - 1 ), Wafer = ~ 1 ) ) +summary( fm3Semi2 ) # compare with output 4.17, p. 163 +VarCorr( fm3Semi2 ) +} +\keyword{datasets} diff --git a/man/Semiconductor.Rd b/man/Semiconductor.Rd new file mode 100644 index 0000000..46970ec --- /dev/null +++ b/man/Semiconductor.Rd @@ -0,0 +1,53 @@ +\name{Semiconductor} +\alias{Semiconductor} +\non_function{} +\title{Semiconductor split-plot experiment} +\description{ + The \code{Semiconductor} data frame has 48 rows and 5 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{resistance}{ + a numeric vector + } + \item{ET}{ + a factor with levels \code{1} to \code{4} representing etch time. + } + \item{Wafer}{ + a factor with levels \code{1} to \code{3} + } + \item{position}{ + a factor with levels \code{1} to \code{4} + } + \item{Grp}{ + an ordered factor with levels + \code{1/1} < \code{1/2} < \code{1/3} < \code{2/1} < \code{2/2} < \code{2/3} < \code{3/1} < \code{3/2} < \code{3/3} < \code{4/1} < \code{4/2} < \code{4/3} + } + } +} +\details{ +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 2.2(b)). + +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(Semiconductor) +formula( Semiconductor ) +names( Semiconductor ) +fm1Semi <- lme( resistance ~ ET * position, + data = Semiconductor, + random = ~ 1 | Grp) +summary( fm1Semi ) +VarCorr( fm1Semi ) +anova( fm1Semi ) +fm2Semi <- update( fm1Semi, resistance ~ ET + position ) +anova(fm2Semi) +} +\keyword{datasets} diff --git a/man/TeachingI.Rd b/man/TeachingI.Rd new file mode 100644 index 0000000..6c15bac --- /dev/null +++ b/man/TeachingI.Rd @@ -0,0 +1,47 @@ +\name{TeachingI} +\alias{TeachingI} +\non_function{} +\title{Teaching Methods I} +\description{ + The \code{TeachingI} data frame has 96 rows and 7 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Method}{ + a factor with levels \code{1} to \code{3} + } + \item{Teacher}{ + a factor with levels \code{1} to \code{4} + } + \item{Gender}{ + a factor with levels \code{f} and \code{m} + } + \item{Student}{ + a factor with levels \code{1} to \code{4} + } + \item{score}{ + a numeric vector + } + \item{Experience}{ + a numeric vector + } + \item{uTeacher}{ + an ordered factor with levels + } + } +} +\details{ +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.6). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(TeachingI) +} +\keyword{datasets} diff --git a/man/TeachingII.Rd b/man/TeachingII.Rd new file mode 100644 index 0000000..a3d59e6 --- /dev/null +++ b/man/TeachingII.Rd @@ -0,0 +1,45 @@ +\name{TeachingII} +\alias{TeachingII} +\non_function{} +\title{Teaching Methods II} +\description{ + The \code{TeachingII} data frame has 96 rows and 6 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Method}{ + a factor with levels \code{1} to \code{3} + } + \item{Teacher}{ + a factor with levels \code{1} to \code{4} + } + \item{Gender}{ + a factor with levels \code{f} and \code{m} + } + \item{IQ}{ + a numeric vector + } + \item{score}{ + a numeric vector + } + \item{uTeacher}{ + an ordered factor with levels + } + } +} +\details{ + +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.7). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(TeachingII) +} +\keyword{datasets} diff --git a/man/WWheat.Rd b/man/WWheat.Rd new file mode 100644 index 0000000..91e5874 --- /dev/null +++ b/man/WWheat.Rd @@ -0,0 +1,35 @@ +\name{WWheat} +\alias{WWheat} +\non_function{} +\title{Winter wheat} +\description{ + The \code{WWheat} data frame has 60 rows and 3 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Variety}{ + an ordered factor with 10 levels + } + \item{Yield}{ + a numeric vector of yields + } + \item{Moisture}{ + a numeric vector of soil moisture contents + } + } +} +\details{ +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 7.2). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(WWheat) +} +\keyword{datasets} diff --git a/man/WaferTypes.Rd b/man/WaferTypes.Rd new file mode 100644 index 0000000..5c82b62 --- /dev/null +++ b/man/WaferTypes.Rd @@ -0,0 +1,53 @@ +\name{WaferTypes} +\alias{WaferTypes} +\non_function{} +\title{Data on different types of silicon wafers} +\description{ + The \code{WaferTypes} data frame has 144 rows and 8 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{Group}{ + a factor with levels \code{1} to \code{4} + } + \item{Temperature}{ + an ordered factor with levels + \code{900} < \code{1000} < \code{1100} + } + \item{Type}{ + a factor with levels \code{A} and \code{B} + } + \item{Wafer}{ + a numeric vector + } + \item{Site}{ + a numeric vector + } + \item{delta}{ + a numeric vector + } + \item{Thick}{ + a numeric vector + } + \item{uWafer}{ + an ordered factor giving a unique code to each group, + temperature, type and wafer combination. + } + } +} +\details{ + +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 5.8). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(WaferTypes) +} +\keyword{datasets} diff --git a/man/Weights.Rd b/man/Weights.Rd new file mode 100644 index 0000000..e7541a5 --- /dev/null +++ b/man/Weights.Rd @@ -0,0 +1,66 @@ +\name{Weights} +\alias{Weights} +\non_function{} +\title{Data from a weight-lifting program} +\description{ + The \code{Weights} data frame has 399 rows and 5 columns. +} +\format{ + This data frame contains the following columns: + \describe{ + \item{strength}{ + a numeric vector + } + \item{Subject}{ + a factor with levels \code{1} to \code{21} + } + \item{Program}{ + a factor with levels + \code{CONT} (continuous repetitions and weights), + \code{RI} (repetitions increasing) and + \code{WI} (weights increasing) + } + \item{Subj}{ + an ordered factor indicating the subject on which the + measurement is made + } + \item{Time}{ + a numeric vector indicating the time of the measurement + } + } +} +\details{ + +} +\source{ + Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, + R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute + (Data Set 3.2(a)). +} +\examples{ +library(SASmixed) +options( + contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) +data(Weights) +fm1Weight <- lme( strength ~ Program * Time, + data = Weights, random = ~ 1 | Subj) +summary( fm1Weight ) # compare with output 3.1, p. 91 +VarCorr( fm1Weight ) +anova( fm1Weight ) +fm2Weight <- update( fm1Weight, random = ~ Time | Subj ) +anova( fm1Weight, fm2Weight ) +summary( fm2Weight ) +VarCorr( fm2Weight ) +intervals( fm2Weight ) +\dontrun{ +fm3Weight <- update( fm2Weight, correlation = corAR1()) +anova( fm2Weight, fm3Weight ) +fm4Weight <- update( fm3Weight, strength ~ Program * (Time + I(Time^2)), + random = ~Time|Subj) +summary( fm4Weight ) +VarCorr( fm4Weight ) +anova( fm4Weight ) +intervals( fm4Weight ) +} +} +\keyword{datasets} diff --git a/transcripts/AvgDGain.St b/transcripts/AvgDGain.St new file mode 100644 index 0000000..8eed9fa --- /dev/null +++ b/transcripts/AvgDGain.St @@ -0,0 +1,96 @@ +S> ### $Id: AvgDGain.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of average daily weight gain data given as data set 5.3 +S> ### in "SAS System for Mixed Models" +S> options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> plot(AvgDailyGain) # plot of adg versus Treatment by Block +S> fm1Adg <- lme( adg ~ InitWt * Treatment - 1, ++ data = AvgDailyGain, random = ~ 1 | Block, method = "ML" ) +S> summary( fm1Adg ) # compare with output 5.1, p. 178 +Linear mixed-effects model fit by maximum likelihood + Data: AvgDailyGain + AIC BIC logLik + 29.971 44.628 -4.9855 + +Random effects: + Formula: ~ 1 | Block + (Intercept) Residual +StdDev: 0.47793 0.18723 + +Fixed effects: adg ~ InitWt * Treatment - 1 + Value Std.Error DF t-value p-value + InitWt 0.0045 0.00203 17 2.2285 0.0396 + Treatment0 0.4683 0.69774 17 0.6712 0.5111 + Treatment10 1.4435 0.62724 17 2.3013 0.0343 + Treatment20 0.5031 0.54174 17 0.9287 0.3661 + Treatment30 0.1751 0.75975 17 0.2304 0.8205 + InitWtTreatment0 -0.0023 0.00271 17 -0.8469 0.4088 +InitWtTreatment10 -0.0035 0.00245 17 -1.4195 0.1738 +InitWtTreatment20 -0.0012 0.00242 17 -0.4996 0.6238 + Correlation: + InitWt Trtmn0 Trtm10 Trtm20 Trtm30 IntWT0 + Treatment0 0.050 + Treatment10 -0.032 0.054 + Treatment20 0.034 0.097 0.351 + Treatment30 -0.961 0.024 0.111 0.059 + InitWtTreatment0 -0.780 -0.635 0.046 -0.024 0.750 +InitWtTreatment10 -0.807 -0.021 -0.530 -0.178 0.776 0.617 +InitWtTreatment20 -0.856 -0.040 -0.107 -0.506 0.823 0.666 + InWT10 + Treatment0 + Treatment10 + Treatment20 + Treatment30 + InitWtTreatment0 +InitWtTreatment10 +InitWtTreatment20 0.775 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1282 -0.52113 -0.044351 0.53017 1.8544 + +Number of Observations: 32 +Number of Groups: 8 +S> fm2Adg <- update( fm1Adg, adg ~ InitWt + Treatment ) # common slope model +S> anova( fm1Adg, fm2Adg ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Adg 1 10 29.971 44.628 -4.9855 +fm2Adg 2 7 27.617 37.877 -6.8086 1 vs 2 3.6463 0.3023 +S> summary( update( fm1Adg, adg ~ InitWt + Treatment - 1 ) ) +Linear mixed-effects model fit by maximum likelihood + Data: AvgDailyGain + AIC BIC logLik + 27.617 37.877 -6.8086 + +Random effects: + Formula: ~ 1 | Block + (Intercept) Residual +StdDev: 0.45883 0.2044 + +Fixed effects: adg ~ InitWt + Treatment - 1 + Value Std.Error DF t-value p-value + InitWt 0.00277 0.00083 20 3.3418 0.0032 + Treatment0 0.25248 0.37756 20 0.6687 0.5113 +Treatment10 0.73614 0.39019 20 1.8866 0.0738 +Treatment20 0.71648 0.38265 20 1.8724 0.0758 +Treatment30 0.80428 0.35582 20 2.2604 0.0351 + Correlation: + InitWt Trtmn0 Trtmn1 Trtm20 + Treatment0 -0.859 +Treatment10 -0.869 0.958 +Treatment20 -0.863 0.957 0.958 +Treatment30 -0.839 0.953 0.954 0.954 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.6326 -0.65331 0.09208 0.75471 2.0365 + +Number of Observations: 32 +Number of Groups: 8 + + + + + + + + diff --git a/transcripts/AvgDGain.q b/transcripts/AvgDGain.q new file mode 100644 index 0000000..b2b545e --- /dev/null +++ b/transcripts/AvgDGain.q @@ -0,0 +1,11 @@ +### $Id: AvgDGain.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of average daily weight gain data given as data set 5.3 +### in "SAS System for Mixed Models" +options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +plot(AvgDailyGain) # plot of adg versus Treatment by Block +fm1Adg <- lme( adg ~ InitWt * Treatment - 1, + data = AvgDailyGain, random = ~ 1 | Block, method = "ML" ) +summary( fm1Adg ) # compare with output 5.1, p. 178 +fm2Adg <- update( fm1Adg, adg ~ InitWt + Treatment ) # common slope model +anova( fm1Adg, fm2Adg ) +summary( update( fm1Adg, adg ~ InitWt + Treatment - 1 ) ) diff --git a/transcripts/Bond.St b/transcripts/Bond.St new file mode 100644 index 0000000..edb96e2 --- /dev/null +++ b/transcripts/Bond.St @@ -0,0 +1,79 @@ +S> ### $Id: Bond.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ## Set options +S> options( prompt = "S> ", digits = 5, width = 65, ++ contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> plot(Bond) # dotplot by Ingot +S> plot(Bond, inner = ~ Metal) # different symbols for different Metals +S> formula(Bond) # check the formula +pressure ~ 1 | Ingot +S> fm1Bond <- lme( pressure ~ Metal, data = Bond, random = ~ 1 | Ingot, ++ method = "ML") +S> summary( fm1Bond ) +Linear mixed-effects model fit by maximum likelihood + Data: Bond + AIC BIC logLik + 125.71 130.93 -57.854 + +Random effects: + Formula: ~ 1 | Ingot + (Intercept) Residual +StdDev: 3.1325 2.9816 + +Fixed effects: pressure ~ Metal + Value Std.Error DF t-value p-value +(Intercept) 71.100 1.7655 12 40.271 <.0001 + Metalc -0.914 1.7214 12 -0.531 0.6050 + Metali 4.800 1.7214 12 2.788 0.0164 + Correlation: + (Intr) Metalc +Metalc -0.488 +Metali -0.488 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.4551 -0.81901 0.08048 0.52228 1.9611 + +Number of Observations: 21 +Number of Groups: 7 +S> ## default criterion in lme is maximum likelihood (ML). +S> ## Re-fit to get REML results +S> fm1RBond <- update( fm1Bond, method = "REML" ) +S> summary( fm1RBond ) # compare with output 1.1 on p. 6 +Linear mixed-effects model fit by REML + Data: Bond + AIC BIC logLik + 117.79 122.24 -53.895 + +Random effects: + Formula: ~ 1 | Ingot + (Intercept) Residual +StdDev: 3.3835 3.2205 + +Fixed effects: pressure ~ Metal + Value Std.Error DF t-value p-value +(Intercept) 71.100 1.7655 12 40.271 <.0001 + Metalc -0.914 1.7214 12 -0.531 0.6050 + Metali 4.800 1.7214 12 2.788 0.0164 + Correlation: + (Intr) Metalc +Metalc -0.488 +Metali -0.488 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.3471 -0.75825 0.07451 0.48354 1.8157 + +Number of Observations: 21 +Number of Groups: 7 +S> logLik( fm1RBond ) # log-restricted-likelihood +[1] -53.895 +S> c(3.3835,3.2205)^2 # variance estimates +[1] 11.448 10.372 +S> ## To test the need for the Metal term in the fixed effects, +S> ## re-fit and use anova. You must use ML to do this. RML results are +S> ## not comparable if the fixed-effects specification changes. +S> fm2Bond <- update( fm1Bond, pressure ~ 1 ) +S> anova( fm1Bond, fm2Bond ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Bond 1 5 125.71 130.93 -57.854 +fm2Bond 2 3 131.82 134.96 -62.912 1 vs 2 10.116 0.0064 diff --git a/transcripts/Bond.q b/transcripts/Bond.q new file mode 100644 index 0000000..822517e --- /dev/null +++ b/transcripts/Bond.q @@ -0,0 +1,21 @@ +### $Id: Bond.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +## Set options +options( prompt = "S> ", digits = 5, width = 65, + contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +plot(Bond) # dotplot by Ingot +plot(Bond, inner = ~ Metal) # different symbols for different Metals +formula(Bond) # check the formula +fm1Bond <- lme( pressure ~ Metal, data = Bond, random = ~ 1 | Ingot, + method = "ML") +summary( fm1Bond ) +## default criterion in lme is maximum likelihood (ML). +## Re-fit to get REML results +fm1RBond <- update( fm1Bond, method = "REML" ) +summary( fm1RBond ) # compare with output 1.1 on p. 6 +logLik( fm1RBond ) # log-restricted-likelihood +c(3.3835,3.2205)^2 # variance estimates +## To test the need for the Metal term in the fixed effects, +## re-fit and use anova. You must use ML to do this. RML results are +## not comparable if the fixed-effects specification changes. +fm2Bond <- update( fm1Bond, pressure ~ 1 ) +anova( fm1Bond, fm2Bond ) diff --git a/transcripts/CultMiss.St b/transcripts/CultMiss.St new file mode 100644 index 0000000..627afae --- /dev/null +++ b/transcripts/CultMiss.St @@ -0,0 +1,93 @@ +S> ### $Id: CultMiss.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### A blocked split-plot with missing data (sec 2.7, pp. 68-75) +S> ## Remove all observations in block 1, cultivar 'A'. +S> options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> CultMiss <- Cultivation[ Cultivation$Block != 1 | Cultivation$Cult != 'a', ] +S> dim(CultMiss) +[1] 21 4 +S> plot( CultMiss, inner = ~ Inoc ) +S> fm1CultM <- lme( drywt ~ Cult * Inoc, CultMiss, list(Block = ~ 1, Cult = ~ 1), ++ method = "ML") +S> summary( fm1CultM ) +Linear mixed-effects model fit by maximum likelihood + Data: CultMiss + AIC BIC logLik + 76.647 86.047 -29.323 + +Random effects: + Formula: ~ 1 | Block + (Intercept) +StdDev: 0.86256 + + Formula: ~ 1 | Cult %in% Block + (Intercept) Residual +StdDev: 0.86879 0.66455 + +Fixed effects: drywt ~ Cult * Inoc + Value Std.Error DF t-value p-value +(Intercept) 33.525 0.8241 10 40.680 <.0001 + Cult -0.619 1.0123 2 -0.612 0.6031 + Inoccon -5.500 0.5560 10 -9.892 <.0001 + Inocdea -2.875 0.5560 10 -5.171 0.0004 +CultInoccon 0.867 0.8493 10 1.020 0.3316 +CultInocdea -0.725 0.8493 10 -0.854 0.4133 + Correlation: + (Intr) Cult Inoccn Inocde CltIncc + Cult -0.502 + Inoccon -0.337 0.275 + Inocdea -0.337 0.275 0.500 +CultInoccon 0.221 -0.420 -0.655 -0.327 +CultInocdea 0.221 -0.420 -0.327 -0.655 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.4566 -0.55593 0.19646 0.37888 1.9535 + +Number of Observations: 21 +Number of Groups: + Block Cult %in% Block + 4 7 +S> fm2CultM <- update( fm1CultM, drywt ~ Cult + Inoc ) +S> fm3CultM <- update( fm1CultM, drywt ~ Inoc ) +S> fm4CultM <- update( fm1CultM, drywt ~ 1 ) +S> anova( fm1Cult, fm2Cult, fm3Cult, fm4Cult ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Cult 1 9 86.76 97.36 -34.378 +fm2Cult 2 7 85.88 94.13 -35.940 1 vs 2 3.125 0.2096 +fm3Cult 3 6 84.79 91.85 -36.393 2 vs 3 0.905 0.3415 +fm4Cult 4 4 122.48 127.19 -57.238 3 vs 4 41.691 <.0001 +S> # Essentially the same conclusions as for the balanced data +S> fm3RCultM <- update( fm3CultM, method = "REML" ) +S> summary( fm3RCultM ) +Linear mixed-effects model fit by REML + Data: CultMiss + AIC BIC logLik + 74.474 79.816 -31.237 + +Random effects: + Formula: ~ 1 | Block + (Intercept) +StdDev: 1.1726 + + Formula: ~ 1 | Cult %in% Block + (Intercept) Residual +StdDev: 0.83473 0.83465 + +Fixed effects: drywt ~ Inoc + Value Std.Error DF t-value p-value +(Intercept) 33.305 0.74204 12 44.883 <.0001 + Inoccon -5.129 0.44614 12 -11.495 <.0001 + Inocdea -3.186 0.44614 12 -7.141 <.0001 + Correlation: + (Intr) Inoccn +Inoccon -0.301 +Inocdea -0.301 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.7182 -0.2666 -0.14867 0.36054 1.7434 + +Number of Observations: 21 +Number of Groups: + Block Cult %in% Block + 4 7 diff --git a/transcripts/CultMiss.q b/transcripts/CultMiss.q new file mode 100644 index 0000000..01affd4 --- /dev/null +++ b/transcripts/CultMiss.q @@ -0,0 +1,17 @@ +### $Id: CultMiss.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### A blocked split-plot with missing data (sec 2.7, pp. 68-75) +## Remove all observations in block 1, cultivar 'A'. +options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +CultMiss <- Cultivation[ Cultivation$Block != 1 | Cultivation$Cult != 'a', ] +dim(CultMiss) +plot( CultMiss, inner = ~ Inoc ) +fm1CultM <- lme( drywt ~ Cult * Inoc, CultMiss, list(Block = ~ 1, Cult = ~ 1), + method = "ML") +summary( fm1CultM ) +fm2CultM <- update( fm1CultM, drywt ~ Cult + Inoc ) +fm3CultM <- update( fm1CultM, drywt ~ Inoc ) +fm4CultM <- update( fm1CultM, drywt ~ 1 ) +anova( fm1Cult, fm2Cult, fm3Cult, fm4Cult ) +# Essentially the same conclusions as for the balanced data +fm3RCultM <- update( fm3CultM, method = "REML" ) +summary( fm3RCultM ) diff --git a/transcripts/Cultivar.St b/transcripts/Cultivar.St new file mode 100644 index 0000000..b4091d9 --- /dev/null +++ b/transcripts/Cultivar.St @@ -0,0 +1,102 @@ +S> ### $Id: Cultivar.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Split-plot experiment with whole plots in randomized blocks (sec. 2.5) +S> options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> names( Cultivation ) +[1] "Block" "Cult" "Inoc" "drywt" +S> formula( Cultivation ) +drywt ~ 1 | Block/Cult +S> plot( Cultivation, inner = ~ Inoc ) +S> fm1Cult <- lme( drywt ~ Inoc * Cult, ++ data = Cultivation, method = "ML", ++ random = list( Block = ~ 1, Cult = ~ 1 ) ) +S> summary( fm1Cult ) +Linear mixed-effects model fit by maximum likelihood + Data: Cultivation + AIC BIC logLik + 86.755 97.358 -34.378 + +Random effects: + Formula: ~ 1 | Block + (Intercept) +StdDev: 0.81248 + + Formula: ~ 1 | Cult %in% Block + (Intercept) Residual +StdDev: 0.78329 0.72737 + +Fixed effects: drywt ~ Inoc * Cult + Value Std.Error DF t-value p-value +(Intercept) 33.525 0.77518 12 43.248 <.0001 + Inoccon -5.500 0.59390 12 -9.261 <.0001 + Inocdea -2.875 0.59390 12 -4.841 0.0004 + Cult -0.375 0.87278 3 -0.430 0.6964 +InocconCult 0.250 0.83990 12 0.298 0.7711 +InocdeaCult -1.025 0.83990 12 -1.220 0.2458 + Correlation: + (Intr) Inoccn Inocde Cult InccnC + Inoccon -0.383 + Inocdea -0.383 0.500 + Cult -0.563 0.340 0.340 +InocconCult 0.271 -0.707 -0.354 -0.481 +InocdeaCult 0.271 -0.354 -0.707 -0.481 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.4244 -0.54855 -0.018575 0.73293 1.874 + +Number of Observations: 24 +Number of Groups: + Block Cult %in% Block + 4 8 +S> logLik( update( fm1Cult, method = "REML" ) ) # check the same model is being fit +[1] -32.531 +S> fm2Cult <- update( fm1Cult, drywt ~ Inoc + Cult ) +S> fm3Cult <- update( fm1Cult, drywt ~ Inoc ) +S> fm4Cult <- update( fm1Cult, drywt ~ 1 ) +S> anova( fm1Cult, fm2Cult, fm3Cult, fm4Cult ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Cult 1 9 86.76 97.36 -34.378 +fm2Cult 2 7 85.88 94.13 -35.940 1 vs 2 3.125 0.2096 +fm3Cult 3 6 84.79 91.85 -36.393 2 vs 3 0.905 0.3415 +fm4Cult 4 4 122.48 127.19 -57.238 3 vs 4 41.691 <.0001 +S> fm5Cult <- update( fm1Cult, drywt ~ Cult ) +S> anova( fm1Cult, fm2Cult, fm5Cult, fm4Cult ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Cult 1 9 86.76 97.36 -34.378 +fm2Cult 2 7 85.88 94.13 -35.940 1 vs 2 3.125 0.2096 +fm5Cult 3 5 124.12 130.02 -57.062 2 vs 3 42.245 <.0001 +fm4Cult 4 4 122.48 127.19 -57.238 3 vs 4 0.351 0.5534 +S> ### AIC, BIC, and likelihood ratio tests all prefer fm3Cult +S> summary( update( fm3Cult, method = "REML" ) ) # REML estimates +Linear mixed-effects model fit by REML + Data: Cultivation + AIC BIC logLik + 84.28 90.547 -36.14 + +Random effects: + Formula: ~ 1 | Block + (Intercept) +StdDev: 0.95452 + + Formula: ~ 1 | Cult %in% Block + (Intercept) Residual +StdDev: 0.86372 0.85731 + +Fixed effects: drywt ~ Inoc + Value Std.Error DF t-value p-value +(Intercept) 33.337 0.64257 14 51.881 <.0001 + Inoccon -5.375 0.42865 14 -12.539 <.0001 + Inocdea -3.388 0.42865 14 -7.903 <.0001 + Correlation: + (Intr) Inoccn +Inoccon -0.334 +Inocdea -0.334 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.5717 -0.41039 -0.08165 0.53191 1.5561 + +Number of Observations: 24 +Number of Groups: + Block Cult %in% Block + 4 8 diff --git a/transcripts/Cultivar.q b/transcripts/Cultivar.q new file mode 100644 index 0000000..403702a --- /dev/null +++ b/transcripts/Cultivar.q @@ -0,0 +1,19 @@ +### $Id: Cultivar.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Split-plot experiment with whole plots in randomized blocks (sec. 2.5) +options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +names( Cultivation ) +formula( Cultivation ) +plot( Cultivation, inner = ~ Inoc ) +fm1Cult <- lme( drywt ~ Inoc * Cult, + data = Cultivation, method = "ML", + random = list( Block = ~ 1, Cult = ~ 1 ) ) +summary( fm1Cult ) +logLik( update( fm1Cult, method = "REML" ) ) # check the same model is being fit +fm2Cult <- update( fm1Cult, drywt ~ Inoc + Cult ) +fm3Cult <- update( fm1Cult, drywt ~ Inoc ) +fm4Cult <- update( fm1Cult, drywt ~ 1 ) +anova( fm1Cult, fm2Cult, fm3Cult, fm4Cult ) +fm5Cult <- update( fm1Cult, drywt ~ Cult ) +anova( fm1Cult, fm2Cult, fm5Cult, fm4Cult ) +### AIC, BIC, and likelihood ratio tests all prefer fm3Cult +summary( update( fm3Cult, method = "REML" ) ) # REML estimates diff --git a/transcripts/Demand.St b/transcripts/Demand.St new file mode 100644 index 0000000..9bd3cd8 --- /dev/null +++ b/transcripts/Demand.St @@ -0,0 +1,59 @@ +S> ### $Id: Demand.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the per capita demand deposits data given as data +S> ### set 3.6 in "SAS System for Mixed Models" +S> names( Demand ) +[1] "State" "Year" "d" "y" "rd" "rt" "rs" +[8] "grp" +S> formula( Demand ) +d ~ Year | State +S> # the "grp" factor is a dummy factor with only one level. +S> unique( Demand$grp ) +[1] 1 +S> # Crossed random-effects factors have to be created by pdIdent applied to +S> # the indicator variables and joined together by pdBlocked. +S> fm1Demand <- lme( log(d) ~ log(y) + log(rd) + log(rt) + log(rs), data = Demand, ++ random = list(grp = pdBlocked(list(pdIdent(~ State - 1), pdIdent(~ Year - 1)))), ++ method = "REML" ) +S> summary( fm1Demand ) # compare to output 3.13, p. 132 +Linear mixed-effects model fit by REML + Data: Demand + AIC BIC logLik + -224.17 -205.95 120.08 + +Random effects: + Composite Structure: Blocked + + Block 1: StateWA, StateFL, StateCA, StateTX, StateIL, StateDC, StateNY + Formula: ~ State - 1 | grp + Structure: Multiple of an Identity + StateWA StateFL StateCA StateTX StateIL StateDC StateNY +StdDev: 0.17177 0.17177 0.17177 0.17177 0.17177 0.17177 0.17177 + + Block 2: Year1949, Year1950, Year1951, Year1952, Year1953, Year1954, Year1955, Year1956, Year1957, Year1958, Year1959 + Formula: ~ Year - 1 | grp + Structure: Multiple of an Identity + Year1949 Year1950 Year1951 Year1952 Year1953 Year1954 +StdDev: 0.016267 0.016267 0.016267 0.016267 0.016267 0.016267 + Year1955 Year1956 Year1957 Year1958 Year1959 Residual +StdDev: 0.016267 0.016267 0.016267 0.016267 0.016267 0.033421 + +Fixed effects: log(d) ~ log(y) + log(rd) + log(rt) + log(rs) + Value Std.Error DF t-value p-value +(Intercept) -1.2839 0.72343 72 -1.775 0.0802 + log(y) 1.0698 0.10393 72 10.294 <.0001 + log(rd) -0.2953 0.05246 72 -5.629 <.0001 + log(rt) 0.0399 0.02789 72 1.430 0.1570 + log(rs) -0.3267 0.11438 72 -2.857 0.0056 + Correlation: + (Intr) log(y) lg(rd) lg(rt) + log(y) -0.976 +log(rd) 0.383 -0.227 +log(rt) 0.077 -0.062 -0.337 +log(rs) 0.444 -0.600 -0.270 -0.323 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1382 -0.59488 0.045884 0.47185 2.5816 + +Number of Observations: 77 +Number of Groups: 1 diff --git a/transcripts/Demand.q b/transcripts/Demand.q new file mode 100644 index 0000000..02f7f9f --- /dev/null +++ b/transcripts/Demand.q @@ -0,0 +1,13 @@ +### $Id: Demand.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the per capita demand deposits data given as data +### set 3.6 in "SAS System for Mixed Models" +names( Demand ) +formula( Demand ) +# the "grp" factor is a dummy factor with only one level. +unique( Demand$grp ) +# Crossed random-effects factors have to be created by pdIdent applied to +# the indicator variables and joined together by pdBlocked. +fm1Demand <- lme( log(d) ~ log(y) + log(rd) + log(rt) + log(rs), data = Demand, + random = list(grp = pdBlocked(list(pdIdent(~ State - 1), pdIdent(~ Year - 1)))), + method = "REML" ) +summary( fm1Demand ) # compare to output 3.13, p. 132 diff --git a/transcripts/Genetics.St b/transcripts/Genetics.St new file mode 100644 index 0000000..d18913d --- /dev/null +++ b/transcripts/Genetics.St @@ -0,0 +1,73 @@ +S> ### $Id: Genetics.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the heritability data given as data set 4.5 in +S> ### "SAS System for Mixed Models" +S> options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +S> formula( Genetics ) +Yield ~ 1 | Location/Block +S> plot( Genetics ) +S> fm1Gen <- lme( Yield ~ 1, data = Genetics, method = "ML", ++ random = list(Location = pdCompSymm(~ Family - 1), Block = ~ 1) ) +S> summary( fm1Gen ) +Linear mixed-effects model fit by maximum likelihood + Data: Genetics + AIC BIC logLik + 499.71 510.19 -244.86 + +Random effects: + Formula: ~ Family - 1 | Location + Structure: Compound Symmetry + StdDev Corr +Family1 25.951 +Family2 25.951 0.61 +Family3 25.951 0.61 0.61 +Family4 25.951 0.61 0.61 0.61 +Family5 25.951 0.61 0.61 0.61 0.61 + + Formula: ~ 1 | Block %in% Location + (Intercept) Residual +StdDev: 9.451 7.2004 + +Fixed effects: Yield ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 209.13 11.234 48 18.616 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.7827 -0.50294 -0.073372 0.62515 1.3794 + +Number of Observations: 60 +Number of Groups: + Location Block %in% Location + 4 12 +S> summary( update( fm1Gen, method = "REML" ) ) +Linear mixed-effects model fit by REML + Data: Genetics + AIC BIC logLik + 492.92 503.31 -241.46 + +Random effects: + Formula: ~ Family - 1 | Location + Structure: Compound Symmetry + StdDev Corr +Family1 28.964 +Family2 28.964 0.687 +Family3 28.964 0.687 0.687 +Family4 28.964 0.687 0.687 0.687 +Family5 28.964 0.687 0.687 0.687 0.687 + + Formula: ~ 1 | Block %in% Location + (Intercept) Residual +StdDev: 9.451 7.2004 + +Fixed effects: Yield ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 209.13 12.863 48 16.258 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.7806 -0.51069 -0.070189 0.61932 1.3822 + +Number of Observations: 60 +Number of Groups: + Location Block %in% Location + 4 12 diff --git a/transcripts/Genetics.q b/transcripts/Genetics.q new file mode 100644 index 0000000..ce1b771 --- /dev/null +++ b/transcripts/Genetics.q @@ -0,0 +1,10 @@ +### $Id: Genetics.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the heritability data given as data set 4.5 in +### "SAS System for Mixed Models" +options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +formula( Genetics ) +plot( Genetics ) +fm1Gen <- lme( Yield ~ 1, data = Genetics, method = "ML", + random = list(Location = pdCompSymm(~ Family - 1), Block = ~ 1) ) +summary( fm1Gen ) +summary( update( fm1Gen, method = "REML" ) ) diff --git a/transcripts/HR.St b/transcripts/HR.St new file mode 100644 index 0000000..b425aa3 --- /dev/null +++ b/transcripts/HR.St @@ -0,0 +1,200 @@ +S> ### $Id: HR.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the Heart rate data given as data set 3.5 in +S> ### "SAS System for Mixed Models" +S> options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +S> formula(HR) +HR ~ Time | Patient +S> plot(HR) # basic trellis plot +S> plot(HR, outer = ~ Drug ) # by drug type +S> fm1HR <- lme( HR ~ Time * Drug + baseHR, data = HR, # linear trend in time ++ random = ~ Time | Patient, method = "ML") +S> summary( fm1HR ) +Linear mixed-effects model fit by maximum likelihood + Data: HR + AIC BIC logLik + 809.75 840.42 -393.88 + +Random effects: + Formula: ~ Time | Patient + Structure: General positive-definite + StdDev Corr +(Intercept) 7.0549 (Inter + Time 5.3200 -0.581 + Residual 4.9353 + +Fixed effects: HR ~ Time * Drug + baseHR + Value Std.Error DF t-value p-value +(Intercept) 33.976 9.6799 93 3.5099 0.0007 + Time -3.197 2.9744 93 -1.0749 0.2852 + Druga 3.599 4.0114 20 0.8973 0.3803 + Drugb 7.091 3.9909 20 1.7768 0.0908 + baseHR 0.543 0.1093 20 4.9737 0.0001 + TimeDruga -7.501 4.2064 93 -1.7833 0.0778 + TimeDrugb -3.989 4.2064 93 -0.9484 0.3454 + Correlation: + (Intr) Time Druga Drugb baseHR TimDrg + Time -0.166 + Druga -0.309 0.400 + Drugb -0.245 0.402 0.501 + baseHR -0.957 0.000 0.109 0.041 +TimeDruga 0.117 -0.707 -0.566 -0.285 0.000 +TimeDrugb 0.117 -0.707 -0.283 -0.569 0.000 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1005 -0.48442 0.0059578 0.57901 2.3471 + +Number of Observations: 120 +Number of Groups: 24 +S> fm2HR <- update( fm1HR, weights = varPower(0) ) # use power-of-mean variance +S> summary( fm2HR ) +Linear mixed-effects model fit by maximum likelihood + Data: HR + AIC BIC logLik + 809.02 842.47 -392.51 + +Random effects: + Formula: ~ Time | Patient + Structure: General positive-definite + StdDev Corr +(Intercept) 7.097978 (Inter + Time 5.769233 -0.553 + Residual 0.031682 + +Variance function: + Structure: Power of variance covariate + Formula: ~ fitted(.) + Parameter estimates: + power + 1.1471 +Fixed effects: HR ~ Time * Drug + baseHR + Value Std.Error DF t-value p-value +(Intercept) 34.122 9.6552 93 3.5341 0.0006 + Time -3.818 2.9847 93 -1.2793 0.2040 + Druga 2.864 4.0128 20 0.7137 0.4837 + Drugb 6.646 4.0183 20 1.6540 0.1137 + baseHR 0.543 0.1091 20 4.9793 0.0001 + TimeDruga -6.014 4.1681 93 -1.4429 0.1524 + TimeDrugb -2.882 4.2829 93 -0.6728 0.5027 + Correlation: + (Intr) Time Druga Drugb baseHR TimDrg + Time -0.174 + Druga -0.312 0.397 + Drugb -0.246 0.395 0.498 + baseHR -0.956 0.011 0.111 0.043 +TimeDruga 0.121 -0.716 -0.563 -0.283 -0.004 +TimeDrugb 0.113 -0.697 -0.275 -0.565 0.001 0.499 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1611 -0.48018 0.0035072 0.5435 2.1633 + +Number of Observations: 120 +Number of Groups: 24 +S> intervals( fm2HR ) # variance function does not seem significant +Approximate 95% confidence intervals + + Fixed effects: + lower est. upper +(Intercept) 15.51646 34.12222 52.72799 + Time -9.56996 -3.81839 1.93318 + Druga -5.25875 2.86395 10.98666 + Drugb -1.48758 6.64625 14.78008 + baseHR 0.32236 0.54317 0.76398 + TimeDruga -14.04611 -6.01403 2.01804 + TimeDrugb -11.13503 -2.88173 5.37157 + + Random Effects: + Level: Patient + lower est. upper + sd((Intercept)) 4.97762 7.09798 10.121554 + sd(Time) 3.20638 5.76923 10.380560 +cor((Intercept),Time) -0.85589 -0.55318 0.031879 + + Variance function: + lower est. upper +power -0.085702 1.1471 2.3799 + + Within-group standard error: + lower est. upper + 0.00014209 0.031682 7.0642 +S> anova( fm1HR, fm2HR ) # confirm with likelihood ratio + Model df AIC BIC logLik Test L.Ratio p-value +fm1HR 1 11 809.75 840.42 -393.88 +fm2HR 2 12 809.02 842.47 -392.51 1 vs 2 2.7355 0.0981 +S> fm3HR <- update( fm1HR, HR ~ Time + Drug + baseHR ) # remove interaction +S> anova( fm1HR, fm3HR ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1HR 1 11 809.75 840.42 -393.88 +fm3HR 2 9 808.92 834.01 -395.46 1 vs 2 3.1651 0.2055 +S> summary( fm3HR ) +Linear mixed-effects model fit by maximum likelihood + Data: HR + AIC BIC logLik + 808.92 834.01 -395.46 + +Random effects: + Formula: ~ Time | Patient + Structure: General positive-definite + StdDev Corr +(Intercept) 7.2461 (Inter + Time 6.1343 -0.604 + Residual 4.9359 + +Fixed effects: HR ~ Time + Drug + baseHR + Value Std.Error DF t-value p-value +(Intercept) 36.049 9.5130 95 3.7895 0.0003 + Time -7.027 1.8176 95 -3.8663 0.0002 + Druga -0.453 3.2773 20 -0.1383 0.8914 + Drugb 4.936 3.2526 20 1.5175 0.1448 + baseHR 0.543 0.1083 20 5.0171 0.0001 + Correlation: + (Intr) Time Druga Drugb + Time -0.103 + Druga -0.297 0.000 + Drugb -0.219 0.000 0.502 +baseHR -0.965 0.000 0.132 0.050 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1262 -0.54393 -0.031224 0.45798 2.4581 + +Number of Observations: 120 +Number of Groups: 24 +S> fm4HR <- update( fm3HR, HR ~ Time + baseHR ) # remove Drug term +S> anova( fm1HR, fm3HR, fm4HR ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1HR 1 11 809.75 840.42 -393.88 +fm3HR 2 9 808.92 834.01 -395.46 1 vs 2 3.1651 0.2055 +fm4HR 3 7 808.21 827.72 -397.11 2 vs 3 3.2925 0.1928 +S> summary( fm4HR ) +Linear mixed-effects model fit by maximum likelihood + Data: HR + AIC BIC logLik + 808.21 827.72 -397.11 + +Random effects: + Formula: ~ Time | Patient + Structure: General positive-definite + StdDev Corr +(Intercept) 7.6072 (Inter + Time 6.1367 -0.564 + Residual 4.9357 + +Fixed effects: HR ~ Time + baseHR + Value Std.Error DF t-value p-value +(Intercept) 36.931 9.6028 95 3.8459 2e-04 + Time -7.027 1.8023 95 -3.8991 2e-04 + baseHR 0.551 0.1140 22 4.8325 1e-04 + Correlation: + (Intr) Time + Time -0.100 +baseHR -0.984 0.000 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1929 -0.50894 -0.038365 0.42728 2.4281 + +Number of Observations: 120 +Number of Groups: 24 +S> plot( augPred( fm4HR, length = 2 ) ) # compare predictions and data diff --git a/transcripts/HR.q b/transcripts/HR.q new file mode 100644 index 0000000..d4b5839 --- /dev/null +++ b/transcripts/HR.q @@ -0,0 +1,21 @@ +### $Id: HR.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Heart rate data given as data set 3.5 in +### "SAS System for Mixed Models" +options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +formula(HR) +plot(HR) # basic trellis plot +plot(HR, outer = ~ Drug ) # by drug type +fm1HR <- lme( HR ~ Time * Drug + baseHR, data = HR, # linear trend in time + random = ~ Time | Patient, method = "ML") +summary( fm1HR ) +fm2HR <- update( fm1HR, weights = varPower(0) ) # use power-of-mean variance +summary( fm2HR ) +intervals( fm2HR ) # variance function does not seem significant +anova( fm1HR, fm2HR ) # confirm with likelihood ratio +fm3HR <- update( fm1HR, HR ~ Time + Drug + baseHR ) # remove interaction +anova( fm1HR, fm3HR ) +summary( fm3HR ) +fm4HR <- update( fm3HR, HR ~ Time + baseHR ) # remove Drug term +anova( fm1HR, fm3HR, fm4HR ) +summary( fm4HR ) +plot( augPred( fm4HR, length = 2 ) ) # compare predictions and data diff --git a/transcripts/Mississippi.St b/transcripts/Mississippi.St new file mode 100644 index 0000000..d362294 --- /dev/null +++ b/transcripts/Mississippi.St @@ -0,0 +1,132 @@ +S> ### $Id: Mississippi.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the Mississippi nitrogren concentrations given as data set +S> ### 4.2 in "SAS System for Mixed Models" +S> options(contrasts=c(factor="contr.SAS", ordered="contr.poly")) +S> formula( Mississippi ) +y ~ 1 | influent +S> plot( Mississippi ) +S> fm1Miss <- lme( y ~ 1, data = Mississippi, random = ~ 1 | influent, ++ method = "ML") +S> summary( fm1Miss ) # compare with output 4.2, p. 143 +Linear mixed-effects model fit by maximum likelihood + Data: Mississippi + AIC BIC logLik + 262.56 267.39 -128.28 + +Random effects: + Formula: ~ 1 | influent + (Intercept) Residual +StdDev: 7.1592 6.5343 + +Fixed effects: y ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 21.217 3.1651 31 6.7035 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.9344 -0.55704 -0.035454 0.8376 1.9323 + +Number of Observations: 37 +Number of Groups: 6 +S> fm1RMiss <- update( fm1Miss, method = "REML" ) +S> summary( fm1RMiss ) # compare with output 4.1, p. 142 +Linear mixed-effects model fit by REML + Data: Mississippi + AIC BIC logLik + 258.35 263.1 -126.18 + +Random effects: + Formula: ~ 1 | influent + (Intercept) Residual +StdDev: 7.9576 6.5313 + +Fixed effects: y ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 21.223 3.429 31 6.1892 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.9144 -0.53646 -0.032173 0.83714 1.9582 + +Number of Observations: 37 +Number of Groups: 6 +S> random.effects( fm1Miss ) # BLUP's of random effects on p. 144 + (Intercept) +3 -3.78627 +5 -5.84352 +2 -6.57723 +1 0.30978 +4 2.88267 +6 13.01457 +S> random.effects( fm1Miss , aug = TRUE ) # including covariates + (Intercept) y Type +3 -3.78627 16.800 1 +5 -5.84352 14.400 1 +2 -6.57723 13.857 2 +1 0.30978 21.556 2 +4 2.88267 24.500 2 +6 13.01457 36.400 3 +S> plot( random.effects( fm1Miss , aug = TRUE ), outer = ~ Type ) +Error in panel(x = c(-3.7862747633584, -5...: Can't pass data of + mode "call" to old-S function +Dumped +S> random.effects( fm1RMiss ) # BLUP's of random effects on p. 142 + (Intercept) +3 -3.89795 +5 -6.01298 +2 -6.71933 +1 0.30929 +4 2.94610 +6 13.37487 +S> intervals( fm1RMiss ) # interval estimates of variance components +Approximate 95% confidence intervals + + Fixed effects: + lower est. upper +(Intercept) 14.23 21.223 28.217 + + Random Effects: + Level: influent + lower est. upper +sd((Intercept)) 3.9513 7.9576 16.026 + + Within-group standard error: + lower est. upper + 5.0895 6.5313 8.3815 +S> c(2.9568, 7.9576, 21.416)^2 # compare to output 4.7, p. 148 +[1] 8.7427 63.3234 458.6451 +S> fm2RMiss <- lme( y ~ Type, data = Mississippi, random = ~ 1 | influent, ++ method = "REML" ) +S> summary( fm2RMiss ) # compare to output 4.8 and 4.9, pp. 150-152 +Linear mixed-effects model fit by REML + Data: Mississippi + AIC BIC logLik + 244.52 252.16 -117.26 + +Random effects: + Formula: ~ 1 | influent + (Intercept) Residual +StdDev: 3.8691 6.5202 + +Fixed effects: y ~ Type + Value Std.Error DF t-value p-value +(Intercept) 36.400 4.8449 31 7.5131 <.0001 + Type1 -20.800 5.9338 3 -3.5054 0.0393 + Type2 -16.462 5.5168 3 -2.9840 0.0584 + Correlation: + (Intr) Type1 +Type1 -0.816 +Type2 -0.878 0.717 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.0877 -0.63918 -0.025703 0.70549 2.0191 + +Number of Observations: 37 +Number of Groups: 6 +S> fm2Miss <- update( fm2RMiss, method = "ML" ) # get ML results too +S> anova( fm1Miss, fm2Miss ) # getting a p-value for the Type + Model df AIC BIC logLik Test L.Ratio p-value +fm1Miss 1 3 262.56 267.39 -128.28 +fm2Miss 2 5 256.57 264.63 -123.29 1 vs 2 9.9834 0.0068 +S> ## Notice that the p-value is considerably smaller than for the F-test. diff --git a/transcripts/Mississippi.q b/transcripts/Mississippi.q new file mode 100644 index 0000000..8ca32d8 --- /dev/null +++ b/transcripts/Mississippi.q @@ -0,0 +1,23 @@ +### $Id: Mississippi.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Mississippi nitrogren concentrations given as data set +### 4.2 in "SAS System for Mixed Models" +options(contrasts=c(factor="contr.SAS", ordered="contr.poly")) +formula( Mississippi ) +plot( Mississippi ) +fm1Miss <- lme( y ~ 1, data = Mississippi, random = ~ 1 | influent, + method = "ML") +summary( fm1Miss ) # compare with output 4.2, p. 143 +fm1RMiss <- update( fm1Miss, method = "REML" ) +summary( fm1RMiss ) # compare with output 4.1, p. 142 +random.effects( fm1Miss ) # BLUP's of random effects on p. 144 +random.effects( fm1Miss , aug = TRUE ) # including covariates +plot( random.effects( fm1Miss , aug = TRUE ), form = ~ Type ) +random.effects( fm1RMiss ) # BLUP's of random effects on p. 142 +intervals( fm1RMiss ) # interval estimates of variance components +c(2.9568, 7.9576, 21.416)^2 # compare to output 4.7, p. 148 +fm2RMiss <- lme( y ~ Type, data = Mississippi, random = ~ 1 | influent, + method = "REML" ) +summary( fm2RMiss ) # compare to output 4.8 and 4.9, pp. 150-152 +fm2Miss <- update( fm2RMiss, method = "ML" ) # get ML results too +anova( fm1Miss, fm2Miss ) # getting a p-value for the Type + ## Notice that the p-value is considerably smaller than for the F-test. diff --git a/transcripts/Multilocation.St b/transcripts/Multilocation.St new file mode 100644 index 0000000..ff806b7 --- /dev/null +++ b/transcripts/Multilocation.St @@ -0,0 +1,512 @@ +S> ### $Id: Multilocation.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the Multilocation data with fixed effects for the locations +S> options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> formula( Multilocation ) +Adj ~ 1 | Location/Block +S> names( Multilocation ) +[1] "obs" "Location" "Block" "Trt" "Adj" +[6] "Fe" "Grp" +S> ### Create a Block %in% Location factor +S> Multilocation$Grp <- ++ getGroups( Multilocation, form = ~ Location/Block, level = 2 ) +S> fm1Mult <- lme( Adj ~ Location * Trt, data = Multilocation, ~ 1 | Grp, ++ method = "ML") +S> summary( fm1Mult ) +Linear mixed-effects model fit by maximum likelihood + Data: Multilocation + AIC BIC logLik + -11.146 90.775 43.573 + +Random effects: + Formula: ~ 1 | Grp + (Intercept) Residual +StdDev: 0.061206 0.15183 + +Fixed effects: Adj ~ Location * Trt + Value Std.Error DF t-value p-value + (Intercept) 2.8657 0.03859 54 74.269 <.0001 + Location.L 0.8136 0.11576 18 7.029 <.0001 + Location.Q 0.2440 0.11576 18 2.108 0.0493 + Location.C 0.0990 0.11576 18 0.855 0.4036 + Location ^ 4 -0.2996 0.11576 18 -2.588 0.0186 + Location ^ 5 0.1272 0.11576 18 1.099 0.2863 + Location ^ 6 -0.0331 0.11576 18 -0.286 0.7785 + Location ^ 7 -0.4080 0.11576 18 -3.525 0.0024 + Location ^ 8 0.0851 0.11576 18 0.735 0.4719 + Trt1 0.0583 0.05061 54 1.153 0.2541 + Trt2 -0.1880 0.05061 54 -3.715 0.0005 + Trt3 0.0838 0.05061 54 1.656 0.1036 + Location.LTrt1 0.2002 0.15183 54 1.319 0.1928 + Location.QTrt1 -0.3034 0.15183 54 -1.999 0.0507 + Location.CTrt1 -0.0409 0.15183 54 -0.269 0.7886 +Location ^ 4Trt1 0.3640 0.15183 54 2.397 0.0200 +Location ^ 5Trt1 -0.1480 0.15183 54 -0.975 0.3340 +Location ^ 6Trt1 0.0246 0.15183 54 0.162 0.8718 +Location ^ 7Trt1 0.1470 0.15183 54 0.968 0.3374 +Location ^ 8Trt1 0.1968 0.15183 54 1.296 0.2004 + Location.LTrt2 0.0812 0.15183 54 0.535 0.5949 + Location.QTrt2 -0.3237 0.15183 54 -2.132 0.0376 + Location.CTrt2 -0.1377 0.15183 54 -0.907 0.3684 +Location ^ 4Trt2 0.0713 0.15183 54 0.470 0.6403 +Location ^ 5Trt2 0.0396 0.15183 54 0.261 0.7953 +Location ^ 6Trt2 0.1124 0.15183 54 0.740 0.4624 +Location ^ 7Trt2 0.2366 0.15183 54 1.558 0.1250 +Location ^ 8Trt2 -0.0375 0.15183 54 -0.247 0.8060 + Location.LTrt3 0.1344 0.15183 54 0.885 0.3799 + Location.QTrt3 -0.3384 0.15183 54 -2.229 0.0300 + Location.CTrt3 0.0969 0.15183 54 0.638 0.5259 +Location ^ 4Trt3 0.1093 0.15183 54 0.720 0.4746 +Location ^ 5Trt3 -0.1372 0.15183 54 -0.904 0.3702 +Location ^ 6Trt3 0.1836 0.15183 54 1.209 0.2319 +Location ^ 7Trt3 0.2799 0.15183 54 1.844 0.0707 +Location ^ 8Trt3 -0.0057 0.15183 54 -0.038 0.9700 + Correlation: + (Intr) Lctn.L Lctn.Q Lctn.C Lctn^4 Lctn^5 + Location.L 0.000 + Location.Q 0.000 0.000 + Location.C 0.000 0.000 0.000 + Location ^ 4 0.000 0.000 0.000 0.000 + Location ^ 5 0.000 0.000 0.000 0.000 0.000 + Location ^ 6 0.000 0.000 0.000 0.000 0.000 0.000 + Location ^ 7 0.000 0.000 0.000 0.000 0.000 0.000 + Location ^ 8 0.000 0.000 0.000 0.000 0.000 0.000 + Trt1 -0.656 0.000 0.000 0.000 0.000 0.000 + Trt2 -0.656 0.000 0.000 0.000 0.000 0.000 + Trt3 -0.656 0.000 0.000 0.000 0.000 0.000 + Location.LTrt1 0.000 -0.656 0.000 0.000 0.000 0.000 + Location.QTrt1 0.000 0.000 -0.656 0.000 0.000 0.000 + Location.CTrt1 0.000 0.000 0.000 -0.656 0.000 0.000 +Location ^ 4Trt1 0.000 0.000 0.000 0.000 -0.656 0.000 +Location ^ 5Trt1 0.000 0.000 0.000 0.000 0.000 -0.656 +Location ^ 6Trt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt1 0.000 0.000 0.000 0.000 0.000 0.000 + Location.LTrt2 0.000 -0.656 0.000 0.000 0.000 0.000 + Location.QTrt2 0.000 0.000 -0.656 0.000 0.000 0.000 + Location.CTrt2 0.000 0.000 0.000 -0.656 0.000 0.000 +Location ^ 4Trt2 0.000 0.000 0.000 0.000 -0.656 0.000 +Location ^ 5Trt2 0.000 0.000 0.000 0.000 0.000 -0.656 +Location ^ 6Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt2 0.000 0.000 0.000 0.000 0.000 0.000 + Location.LTrt3 0.000 -0.656 0.000 0.000 0.000 0.000 + Location.QTrt3 0.000 0.000 -0.656 0.000 0.000 0.000 + Location.CTrt3 0.000 0.000 0.000 -0.656 0.000 0.000 +Location ^ 4Trt3 0.000 0.000 0.000 0.000 -0.656 0.000 +Location ^ 5Trt3 0.000 0.000 0.000 0.000 0.000 -0.656 +Location ^ 6Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.000 0.000 0.000 0.000 0.000 + Lctn^6 Lctn^7 Lctn^8 Trt1 Trt2 Trt3 + Location.L + Location.Q + Location.C + Location ^ 4 + Location ^ 5 + Location ^ 6 + Location ^ 7 0.000 + Location ^ 8 0.000 0.000 + Trt1 0.000 0.000 0.000 + Trt2 0.000 0.000 0.000 0.500 + Trt3 0.000 0.000 0.000 0.500 0.500 + Location.LTrt1 0.000 0.000 0.000 0.000 0.000 0.000 + Location.QTrt1 0.000 0.000 0.000 0.000 0.000 0.000 + Location.CTrt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 4Trt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 5Trt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt1 -0.656 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt1 0.000 -0.656 0.000 0.000 0.000 0.000 +Location ^ 8Trt1 0.000 0.000 -0.656 0.000 0.000 0.000 + Location.LTrt2 0.000 0.000 0.000 0.000 0.000 0.000 + Location.QTrt2 0.000 0.000 0.000 0.000 0.000 0.000 + Location.CTrt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 4Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 5Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt2 -0.656 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt2 0.000 -0.656 0.000 0.000 0.000 0.000 +Location ^ 8Trt2 0.000 0.000 -0.656 0.000 0.000 0.000 + Location.LTrt3 0.000 0.000 0.000 0.000 0.000 0.000 + Location.QTrt3 0.000 0.000 0.000 0.000 0.000 0.000 + Location.CTrt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 4Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 5Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt3 -0.656 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt3 0.000 -0.656 0.000 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.000 -0.656 0.000 0.000 0.000 + LctLT1 LctQT1 LctCT1 Lc^4T1 Lc^5T1 Lc^6T1 + Location.L + Location.Q + Location.C + Location ^ 4 + Location ^ 5 + Location ^ 6 + Location ^ 7 + Location ^ 8 + Trt1 + Trt2 + Trt3 + Location.LTrt1 + Location.QTrt1 0.000 + Location.CTrt1 0.000 0.000 +Location ^ 4Trt1 0.000 0.000 0.000 +Location ^ 5Trt1 0.000 0.000 0.000 0.000 +Location ^ 6Trt1 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt1 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt1 0.000 0.000 0.000 0.000 0.000 0.000 + Location.LTrt2 0.500 0.000 0.000 0.000 0.000 0.000 + Location.QTrt2 0.000 0.500 0.000 0.000 0.000 0.000 + Location.CTrt2 0.000 0.000 0.500 0.000 0.000 0.000 +Location ^ 4Trt2 0.000 0.000 0.000 0.500 0.000 0.000 +Location ^ 5Trt2 0.000 0.000 0.000 0.000 0.500 0.000 +Location ^ 6Trt2 0.000 0.000 0.000 0.000 0.000 0.500 +Location ^ 7Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt2 0.000 0.000 0.000 0.000 0.000 0.000 + Location.LTrt3 0.500 0.000 0.000 0.000 0.000 0.000 + Location.QTrt3 0.000 0.500 0.000 0.000 0.000 0.000 + Location.CTrt3 0.000 0.000 0.500 0.000 0.000 0.000 +Location ^ 4Trt3 0.000 0.000 0.000 0.500 0.000 0.000 +Location ^ 5Trt3 0.000 0.000 0.000 0.000 0.500 0.000 +Location ^ 6Trt3 0.000 0.000 0.000 0.000 0.000 0.500 +Location ^ 7Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.000 0.000 0.000 0.000 0.000 + Lc^7T1 Lc^8T1 LctLT2 LctQT2 LctCT2 Lc^4T2 + Location.L + Location.Q + Location.C + Location ^ 4 + Location ^ 5 + Location ^ 6 + Location ^ 7 + Location ^ 8 + Trt1 + Trt2 + Trt3 + Location.LTrt1 + Location.QTrt1 + Location.CTrt1 +Location ^ 4Trt1 +Location ^ 5Trt1 +Location ^ 6Trt1 +Location ^ 7Trt1 +Location ^ 8Trt1 0.000 + Location.LTrt2 0.000 0.000 + Location.QTrt2 0.000 0.000 0.000 + Location.CTrt2 0.000 0.000 0.000 0.000 +Location ^ 4Trt2 0.000 0.000 0.000 0.000 0.000 +Location ^ 5Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt2 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt2 0.500 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt2 0.000 0.500 0.000 0.000 0.000 0.000 + Location.LTrt3 0.000 0.000 0.500 0.000 0.000 0.000 + Location.QTrt3 0.000 0.000 0.000 0.500 0.000 0.000 + Location.CTrt3 0.000 0.000 0.000 0.000 0.500 0.000 +Location ^ 4Trt3 0.000 0.000 0.000 0.000 0.000 0.500 +Location ^ 5Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7Trt3 0.500 0.000 0.000 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.500 0.000 0.000 0.000 0.000 + Lc^5T2 Lc^6T2 Lc^7T2 Lc^8T2 LctLT3 LctQT3 + Location.L + Location.Q + Location.C + Location ^ 4 + Location ^ 5 + Location ^ 6 + Location ^ 7 + Location ^ 8 + Trt1 + Trt2 + Trt3 + Location.LTrt1 + Location.QTrt1 + Location.CTrt1 +Location ^ 4Trt1 +Location ^ 5Trt1 +Location ^ 6Trt1 +Location ^ 7Trt1 +Location ^ 8Trt1 + Location.LTrt2 + Location.QTrt2 + Location.CTrt2 +Location ^ 4Trt2 +Location ^ 5Trt2 +Location ^ 6Trt2 0.000 +Location ^ 7Trt2 0.000 0.000 +Location ^ 8Trt2 0.000 0.000 0.000 + Location.LTrt3 0.000 0.000 0.000 0.000 + Location.QTrt3 0.000 0.000 0.000 0.000 0.000 + Location.CTrt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 4Trt3 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 5Trt3 0.500 0.000 0.000 0.000 0.000 0.000 +Location ^ 6Trt3 0.000 0.500 0.000 0.000 0.000 0.000 +Location ^ 7Trt3 0.000 0.000 0.500 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.000 0.000 0.500 0.000 0.000 + LctCT3 Lc^4T3 Lc^5T3 Lc^6T3 Lc^7T3 + Location.L + Location.Q + Location.C + Location ^ 4 + Location ^ 5 + Location ^ 6 + Location ^ 7 + Location ^ 8 + Trt1 + Trt2 + Trt3 + Location.LTrt1 + Location.QTrt1 + Location.CTrt1 +Location ^ 4Trt1 +Location ^ 5Trt1 +Location ^ 6Trt1 +Location ^ 7Trt1 +Location ^ 8Trt1 + Location.LTrt2 + Location.QTrt2 + Location.CTrt2 +Location ^ 4Trt2 +Location ^ 5Trt2 +Location ^ 6Trt2 +Location ^ 7Trt2 +Location ^ 8Trt2 + Location.LTrt3 + Location.QTrt3 + Location.CTrt3 +Location ^ 4Trt3 0.000 +Location ^ 5Trt3 0.000 0.000 +Location ^ 6Trt3 0.000 0.000 0.000 +Location ^ 7Trt3 0.000 0.000 0.000 0.000 +Location ^ 8Trt3 0.000 0.000 0.000 0.000 0.000 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.4871 -0.5169 -0.0009498 0.55424 3.2972 + +Number of Observations: 108 +Number of Groups: 27 +S> fm2Mult <- update( fm1Mult, Adj ~ Location + Trt ) +S> fm3Mult <- update( fm1Mult, Adj ~ Location ) +S> fm4Mult <- update( fm1Mult, Adj ~ Trt ) +S> fm5Mult <- update( fm1Mult, Adj ~ 1 ) +S> anova( fm1Mult, fm2Mult, fm3Mult, fm5Mult ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Mult 1 38 -11.146 90.775 43.573 +fm2Mult 2 14 -24.504 13.046 26.252 1 vs 2 34.642 0.0739 +fm3Mult 3 11 -0.956 28.547 11.478 2 vs 3 29.548 <.0001 +fm5Mult 4 3 49.731 57.777 -21.865 3 vs 4 66.687 <.0001 +S> anova( fm1Mult, fm2Mult, fm4Mult, fm5Mult ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Mult 1 38 -11.146 90.775 43.573 +fm2Mult 2 14 -24.504 13.046 26.252 1 vs 2 34.642 0.0739 +fm4Mult 3 6 26.951 43.044 -7.476 2 vs 3 67.455 <.0001 +fm5Mult 4 3 49.731 57.777 -21.865 3 vs 4 28.780 <.0001 +S> ### AIC, BIC, and likelihood ratio tests all prefer model fm2Mult +S> summary( fm2Mult ) +Linear mixed-effects model fit by maximum likelihood + Data: Multilocation + AIC BIC logLik + -24.504 13.046 26.252 + +Random effects: + Formula: ~ 1 | Grp + (Intercept) Residual +StdDev: 0.025894 0.18803 + +Fixed effects: Adj ~ Location + Trt + Value Std.Error DF t-value p-value + (Intercept) 2.8657 0.038744 78 73.964 <.0001 + Location.L 0.9176 0.059716 18 15.366 <.0001 + Location.Q 0.0026 0.059716 18 0.044 0.9655 + Location.C 0.0786 0.059716 18 1.316 0.2046 +Location ^ 4 -0.1634 0.059716 18 -2.737 0.0135 +Location ^ 5 0.0658 0.059716 18 1.102 0.2850 +Location ^ 6 0.0471 0.059716 18 0.789 0.4406 +Location ^ 7 -0.2422 0.059716 18 -4.055 0.0007 +Location ^ 8 0.1235 0.059716 18 2.068 0.0534 + Trt1 0.0583 0.054280 78 1.075 0.2857 + Trt2 -0.1880 0.054280 78 -3.464 0.0009 + Trt3 0.0838 0.054280 78 1.544 0.1267 + Correlation: + (Intr) Lctn.L Lctn.Q Lctn.C Lctn^4 Lctn^5 Lctn^6 + Location.L 0.0 + Location.Q 0.0 0.0 + Location.C 0.0 0.0 0.0 +Location ^ 4 0.0 0.0 0.0 0.0 +Location ^ 5 0.0 0.0 0.0 0.0 0.0 +Location ^ 6 0.0 0.0 0.0 0.0 0.0 0.0 +Location ^ 7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +Location ^ 8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + Trt1 -0.7 0.0 0.0 0.0 0.0 0.0 0.0 + Trt2 -0.7 0.0 0.0 0.0 0.0 0.0 0.0 + Trt3 -0.7 0.0 0.0 0.0 0.0 0.0 0.0 + Lctn^7 Lctn^8 Trt1 Trt2 + Location.L + Location.Q + Location.C +Location ^ 4 +Location ^ 5 +Location ^ 6 +Location ^ 7 +Location ^ 8 0.0 + Trt1 0.0 0.0 + Trt2 0.0 0.0 0.5 + Trt3 0.0 0.0 0.5 0.5 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.1253 -0.65599 -0.092189 0.61603 2.9345 + +Number of Observations: 108 +Number of Groups: 27 +S> fm2RMult <- update( fm2Mult, method = "REML" ) # get REML estimates +S> summary( fm2RMult ) +Linear mixed-effects model fit by REML + Data: Multilocation + AIC BIC logLik + 24.196 60.097 1.9019 + +Random effects: + Formula: ~ 1 | Grp + (Intercept) Residual +StdDev: 0.07131 0.19161 + +Fixed effects: Adj ~ Location + Trt + Value Std.Error DF t-value p-value + (Intercept) 2.8657 0.039347 78 72.831 <.0001 + Location.L 0.9176 0.068954 18 13.307 <.0001 + Location.Q 0.0026 0.068954 18 0.038 0.9702 + Location.C 0.0786 0.068954 18 1.140 0.2693 +Location ^ 4 -0.1634 0.068954 18 -2.370 0.0292 +Location ^ 5 0.0658 0.068954 18 0.954 0.3526 +Location ^ 6 0.0471 0.068954 18 0.683 0.5033 +Location ^ 7 -0.2422 0.068954 18 -3.512 0.0025 +Location ^ 8 0.1235 0.068954 18 1.791 0.0902 + Trt1 0.0583 0.052150 78 1.119 0.2667 + Trt2 -0.1880 0.052150 78 -3.605 0.0005 + Trt3 0.0838 0.052150 78 1.607 0.1122 + Correlation: + (Intr) Lctn.L Lctn.Q Lctn.C Lctn^4 Lctn^5 Lctn^6 + Location.L 0.000 + Location.Q 0.000 0.000 + Location.C 0.000 0.000 0.000 +Location ^ 4 0.000 0.000 0.000 0.000 +Location ^ 5 0.000 0.000 0.000 0.000 0.000 +Location ^ 6 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 7 0.000 0.000 0.000 0.000 0.000 0.000 0.000 +Location ^ 8 0.000 0.000 0.000 0.000 0.000 0.000 0.000 + Trt1 -0.663 0.000 0.000 0.000 0.000 0.000 0.000 + Trt2 -0.663 0.000 0.000 0.000 0.000 0.000 0.000 + Trt3 -0.663 0.000 0.000 0.000 0.000 0.000 0.000 + Lctn^7 Lctn^8 Trt1 Trt2 + Location.L + Location.Q + Location.C +Location ^ 4 +Location ^ 5 +Location ^ 6 +Location ^ 7 +Location ^ 8 0.000 + Trt1 0.000 0.000 + Trt2 0.000 0.000 0.500 + Trt3 0.000 0.000 0.500 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.0603 -0.65887 -0.059717 0.60982 2.6211 + +Number of Observations: 108 +Number of Groups: 27 +S> ### Treating the location as a random effect +S> fm1MultR <- lme( Adj ~ Trt, data = Multilocation, method = "ML", ++ random = list( Location = pdCompSymm( ~ Trt - 1 ), Block = ~ 1 ) ) +S> summary( fm1MultR ) +Linear mixed-effects model fit by maximum likelihood + Data: Multilocation + AIC BIC logLik + 2.3564 23.813 6.8218 + +Random effects: + Formula: ~ Trt - 1 | Location + Structure: Compound Symmetry + StdDev Corr +Trt1 0.31933 +Trt2 0.31933 0.992 +Trt3 0.31933 0.992 0.992 +Trt4 0.31933 0.992 0.992 0.992 + + Formula: ~ 1 | Block %in% Location + (Intercept) Residual +StdDev: 0.074962 0.18595 + +Fixed effects: Adj ~ Trt + Value Std.Error DF t-value p-value +(Intercept) 2.8657 0.11538 78 24.837 <.0001 + Trt1 0.0583 0.05328 78 1.095 0.2769 + Trt2 -0.1880 0.05328 78 -3.529 0.0007 + Trt3 0.0838 0.05328 78 1.572 0.1199 + Correlation: + (Intr) Trt1 Trt2 +Trt1 -0.231 +Trt2 -0.231 0.500 +Trt3 -0.231 0.500 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.0977 -0.64759 -0.062211 0.58966 2.619 + +Number of Observations: 108 +Number of Groups: + Location Block %in% Location + 9 27 +S> fm2MultR <- update( fm1MultR, random = list( Location = ~ Trt - 1, Block = ~ 1 )) +Warning messages: + ITERATION LIMIT REACHED WITHOUT OTHER CONVERGENCE in: ms( ~ \ + - logLik(lmeSt, lmePars), start = list(lmePars = c(coef( .... +S> anova( fm1MultR, fm2MultR ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1MultR 1 8 2.356 23.813 6.8218 +fm2MultR 2 16 15.825 58.739 8.0877 1 vs 2 2.5318 0.9602 +S> ## No indication that a general variance-covariance is preferred to +S> ## a compound symmetry structure. +S> fm1RMultR <- update( fm1MultR, method = "REML" ) +S> summary( fm1RMultR ) +Linear mixed-effects model fit by REML + Data: Multilocation + AIC BIC logLik + 17.613 38.768 -0.80661 + +Random effects: + Formula: ~ Trt - 1 | Location + Structure: Compound Symmetry + StdDev Corr +Trt1 0.34116 +Trt2 0.34116 0.98 +Trt3 0.34116 0.98 0.98 +Trt4 0.34116 0.98 0.98 0.98 + + Formula: ~ 1 | Block %in% Location + (Intercept) Residual +StdDev: 0.074962 0.18595 + +Fixed effects: Adj ~ Trt + Value Std.Error DF t-value p-value +(Intercept) 2.8657 0.12009 78 23.863 <.0001 + Trt1 0.0583 0.05546 78 1.052 0.2960 + Trt2 -0.1880 0.05546 78 -3.390 0.0011 + Trt3 0.0838 0.05546 78 1.511 0.1349 + Correlation: + (Intr) Trt1 Trt2 +Trt1 -0.231 +Trt2 -0.231 0.500 +Trt3 -0.231 0.500 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.9837 -0.67435 -0.030874 0.5388 2.6272 + +Number of Observations: 108 +Number of Groups: + Location Block %in% Location + 9 27 +S> c( 0.34116, 0.07497, 0.18596)^2 # compare with estimates, p. 84 +[1] 0.1163901 0.0056205 0.0345811 diff --git a/transcripts/Multilocation.q b/transcripts/Multilocation.q new file mode 100644 index 0000000..16a050b --- /dev/null +++ b/transcripts/Multilocation.q @@ -0,0 +1,32 @@ +### $Id: Multilocation.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Multilocation data with fixed effects for the locations +options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +formula( Multilocation ) +names( Multilocation ) +### Create a Block %in% Location factor +Multilocation$Grp <- + getGroups( Multilocation, form = ~ Location/Block, level = 2 ) +fm1Mult <- lme( Adj ~ Location * Trt, data = Multilocation, ~ 1 | Grp, + method = "ML") +summary( fm1Mult ) +fm2Mult <- update( fm1Mult, Adj ~ Location + Trt ) +fm3Mult <- update( fm1Mult, Adj ~ Location ) +fm4Mult <- update( fm1Mult, Adj ~ Trt ) +fm5Mult <- update( fm1Mult, Adj ~ 1 ) +anova( fm1Mult, fm2Mult, fm3Mult, fm5Mult ) +anova( fm1Mult, fm2Mult, fm4Mult, fm5Mult ) +### AIC, BIC, and likelihood ratio tests all prefer model fm2Mult +summary( fm2Mult ) +fm2RMult <- update( fm2Mult, method = "REML" ) # get REML estimates +summary( fm2RMult ) +### Treating the location as a random effect +fm1MultR <- lme( Adj ~ Trt, data = Multilocation, method = "ML", + random = list( Location = pdCompSymm( ~ Trt - 1 ), Block = ~ 1 ) ) +summary( fm1MultR ) +fm2MultR <- update( fm1MultR, random = list( Location = ~ Trt - 1, Block = ~ 1 )) +anova( fm1MultR, fm2MultR ) +## No indication that a general variance-covariance is preferred to +## a compound symmetry structure. +fm1RMultR <- update( fm1MultR, method = "REML" ) +summary( fm1RMultR ) +c( 0.34116, 0.07497, 0.18596)^2 # compare with estimates, p. 84 diff --git a/transcripts/PBIB.St b/transcripts/PBIB.St new file mode 100644 index 0000000..d5b3896 --- /dev/null +++ b/transcripts/PBIB.St @@ -0,0 +1,158 @@ +S> ### $Id: PBIB.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the partially balanced incomplete blocked PBIB data +S> options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +S> formula( PBIB ) +response ~ Treatment | Block +S> names( PBIB ) +[1] "response" "Treatment" "Block" +S> sapply( PBIB, data.class ) + response Treatment Block + "numeric" "factor" "ordered" +S> fm1PBIB <- lme( response ~ Treatment, data = PBIB, random = ~ 1 | Block, ++ method = "ML") +S> summary( fm1PBIB ) +Linear mixed-effects model fit by maximum likelihood + Data: PBIB + AIC BIC logLik + 56.571 92.174 -11.285 + +Random effects: + Formula: ~ 1 | Block + (Intercept) Residual +StdDev: 0.2122 0.24571 + +Fixed effects: response ~ Treatment + Value Std.Error DF t-value p-value +(Intercept) 2.8573 0.16577 31 17.236 <.0001 + Treatment1 -0.0346 0.21700 31 -0.159 0.8744 + Treatment2 -0.4507 0.21700 31 -2.077 0.0462 + Treatment3 -0.4026 0.21700 31 -1.855 0.0731 + Treatment4 -0.0923 0.21700 31 -0.425 0.6735 + Treatment5 -0.0520 0.22253 31 -0.234 0.8169 + Treatment6 0.0521 0.21700 31 0.240 0.8119 + Treatment7 -0.0718 0.21700 31 -0.331 0.7429 + Treatment8 -0.0700 0.21700 31 -0.323 0.7491 + Treatment9 0.0419 0.21700 31 0.193 0.8483 +Treatment10 -0.3616 0.22253 31 -1.625 0.1143 +Treatment11 0.0330 0.21700 31 0.152 0.8803 +Treatment12 0.1879 0.21700 31 0.866 0.3933 +Treatment13 -0.2297 0.21700 31 -1.059 0.2980 +Treatment14 -0.3581 0.21700 31 -1.650 0.1090 + Correlation: + (Intr) Trtmn1 Trtmn2 Trtmn3 Trtmn4 Trtmn5 Trtmn6 + Treatment1 -0.655 + Treatment2 -0.655 0.500 + Treatment3 -0.655 0.500 0.500 + Treatment4 -0.655 0.500 0.500 0.500 + Treatment5 -0.671 0.513 0.513 0.513 0.513 + Treatment6 -0.655 0.474 0.500 0.500 0.500 0.513 + Treatment7 -0.655 0.500 0.474 0.500 0.500 0.513 0.500 + Treatment8 -0.655 0.500 0.500 0.474 0.500 0.513 0.500 + Treatment9 -0.655 0.500 0.500 0.500 0.474 0.513 0.500 +Treatment10 -0.671 0.513 0.513 0.513 0.513 0.500 0.513 +Treatment11 -0.655 0.474 0.500 0.500 0.500 0.513 0.474 +Treatment12 -0.655 0.500 0.474 0.500 0.500 0.513 0.500 +Treatment13 -0.655 0.500 0.500 0.474 0.500 0.513 0.500 +Treatment14 -0.655 0.500 0.500 0.500 0.474 0.513 0.500 + Trtmn7 Trtmn8 Trtmn9 Trtm10 Trtm11 Trtm12 Trtm13 + Treatment1 + Treatment2 + Treatment3 + Treatment4 + Treatment5 + Treatment6 + Treatment7 + Treatment8 0.500 + Treatment9 0.500 0.500 +Treatment10 0.513 0.513 0.513 +Treatment11 0.500 0.500 0.500 0.513 +Treatment12 0.474 0.500 0.500 0.513 0.500 +Treatment13 0.500 0.474 0.500 0.513 0.500 0.500 +Treatment14 0.500 0.500 0.474 0.513 0.500 0.500 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.7419 -0.56754 0.0096936 0.44333 3.1061 + +Number of Observations: 60 +Number of Groups: 15 +S> plot( fm1PBIB, resid(.) ~ fitted(.) | Block ) +S> plot( fm1PBIB, resid(.) ~ fitted(.) | Treatment, inner = ~ Block ) +Error in panel.xyplot(x, y, inner = struct..: Can't pass data of + mode "call" to old-S function +Dumped +S> fm1RPBIB <- update( fm1PBIB, method = "REML" ) +S> summary( fm1RPBIB ) # compare with output 1.7 pp. 24-25 +Linear mixed-effects model fit by REML + Data: PBIB + AIC BIC logLik + 85.985 116.7 -25.992 + +Random effects: + Formula: ~ 1 | Block + (Intercept) Residual +StdDev: 0.21569 0.2925 + +Fixed effects: response ~ Treatment + Value Std.Error DF t-value p-value +(Intercept) 2.8592 0.16641 31 17.182 <.0001 + Treatment1 -0.0417 0.22206 31 -0.188 0.8522 + Treatment2 -0.4539 0.22206 31 -2.044 0.0495 + Treatment3 -0.4043 0.22206 31 -1.821 0.0783 + Treatment4 -0.0754 0.22206 31 -0.340 0.7365 + Treatment5 -0.0543 0.22720 31 -0.239 0.8126 + Treatment6 0.0515 0.22206 31 0.232 0.8183 + Treatment7 -0.0702 0.22206 31 -0.316 0.7539 + Treatment8 -0.0776 0.22206 31 -0.350 0.7290 + Treatment9 0.0321 0.22206 31 0.144 0.8861 +Treatment10 -0.3682 0.22720 31 -1.620 0.1153 +Treatment11 0.0395 0.22206 31 0.178 0.8601 +Treatment12 0.1936 0.22206 31 0.872 0.3900 +Treatment13 -0.2415 0.22206 31 -1.087 0.2853 +Treatment14 -0.3679 0.22206 31 -1.657 0.1076 + Correlation: + (Intr) Trtmn1 Trtmn2 Trtmn3 Trtmn4 Trtmn5 Trtmn6 + Treatment1 -0.667 + Treatment2 -0.667 0.500 + Treatment3 -0.667 0.500 0.500 + Treatment4 -0.667 0.500 0.500 0.500 + Treatment5 -0.683 0.512 0.512 0.512 0.512 + Treatment6 -0.667 0.477 0.500 0.500 0.500 0.512 + Treatment7 -0.667 0.500 0.477 0.500 0.500 0.512 0.500 + Treatment8 -0.667 0.500 0.500 0.477 0.500 0.512 0.500 + Treatment9 -0.667 0.500 0.500 0.500 0.477 0.512 0.500 +Treatment10 -0.683 0.512 0.512 0.512 0.512 0.500 0.512 +Treatment11 -0.667 0.477 0.500 0.500 0.500 0.512 0.477 +Treatment12 -0.667 0.500 0.477 0.500 0.500 0.512 0.500 +Treatment13 -0.667 0.500 0.500 0.477 0.500 0.512 0.500 +Treatment14 -0.667 0.500 0.500 0.500 0.477 0.512 0.500 + Trtmn7 Trtmn8 Trtmn9 Trtm10 Trtm11 Trtm12 Trtm13 + Treatment1 + Treatment2 + Treatment3 + Treatment4 + Treatment5 + Treatment6 + Treatment7 + Treatment8 0.500 + Treatment9 0.500 0.500 +Treatment10 0.512 0.512 0.512 +Treatment11 0.500 0.500 0.500 0.512 +Treatment12 0.477 0.500 0.500 0.512 0.500 +Treatment13 0.500 0.477 0.500 0.512 0.500 0.500 +Treatment14 0.500 0.500 0.477 0.512 0.500 0.500 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.5247 -0.45435 -0.013268 0.42568 2.7443 + +Number of Observations: 60 +Number of Groups: 15 +S> ## Testing for significant fixed effects for Treatment involved re-fitting +S> ## the ML fit and comparing with anova(). +S> fm2PBIB <- update( fm1PBIB, response ~ 1 ) +S> anova( fm1PBIB, fm2PBIB ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1PBIB 1 17 56.571 92.174 -11.285 +fm2PBIB 2 3 52.152 58.435 -23.076 1 vs 2 23.581 0.0514 +S> ## The p-value is considerably smaller than that for the F test in PROC MIXED diff --git a/transcripts/PBIB.q b/transcripts/PBIB.q new file mode 100644 index 0000000..0575a76 --- /dev/null +++ b/transcripts/PBIB.q @@ -0,0 +1,18 @@ +### $Id: PBIB.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the partially balanced incomplete blocked PBIB data +options( contrasts = c(factor = "contr.SAS", ordered = "contr.poly") ) +formula( PBIB ) +names( PBIB ) +sapply( PBIB, data.class ) +fm1PBIB <- lme( response ~ Treatment, data = PBIB, random = ~ 1 | Block, + method = "ML") +summary( fm1PBIB ) +plot( fm1PBIB, resid(.) ~ fitted(.) | Block ) +plot( fm1PBIB, resid(.) ~ fitted(.) | Treatment, inner = ~ Block ) +fm1RPBIB <- update( fm1PBIB, method = "REML" ) +summary( fm1RPBIB ) # compare with output 1.7 pp. 24-25 +## Testing for significant fixed effects for Treatment involved re-fitting +## the ML fit and comparing with anova(). +fm2PBIB <- update( fm1PBIB, response ~ 1 ) +anova( fm1PBIB, fm2PBIB ) +## The p-value is considerably smaller than that for the F test in PROC MIXED diff --git a/transcripts/README b/transcripts/README new file mode 100644 index 0000000..437dfa6 --- /dev/null +++ b/transcripts/README @@ -0,0 +1,45 @@ +## $Id: README,v 1.1 1999/10/13 00:50:09 saikat Exp $ + + Transcripts of lme analyses of examples from + "SAS System for Mixed Models" + + Douglas Bates + Dept. of Statistics, U. of Wisconsin-Madison + + Jose C. Pinheiro + Bell Labs, Lucent Technologies + +This directory contains transcripts of analyses of some of the +examples from the book "SAS System for Mixed Models" by Littell, +Milliken, Stroup, and Wolfinger (SAS Institute, 1996). These +alternate analyses were done in S-PLUS 3.4 using version 3.0 of the +nlme library. They primarily use the lme function for fitting linear +mixed effects models. + +For each example there is a file with a .St extension which is an +S-transcript file. Another file with a .q extension contains the +commands and comments only. If you have the data files available as S +objects in the directory ../data/.Data, you should be able to +reproduce the HR.St transcript, for example, by defining a .First +function so that the NLME/.Data and the SAS_Mixed/.Data directories +get attached and so that the NLME/NLME.so shared object gets +dyn.loaded. We also use a setting for the options of + options( width = 65, length = 10000, digits = 5, prompt = "S> " ) + +Then + Splus BATCH HR.q HR.out +should produce a file HR.out similar to the HR.St file. The graphics +will be in a file with a name like ps.out.0001.ps + +An alternative, if you use ESS (Emacs Speaks Statistics) within the +emacs editor is to start an Splus process, attach the appropriate +directories, dyn.load the shared object and set the options then find +the .q file and used C-c C-n to step through the file sending the +commands to the S-PLUS process. Of course this can also be done in +ESS by finding the transcript file itself then using C-m in the +transcript file. ESS is available from + http://franz.stat.wisc.edu/pub/ESS + + + + diff --git a/transcripts/SIMS.St b/transcripts/SIMS.St new file mode 100644 index 0000000..a70576c --- /dev/null +++ b/transcripts/SIMS.St @@ -0,0 +1,67 @@ +S> ### $Id: SIMS.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the Second International Mathematics Study (SIMS) +S> ### described in section 7.2 of "SAS System for Mixed Models" +S> plot(SIMS, layout = c(10, 10, 2) ) # high level of variability within classes +S> ## to record the execution time for comparison the fit was done as +S> ## unix.time(assign("fm1RSIMS", lme(Gain ~ Pretot, SIMS, ~ Pretot | Class, REML = TRUE, control = list(msVerbose = TRUE)))) +S> ## Since unix.time is not available on Windows, we give the equivalent +S> ## statement here +S> fm1RSIMS <- lme(Gain ~ Pretot, data = SIMS, ++ random = ~ Pretot | Class, control = list(msVerbose = TRUE)) +Iteration: 0 , 1 function calls, F= 21105 +Parameters: +[1] 0.205678 0.066285 4.012905 +Iteration: 1 , 2 function calls, F= 21105 +Parameters: +[1] 0.213001 0.064138 4.126911 +Iteration: 2 , 3 function calls, F= 21105 +Parameters: +[1] 0.215042 0.063723 4.156579 +S> ## Timing done on an UltraSPARC 2 running S-PLUS 3.4 for Solaris. +S> ## Your mileage may vary. +S> summary(fm1RSIMS) # compare to output 7.4, p. 262 +Linear mixed-effects model fit by REML + Data: SIMS + AIC BIC logLik + 22393 22430 -11190 + +Random effects: + Formula: ~ Pretot | Class + Structure: General positive-definite + StdDev Corr +(Intercept) 3.806502 (Inter + Pretot 0.095932 -0.641 + Residual 4.715480 + +Fixed effects: Gain ~ Pretot + Value Std.Error DF t-value p-value +(Intercept) 7.0596 0.3659 3500 19.294 <.0001 + Pretot -0.1860 0.0161 3500 -11.556 <.0001 + Correlation: + (Intr) +Pretot -0.76 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -5.3776 -0.59554 0.0098766 0.64099 3.7183 + +Number of Observations: 3691 +Number of Groups: 190 +S> intervals( fm1RSIMS ) +Approximate 95% confidence intervals + + Fixed effects: + lower est. upper +(Intercept) 6.3422 7.05961 7.77700 + Pretot -0.2176 -0.18603 -0.15447 + + Random Effects: + Level: Class + lower est. upper + sd((Intercept)) 3.172870 3.806502 4.56667 + sd(Pretot) 0.056691 0.095932 0.16233 +cor((Intercept),Pretot) -0.834252 -0.640782 -0.30683 + + Within-group standard error: + lower est. upper + 4.6022 4.7155 4.8316 diff --git a/transcripts/SIMS.q b/transcripts/SIMS.q new file mode 100644 index 0000000..fc8f58e --- /dev/null +++ b/transcripts/SIMS.q @@ -0,0 +1,14 @@ +### $Id: SIMS.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Second International Mathematics Study (SIMS) +### described in section 7.2 of "SAS System for Mixed Models" +plot(SIMS, layout = c(10, 10, 2) ) # high level of variability within classes +## to record the execution time for comparison the fit was done as +## unix.time(assign("fm1RSIMS", lme(Gain ~ Pretot, SIMS, ~ Pretot | Class, REML = TRUE, control = list(msVerbose = TRUE)))) +## Since unix.time is not available on Windows, we give the equivalent +## statement here +fm1RSIMS <- lme(Gain ~ Pretot, data = SIMS, + random = ~ Pretot | Class, control = list(msVerbose = TRUE)) +## Timing done on an UltraSPARC 2 running S-PLUS 3.4 for Solaris. +## Your mileage may vary. +summary(fm1RSIMS) # compare to output 7.4, p. 262 +intervals( fm1RSIMS ) diff --git a/transcripts/Semi2.St b/transcripts/Semi2.St new file mode 100644 index 0000000..01c5c00 --- /dev/null +++ b/transcripts/Semi2.St @@ -0,0 +1,174 @@ +S> ### $Id: Semi2.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the Oxide layer thickness data given as data set 4.4 in +S> ### "SAS System for Mixed Models" +S> options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +S> formula(Semi2) +Thickness ~ 1 | Lot/Wafer +S> plot(Semi2) +S> fm1Semi2 <- lme( Thickness ~ 1, data = Semi2, ++ random = ~ 1 | Lot/Wafer, method = "ML" ) +S> summary( fm1Semi2 ) +Linear mixed-effects model fit by maximum likelihood + Data: Semi2 + AIC BIC logLik + 466.68 475.78 -229.34 + +Random effects: + Formula: ~ 1 | Lot + (Intercept) +StdDev: 10.583 + + Formula: ~ 1 | Wafer %in% Lot + (Intercept) Residual +StdDev: 5.9888 3.5453 + +Fixed effects: Thickness ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 2000.2 3.9862 48 501.77 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.8688 -0.49906 0.10125 0.54825 1.798 + +Number of Observations: 72 +Number of Groups: + Lot Wafer %in% Lot + 8 24 +S> fm1RSemi2 <- update( fm1Semi2, method = "REML" ) +S> summary( fm1RSemi2 ) # compare with output 4.13, p. 156 +Linear mixed-effects model fit by REML + Data: Semi2 + AIC BIC logLik + 462.02 471.07 -227.01 + +Random effects: + Formula: ~ 1 | Lot + (Intercept) +StdDev: 11.398 + + Formula: ~ 1 | Wafer %in% Lot + (Intercept) Residual +StdDev: 5.9888 3.5453 + +Fixed effects: Thickness ~ 1 + Value Std.Error DF t-value p-value +(Intercept) 2000.2 4.2317 48 472.66 <.0001 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.8746 -0.49908 0.10465 0.55102 1.7922 + +Number of Observations: 72 +Number of Groups: + Lot Wafer %in% Lot + 8 24 +S> fm2Semi2 <- update( fm1Semi2, Thickness ~ Source ) +S> anova( fm1Semi2, fm2Semi2 ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Semi2 1 4 466.68 475.78 -229.34 +fm2Semi2 2 5 466.86 478.25 -228.43 1 vs 2 1.813 0.1782 +S> ## Again, the p-value is smaller than that for the F test. +S> fm2RSemi2 <- update( fm2Semi2, method = "REML" ) +S> summary( fm2RSemi2 ) # compare with output 4.15, p. 159 +Linear mixed-effects model fit by REML + Data: Semi2 + AIC BIC logLik + 456.48 467.72 -223.24 + +Random effects: + Formula: ~ 1 | Lot + (Intercept) +StdDev: 10.95 + + Formula: ~ 1 | Wafer %in% Lot + (Intercept) Residual +StdDev: 5.9888 3.5453 + +Fixed effects: Thickness ~ Source + Value Std.Error DF t-value p-value +(Intercept) 2005.2 5.7716 48 347.43 <.0001 + Source -10.1 8.1622 6 -1.24 0.2629 + Correlation: + (Intr) +Source -0.707 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.8864 -0.51397 0.11776 0.53466 1.7804 + +Number of Observations: 72 +Number of Groups: + Lot Wafer %in% Lot + 8 24 +S> fm3Semi2 <- update( fm2Semi2, ++ random = list(Lot = pdDiag( ~ Source - 1 ), Wafer = ~ 1 ) ) +S> summary( fm3Semi2 ) +Linear mixed-effects model fit by maximum likelihood + Data: Semi2 + AIC BIC logLik + 465.24 478.9 -226.62 + +Random effects: + Formula: ~ Source - 1 | Lot + Structure: Diagonal + Source1 Source2 +StdDev: 3.0745 12.794 + + Formula: ~ 1 | Wafer %in% Lot + (Intercept) Residual +StdDev: 5.9891 3.5454 + +Fixed effects: Thickness ~ Source + Value Std.Error DF t-value p-value +(Intercept) 2005.2 6.7474 48 297.18 <.0001 + Source -10.1 7.1688 6 -1.41 0.2092 + Correlation: + (Intr) +Source -0.941 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.8936 -0.55242 0.079282 0.575 1.7732 + +Number of Observations: 72 +Number of Groups: + Lot Wafer %in% Lot + 8 24 +S> fm3RSemi2 <- update( fm3Semi2, method = "REML" ) +S> summary( fm3RSemi2 ) # compare with output 4.17, p. 163 +Linear mixed-effects model fit by REML + Data: Semi2 + AIC BIC logLik + 455.76 469.25 -221.88 + +Random effects: + Formula: ~ Source - 1 | Lot + Structure: Diagonal + Source1 Source2 +StdDev: 4.1318 14.923 + + Formula: ~ 1 | Wafer %in% Lot + (Intercept) Residual +StdDev: 5.9889 3.5453 + +Fixed effects: Thickness ~ Source + Value Std.Error DF t-value p-value +(Intercept) 2005.2 7.6821 48 261.02 <.0001 + Source -10.1 8.1622 6 -1.24 0.2629 + Correlation: + (Intr) +Source -0.941 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.8991 -0.53091 0.081684 0.55722 1.7677 + +Number of Observations: 72 +Number of Groups: + Lot Wafer %in% Lot + 8 24 +S> anova( fm1Semi2, fm2Semi2, fm3Semi2 ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Semi2 1 4 466.68 475.78 -229.34 +fm2Semi2 2 5 466.86 478.25 -228.43 1 vs 2 1.8130 0.1782 +fm3Semi2 3 6 465.24 478.90 -226.62 2 vs 3 3.6197 0.0571 diff --git a/transcripts/Semi2.q b/transcripts/Semi2.q new file mode 100644 index 0000000..c2153b4 --- /dev/null +++ b/transcripts/Semi2.q @@ -0,0 +1,22 @@ +### $Id: Semi2.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Oxide layer thickness data given as data set 4.4 in +### "SAS System for Mixed Models" +options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +formula(Semi2) +plot(Semi2) +fm1Semi2 <- lme( Thickness ~ 1, data = Semi2, + random = ~ 1 | Lot/Wafer, method = "ML" ) +summary( fm1Semi2 ) +fm1RSemi2 <- update( fm1Semi2, method = "REML" ) +summary( fm1RSemi2 ) # compare with output 4.13, p. 156 +fm2Semi2 <- update( fm1Semi2, Thickness ~ Source ) +anova( fm1Semi2, fm2Semi2 ) +## Again, the p-value is smaller than that for the F test. +fm2RSemi2 <- update( fm2Semi2, method = "REML" ) +summary( fm2RSemi2 ) # compare with output 4.15, p. 159 +fm3Semi2 <- update( fm2Semi2, + random = list(Lot = pdDiag( ~ Source - 1 ), Wafer = ~ 1 ) ) +summary( fm3Semi2 ) +fm3RSemi2 <- update( fm3Semi2, method = "REML" ) +summary( fm3RSemi2 ) # compare with output 4.17, p. 163 +anova( fm1Semi2, fm2Semi2, fm3Semi2 ) diff --git a/transcripts/Semiconductor.St b/transcripts/Semiconductor.St new file mode 100644 index 0000000..3b8295c --- /dev/null +++ b/transcripts/Semiconductor.St @@ -0,0 +1,117 @@ +S> ### Analysis of the Semiconductor split-plot experiment, section 2.3 of +S> ### "SAS System for Mixed Models" +S> options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +S> formula( Semiconductor ) +resistance ~ 1 | Grp +S> plot( Semiconductor ) +S> names( Semiconductor ) +[1] "resistance" "ET" "Wafer" "position" "Grp" +S> plot( Semiconductor, inner = ~ position ) +S> fm1Semi <- lme( resistance ~ ET * position, ++ data = Semiconductor, ++ random = ~ 1 | Grp, method = "ML" ) +S> summary( fm1Semi ) +Linear mixed-effects model fit by maximum likelihood + Data: Semiconductor + AIC BIC logLik + 66.147 99.828 -15.073 + +Random effects: + Formula: ~ 1 | Grp + (Intercept) Residual +StdDev: 0.26557 0.27221 + +Fixed effects: resistance ~ ET * position + Value Std.Error DF t-value p-value + (Intercept) 6.5400 0.26891 24 24.320 <.0001 + ET1 -0.6533 0.38030 8 -1.718 0.1241 + ET2 -0.6233 0.38030 8 -1.639 0.1398 + ET3 -0.4467 0.38030 8 -1.175 0.2740 + position1 -0.2000 0.27221 24 -0.735 0.4696 + position2 0.0133 0.27221 24 0.049 0.9613 + position3 -0.6433 0.27221 24 -2.363 0.0266 +ET1position1 -0.0733 0.38497 24 -0.190 0.8505 +ET2position1 0.2767 0.38497 24 0.719 0.4793 +ET3position1 0.2433 0.38497 24 0.632 0.5333 +ET1position2 -0.4500 0.38497 24 -1.169 0.2539 +ET2position2 0.2567 0.38497 24 0.667 0.5113 +ET3position2 0.2400 0.38497 24 0.623 0.5389 +ET1position3 0.3100 0.38497 24 0.805 0.4286 +ET2position3 0.4933 0.38497 24 1.281 0.2123 +ET3position3 0.3233 0.38497 24 0.840 0.4093 + Correlation: + (Intr) ET1 ET2 ET3 postn1 postn2 postn3 + ET1 -0.707 + ET2 -0.707 0.500 + ET3 -0.707 0.500 0.500 + position1 -0.506 0.358 0.358 0.358 + position2 -0.506 0.358 0.358 0.358 0.500 + position3 -0.506 0.358 0.358 0.358 0.500 0.500 +ET1position1 0.358 -0.506 -0.253 -0.253 -0.707 -0.354 -0.354 +ET2position1 0.358 -0.253 -0.506 -0.253 -0.707 -0.354 -0.354 +ET3position1 0.358 -0.253 -0.253 -0.506 -0.707 -0.354 -0.354 +ET1position2 0.358 -0.506 -0.253 -0.253 -0.354 -0.707 -0.354 +ET2position2 0.358 -0.253 -0.506 -0.253 -0.354 -0.707 -0.354 +ET3position2 0.358 -0.253 -0.253 -0.506 -0.354 -0.707 -0.354 +ET1position3 0.358 -0.506 -0.253 -0.253 -0.354 -0.354 -0.707 +ET2position3 0.358 -0.253 -0.506 -0.253 -0.354 -0.354 -0.707 +ET3position3 0.358 -0.253 -0.253 -0.506 -0.354 -0.354 -0.707 + ET1ps1 ET2ps1 ET3ps1 ET1ps2 ET2ps2 ET3ps2 ET1ps3 + ET1 + ET2 + ET3 + position1 + position2 + position3 +ET1position1 +ET2position1 0.500 +ET3position1 0.500 0.500 +ET1position2 0.500 0.250 0.250 +ET2position2 0.250 0.500 0.250 0.500 +ET3position2 0.250 0.250 0.500 0.500 0.500 +ET1position3 0.500 0.250 0.250 0.500 0.250 0.250 +ET2position3 0.250 0.500 0.250 0.250 0.500 0.250 0.500 +ET3position3 0.250 0.250 0.500 0.250 0.250 0.500 0.500 + ET2ps3 + ET1 + ET2 + ET3 + position1 + position2 + position3 +ET1position1 +ET2position1 +ET3position1 +ET1position2 +ET2position2 +ET3position2 +ET1position3 +ET2position3 +ET3position3 0.500 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.3406 -0.5624 0.0126 0.57402 1.6062 + +Number of Observations: 48 +Number of Groups: 12 +S> ## check significance of the interaction +S> fm2Semi <- update( fm1Semi, resistance ~ ET + position ) +S> fm3Semi <- update( fm1Semi, resistance ~ ET ) +S> fm4Semi <- update( fm1Semi, resistance ~ position ) +S> fm5Semi <- update( fm1Semi, resistance ~ 1 ) +S> anova( fm5Semi, fm4Semi, fm2Semi, fm1Semi ) + Model df AIC BIC logLik Test L.Ratio p-value +fm5Semi 1 3 62.373 67.987 -28.187 +fm4Semi 2 6 58.251 69.479 -23.126 1 vs 2 10.122 0.0176 +fm2Semi 3 9 57.687 74.528 -19.844 2 vs 3 6.564 0.0872 +fm1Semi 4 18 66.147 99.828 -15.073 3 vs 4 9.540 0.3889 +S> anova( fm5Semi, fm3Semi, fm2Semi, fm1Semi ) + Model df AIC BIC logLik Test L.Ratio p-value +fm5Semi 1 3 62.373 67.987 -28.187 +fm3Semi 2 6 61.809 73.036 -24.905 1 vs 2 6.564 0.0872 +fm2Semi 3 9 57.687 74.528 -19.844 2 vs 3 10.122 0.0176 +fm1Semi 4 18 66.147 99.828 -15.073 3 vs 4 9.540 0.3889 +S> ## AIC favors resistance ~ ET + position +S> ## BIC favors resistance ~ 1 +S> ## Likelihood ratio seems to favor resistance ~ position diff --git a/transcripts/Semiconductor.q b/transcripts/Semiconductor.q new file mode 100644 index 0000000..1dbfbb4 --- /dev/null +++ b/transcripts/Semiconductor.q @@ -0,0 +1,23 @@ +### $Id: Semiconductor.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the Semiconductor split-plot experiment, section 2.3 of +### "SAS System for Mixed Models" +options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +formula( Semiconductor ) +plot( Semiconductor ) +names( Semiconductor ) +plot( Semiconductor, inner = ~ position ) +fm1Semi <- lme( resistance ~ ET * position, + data = Semiconductor, + random = ~ 1 | Grp, method = "ML" ) +summary( fm1Semi ) +## check significance of the interaction +fm2Semi <- update( fm1Semi, resistance ~ ET + position ) +fm3Semi <- update( fm1Semi, resistance ~ ET ) +fm4Semi <- update( fm1Semi, resistance ~ position ) +fm5Semi <- update( fm1Semi, resistance ~ 1 ) +anova( fm5Semi, fm4Semi, fm2Semi, fm1Semi ) +anova( fm5Semi, fm3Semi, fm2Semi, fm1Semi ) +## AIC favors resistance ~ ET + position +## BIC favors resistance ~ 1 +## Likelihood ratio seems to favor resistance ~ position + diff --git a/transcripts/Weights.St b/transcripts/Weights.St new file mode 100644 index 0000000..1be4c22 --- /dev/null +++ b/transcripts/Weights.St @@ -0,0 +1,217 @@ +S> ### $Id: Weights.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### $Id: Weights.St,v 1.1 1999/10/13 00:50:09 saikat Exp $ +S> ### Analysis of the weight-lifting program data given as data set 3.2(a) +S> ### in "SAS System for Mixed Models" +S> options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +S> plot(Weights, layout = c(21,3), skip = rep(c(F,T,F,T,F),c(20,1,16,5,21))) +S> fm1Weight <- ++ lme( strength ~ Program * Time, data = Weights, random = ~ 1 | Subj, ++ method = "ML" ) +S> summary( fm1Weight ) +Linear mixed-effects model fit by maximum likelihood + Data: Weights + AIC BIC logLik + 1441.9 1473.8 -712.93 + +Random effects: + Formula: ~ 1 | Subj + (Intercept) Residual +StdDev: 3.0152 1.085 + +Fixed effects: strength ~ Program * Time + Value Std.Error DF t-value p-value + (Intercept) 81.105 0.6874 339 117.98 <.0001 + ProgramCONT -1.115 0.9843 54 -1.13 0.2622 + ProgramRI -1.045 1.0454 54 -1.00 0.3219 + Time 0.160 0.0225 339 7.09 <.0001 +ProgramCONTTime -0.184 0.0323 339 -5.70 <.0001 + ProgramRITime -0.055 0.0343 339 -1.60 0.1098 + Correlation: + (Intr) PrCONT PrgrRI Time PCONTT + ProgramCONT -0.698 + ProgramRI -0.658 0.459 + Time -0.230 0.160 0.151 +ProgramCONTTime 0.160 -0.230 -0.105 -0.698 + ProgramRITime 0.151 -0.105 -0.230 -0.658 0.459 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -3.1292 -0.61237 0.037615 0.63314 3.3469 + +Number of Observations: 399 +Number of Groups: 57 +S> summary( update( fm1Weight, method = "REML" ) ) # compare with output 3.1, p. 91 +Linear mixed-effects model fit by REML + Data: Weights + AIC BIC logLik + 1455.4 1487.2 -719.68 + +Random effects: + Formula: ~ 1 | Subj + (Intercept) Residual +StdDev: 3.0991 1.0897 + +Fixed effects: strength ~ Program * Time + Value Std.Error DF t-value p-value + (Intercept) 81.105 0.7001 339 115.84 <.0001 + ProgramCONT -1.115 1.0024 54 -1.11 0.2708 + ProgramRI -1.045 1.0647 54 -0.98 0.3306 + Time 0.160 0.0225 339 7.11 <.0001 +ProgramCONTTime -0.184 0.0322 339 -5.72 <.0001 + ProgramRITime -0.055 0.0342 339 -1.61 0.1087 + Correlation: + (Intr) PrCONT PrgrRI Time PCONTT + ProgramCONT -0.698 + ProgramRI -0.658 0.459 + Time -0.225 0.157 0.148 +ProgramCONTTime 0.157 -0.225 -0.103 -0.698 + ProgramRITime 0.148 -0.103 -0.225 -0.658 0.459 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -3.1167 -0.60963 0.039635 0.63075 3.3352 + +Number of Observations: 399 +Number of Groups: 57 +S> c( 3.0991, 1.0897 )^2 +[1] 9.6044 1.1874 +S> fm2Weight <- update( fm1Weight, random = ~ Time | Subj ) +S> anova( fm1Weight, fm2Weight ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Weight 1 8 1441.9 1473.8 -712.93 +fm2Weight 2 10 1333.4 1373.2 -656.68 1 vs 2 112.52 <.0001 +S> plot(augPred( fm2Weight ), layout = c(21,3), ++ skip = rep(c(F,T,F,T,F),c(20,1,16,5,21))) +S> summary( fm2Weight ) +Linear mixed-effects model fit by maximum likelihood + Data: Weights + AIC BIC logLik + 1333.4 1373.2 -656.68 + +Random effects: + Formula: ~ Time | Subj + Structure: General positive-definite + StdDev Corr +(Intercept) 2.92292 (Inter + Time 0.17074 -0.115 + Residual 0.79559 + +Fixed effects: strength ~ Program * Time + Value Std.Error DF t-value p-value + (Intercept) 81.105 0.65635 339 123.57 <.0001 + ProgramCONT -1.115 0.93976 54 -1.19 0.2405 + ProgramRI -1.045 0.99811 54 -1.05 0.2997 + Time 0.160 0.04102 339 3.90 0.0001 +ProgramCONTTime -0.184 0.05873 339 -3.13 0.0019 + ProgramRITime -0.055 0.06238 339 -0.88 0.3790 + Correlation: + (Intr) PrCONT PrgrRI Time PCONTT + ProgramCONT -0.698 + ProgramRI -0.658 0.459 + Time -0.174 0.122 0.114 +ProgramCONTTime 0.122 -0.174 -0.080 -0.698 + ProgramRITime 0.114 -0.080 -0.174 -0.658 0.459 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -2.7527 -0.6483 -0.010436 0.57345 3.4828 + +Number of Observations: 399 +Number of Groups: 57 +S> fm3Weight <- update( fm2Weight, correlation = corAR1()) +S> anova( fm2Weight, fm3Weight ) + Model df AIC BIC logLik Test L.Ratio p-value +fm2Weight 1 10 1333.4 1373.2 -656.68 +fm3Weight 2 11 1284.2 1328.1 -631.12 1 vs 2 51.112 <.0001 +S> fm4Weight <- update( fm3Weight, strength ~ Program * (Time + I(Time^2)), ++ random = ~Time|Subj) +S> anova( fm1Weight, fm2Weight, fm3Weight, fm4Weight ) + Model df AIC BIC logLik Test L.Ratio p-value +fm1Weight 1 8 1441.9 1473.8 -712.93 +fm2Weight 2 10 1333.4 1373.2 -656.68 1 vs 2 112.52 <.0001 +fm3Weight 3 11 1284.2 1328.1 -631.12 2 vs 3 51.11 <.0001 +fm4Weight 4 14 1281.1 1336.9 -626.53 3 vs 4 9.18 0.027 +S> summary( fm4Weight ) +Linear mixed-effects model fit by maximum likelihood + Data: Weights + AIC BIC logLik + 1281.1 1336.9 -626.53 + +Random effects: + Formula: ~ Time | Subj + Structure: General positive-definite + StdDev Corr +(Intercept) 2.441731 (Inter + Time 0.081467 0.525 + Residual 1.516788 + +Correlation Structure: AR(1) + Parameter estimate(s): + Phi + 0.78658 +Fixed effects: strength ~ Program + Time + I(Time^2) + Program:Time + Program:I( Time^2) + Value Std.Error DF t-value p-value + (Intercept) 80.787 0.6601 336 122.38 <.0001 + ProgramCONT -1.109 0.9451 54 -1.17 0.2456 + ProgramRI -1.455 1.0038 54 -1.45 0.1530 + Time 0.277 0.0991 336 2.80 0.0055 + I(Time^2) -0.008 0.0065 336 -1.19 0.2366 + ProgramCONTTime -0.188 0.1419 336 -1.32 0.1864 + ProgramRITime 0.111 0.1507 336 0.74 0.4606 +ProgramCONTI(Time^2) 0.000 0.0093 336 0.04 0.9718 + ProgramRII(Time^2) -0.012 0.0099 336 -1.17 0.2413 + Correlation: + (Intr) PrCONT PrgrRI Time I(T^2) PCONTT + ProgramCONT -0.698 + ProgramRI -0.658 0.459 + Time -0.255 0.178 0.168 + I(Time^2) 0.224 -0.157 -0.148 -0.920 + ProgramCONTTime 0.178 -0.255 -0.117 -0.698 0.643 + ProgramRITime 0.168 -0.117 -0.255 -0.658 0.605 0.459 +ProgramCONTI(Time^2) -0.157 0.224 0.103 0.643 -0.698 -0.920 + ProgramRII(Time^2) -0.148 0.103 0.224 0.605 -0.658 -0.423 + PrgRIT PCONTI(T^2) + ProgramCONT + ProgramRI + Time + I(Time^2) + ProgramCONTTime + ProgramRITime +ProgramCONTI(Time^2) -0.423 + ProgramRII(Time^2) -0.920 0.459 + +Standardized Within-Group Residuals: + Min Q1 Med Q3 Max + -1.7367 -0.49145 -0.045068 0.47571 2.3992 + +Number of Observations: 399 +Number of Groups: 57 +S> intervals( fm4Weight ) +Approximate 95% confidence intervals + + Fixed effects: + lower est. upper + (Intercept) 79.502852 80.7865923 82.0703328 + ProgramCONT -2.982768 -1.1093822 0.7640032 + ProgramRI -3.444677 -1.4549607 0.5347552 + Time 0.084490 0.2772186 0.4699476 + I(Time^2) -0.020387 -0.0077219 0.0049433 + ProgramCONTTime -0.463819 -0.1878731 0.0880728 + ProgramRITime -0.181751 0.1113306 0.4044118 +ProgramCONTI(Time^2) -0.017804 0.0003300 0.0184639 + ProgramRII(Time^2) -0.030885 -0.0116254 0.0076346 + + Random Effects: + Level: Subj + lower est. upper + sd((Intercept)) 1.2718625 2.441731 4.6877 + sd(Time) 0.0048644 0.081467 1.3644 +cor((Intercept),Time) -0.9989554 0.524765 0.9999 + + Correlation structure: + lower est. upper +Phi -0.32307 0.78658 0.9855 + + Within-group standard error: + lower est. upper + 0.40432 1.5168 5.6901 diff --git a/transcripts/Weights.q b/transcripts/Weights.q new file mode 100644 index 0000000..972dbe2 --- /dev/null +++ b/transcripts/Weights.q @@ -0,0 +1,24 @@ +### $Id: Weights.q,v 1.1 1999/10/13 00:50:09 saikat Exp $ +### Analysis of the weight-lifting program data given as data set 3.2(a) +### in "SAS System for Mixed Models" +options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly")) +plot(Weights, layout = c(21,3), skip = rep(c(F,T,F,T,F),c(20,1,16,5,21))) +fm1Weight <- + lme( strength ~ Program * Time, data = Weights, random = ~ 1 | Subj, + method = "ML" ) +summary( fm1Weight ) +summary( update( fm1Weight, method = "REML" ) ) # compare with output 3.1, p. 91 +c( 3.0991, 1.0897 )^2 +fm2Weight <- update( fm1Weight, random = ~ Time | Subj ) +anova( fm1Weight, fm2Weight ) +plot(augPred( fm2Weight ), layout = c(21,3), + skip = rep(c(F,T,F,T,F),c(20,1,16,5,21))) +summary( fm2Weight ) +fm3Weight <- update( fm2Weight, correlation = corAR1()) +anova( fm2Weight, fm3Weight ) +fm4Weight <- update( fm3Weight, strength ~ Program * (Time + I(Time^2)), + random = ~Time|Subj) +anova( fm1Weight, fm2Weight, fm3Weight, fm4Weight ) +summary( fm4Weight ) +intervals( fm4Weight ) +