Skip to content

Commit

Permalink
version 1.0-0
Browse files Browse the repository at this point in the history
  • Loading branch information
lme4-authors authored and gaborcsardi committed Feb 15, 2011
1 parent 3b3391c commit a4e3597
Show file tree
Hide file tree
Showing 28 changed files with 63 additions and 56 deletions.
28 changes: 28 additions & 0 deletions ChangeLog
@@ -1,3 +1,31 @@
2011-02-15 Douglas Bates <bates@stat.wisc.edu>

* DESCRIPTION, data/Animal.rda, data/AvgDailyGain.rda, data/BIB.rda,
data/Bond.rda, data/Cultivation.rda, data/Demand.rda,
data/Genetics.rda, data/HR.rda, data/IncBlk.rda, data/Mississippi.rda,
data/Multilocation.rda, data/PBIB.rda, data/SIMS.rda, data/Semi2.rda,
data/Semiconductor.rda, data/TeachingI.rda, data/TeachingII.rda,
data/WWheat.rda, data/WaferTypes.rda, data/Weights.rda,
inst/doc/Usinglmer.pdf: Resave data sets for greater compression.
Rebuild vignette. New version and date.
* INDEX: Redundant.

2011-01-27 Douglas Bates <bates@stat.wisc.edu>

* man/Multilocation.Rd: Suppress printing of correlation matrices.

2010-02-27 mmaechler

* inst/doc/Usinglmer.Rnw: keep.source !

2009-10-26 Douglas Bates <bates@stat.wisc.edu>

* DESCRIPTION, inst/doc/Usinglmer.pdf: New release

2009-10-21 Douglas Bates <bates@stat.wisc.edu>

* inst/doc/Usinglmer.Rnw: Remove control arguments that are no longer
used in lmer.
2009-08-08 Douglas Bates <bates@stat.wisc.edu>

* [r401] DESCRIPTION, inst/doc/Usinglmer.Rnw, inst/doc/Usinglmer.pdf:
Expand Down
13 changes: 8 additions & 5 deletions DESCRIPTION
@@ -1,16 +1,19 @@
Package: SASmixed
Version: 0.5-1
Date: 2009-10-21
Version: 1.0-0
Date: 2011-02-15
Title: Data sets from "SAS System for Mixed Models"
Maintainer: Douglas Bates <bates@stat.wisc.edu>
Maintainer: <lme4-authors@R-forge.wu-wien.ac.at>
Author: Original by Littel, Milliken, Stroup, and Wolfinger
modifications by Douglas Bates <bates@stat.wisc.edu>
Description: Data sets and sample lmer analyses corresponding to the
examples in Littel, Milliken, Stroup and Wolfinger (1996), "SAS
System for Mixed Models", SAS Institute.
Depends: R (>= 2.10)
Suggests: lattice, lme4
LazyData: yes
License: GPL (>= 2)
Packaged: 2009-10-26 19:14:08 UTC; bates
Repository: CRAN
Date/Publication: 2009-10-26 20:51:35
Repository/R-Forge/Project: lme4
Repository/R-Forge/Revision: 1262
Date/Publication: 2011-02-17 13:06:52
Packaged: 2011-02-16 21:49:36 UTC; rforge
25 changes: 0 additions & 25 deletions INDEX

This file was deleted.

Binary file modified data/Animal.rda
Binary file not shown.
Binary file modified data/AvgDailyGain.rda
Binary file not shown.
Binary file modified data/BIB.rda
Binary file not shown.
Binary file modified data/Bond.rda
Binary file not shown.
Binary file modified data/Cultivation.rda
Binary file not shown.
Binary file modified data/Demand.rda
Binary file not shown.
Binary file modified data/Genetics.rda
Binary file not shown.
Binary file modified data/HR.rda
Binary file not shown.
Binary file modified data/IncBlk.rda
Binary file not shown.
Binary file modified data/Mississippi.rda
Binary file not shown.
Binary file modified data/Multilocation.rda
Binary file not shown.
Binary file modified data/PBIB.rda
Binary file not shown.
Binary file modified data/SIMS.rda
Binary file not shown.
Binary file modified data/Semi2.rda
Binary file not shown.
Binary file modified data/Semiconductor.rda
Binary file not shown.
Binary file modified data/TeachingI.rda
Binary file not shown.
Binary file modified data/TeachingII.rda
Binary file not shown.
Binary file modified data/WWheat.rda
Binary file not shown.
Binary file modified data/WaferTypes.rda
Binary file not shown.
Binary file modified data/Weights.rda
Binary file not shown.
49 changes: 25 additions & 24 deletions inst/doc/Usinglmer.Rnw
Expand Up @@ -19,6 +19,7 @@
%%\VignetteDepends{lattice}
\begin{document}
\SweaveOpts{engine=R,eps=FALSE,pdf=TRUE,width=5,height=3,strip.white=TRUE}
\SweaveOpts{keep.source=TRUE}
\SweaveOpts{prefix=TRUE,prefix.string=figs/f,include=FALSE}
\setkeys{Gin}{width=\textwidth}
\title{\textbf{\textsf{lmer} for \textsf{SAS PROC MIXED} Users}}
Expand All @@ -32,7 +33,7 @@ library(SASmixed)
library(lattice)
library(Matrix)
library(lme4)
@
@
\section{Introduction}
\label{sec:intro}

Expand Down Expand Up @@ -76,7 +77,7 @@ $\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
expression for the fixed effects and a linear model expression for the
random effects. In \code{SAS PROC MIXED} the fixed-effects part is
specified in the \code{model} statement and the random-effects
part in the \code{random} statement. In \code{lmer} the fixed effects
Expand Down Expand Up @@ -114,7 +115,7 @@ 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.
random effects.

We encourage developing and testing the model using likelihood ratio
tests or the \textsf{AIC} and \textsf{BIC} criteria. Once a form
Expand Down Expand Up @@ -166,7 +167,7 @@ animal <- within(read.table("animal.dat", header = TRUE),
})
\end{Sinput}
\end{Schunk}
In general it is a good idea to check the types of variables in a data
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
\code{sapply} function.
Expand All @@ -181,7 +182,7 @@ str(Animal)
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
\citet{litt:mill:stro:wolf:1996} where twelve wafers are
\citet{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 \code{1}, \code{2}, and
\code{3} but the wafer factor is only meaningful within the same level
Expand All @@ -205,17 +206,17 @@ or, equivalently
\end{Example}

In this case, however, there would not usually be any random effects
associated with the ``experimental treatment'' or \code{ET} factor. The
associated with the ``experimental treatment'' or \code{ET} factor. The
only random effects are at the \code{Wafer} level. It is necessary to
create a factor that will have unique levels for each \code{Wafer}
within each level of \code{ET}. One way to do this is to assign
<<semiconductorGrp>>=
Semiconductor <- within(Semiconductor, Grp <- factor(ET:Wafer))
@
@
after which we could specify a random effects term of \code{(1 |
Grp)}. Alternatively, we can use the explicit term
\begin{Example}
(1 | ET:Wafer)
(1 | ET:Wafer)
\end{Example}

\subsection{General approach}
Expand Down Expand Up @@ -247,9 +248,9 @@ 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
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
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
Expand All @@ -258,7 +259,7 @@ When in doubt, check which contrasts are being used with the
To make comparisons easier, you may find it worthwhile to declare
<<contrasts,echo=TRUE,eval=FALSE>>=
options(contrasts = c(factor = "contr.SAS", ordered = "contr.poly"))
@
@
at the beginning of your session.

\bibliography{Usinglmer}
Expand All @@ -272,7 +273,7 @@ print(xyplot(adg ~ Treatment | Block, AvgDailyGain, type = c("g", "p", "r"),
xlab = "Treatment (amount of feed additive)",
ylab = "Average daily weight gain (lb.)", aspect = "xy",
index.cond = function(x, y) coef(lm(y ~ x))[1]))
@
@
\begin{figure}[tbp]
\centering
\includegraphics{figs/f-adg1}
Expand All @@ -287,7 +288,7 @@ anova(fm1Adg) # checking significance of terms
(fm2Adg <- lmer(adg ~ InitWt + Treatment + (1 | Block), AvgDailyGain))
anova(fm2Adg)
(fm3Adg <- lmer(adg ~ InitWt + Treatment - 1 + (1 | Block), AvgDailyGain))
@
@


\section{BIB}
Expand All @@ -296,7 +297,7 @@ anova(fm2Adg)
print(xyplot(y ~ x | Block, BIB, groups = Treatment, type = c("g", "p"),
aspect = "xy", auto.key = list(points = TRUE, space = "right",
lines = FALSE)))
@
@
\begin{figure}[tbp]
\centering
\includegraphics{figs/f-bib1}
Expand All @@ -310,7 +311,7 @@ anova(fm1BIB) # strong evidence of different slopes
## compare with Output 5.9, p. 193
(fm2BIB <- lmer(y ~ Treatment + x:Grp + (1|Block), BIB))
anova(fm2BIB)
@
@


\section{Bond}
Expand All @@ -334,7 +335,7 @@ anova(fm1Cult)
anova(fm2Cult)
(fm3Cult <- lmer(drywt ~ Inoc + (1|Block) + (1|Cult), Cultivation))
anova(fm3Cult)
@
@



Expand All @@ -346,7 +347,7 @@ anova(fm3Cult)
(fm1Demand <-
lmer(log(d) ~ log(y) + log(rd) + log(rt) + log(rs) + (1|State) + (1|Year),
Demand))
@
@

\section{HR}
\label{sec:HR}
Expand All @@ -360,7 +361,7 @@ anova(fm3HR)
## remove Drug term
(fm4HR <- lmer(HR ~ Time + baseHR + (Time|Patient), HR))
anova(fm4HR)
@
@


\section{Mississippi}
Expand All @@ -377,7 +378,7 @@ VarCorr(fm1Miss) # compare to output 4.7, p. 148
## compare to output 4.8 and 4.9, pp. 150-152
(fm2Miss <- lmer(y ~ Type + (1 | influent), Mississippi))
anova(fm2Miss)
@
@

\section{Multilocation}
\label{sec:Multilocation}
Expand All @@ -401,11 +402,11 @@ anova(fm2Mult)
\section{PBIB}
\label{sec:PBIB}

<<PBIB>>=
<<PBIB>>=
str(PBIB)
## compare with output 1.7 pp. 24-25
(fm1PBIB <- lmer(response ~ Treatment + (1 | Block), PBIB))
@
@


\section{SIMS}
Expand All @@ -415,10 +416,10 @@ str(PBIB)
str(SIMS)
## compare to output 7.4, p. 262
(fm1SIMS <- lmer(Gain ~ Pretot + (Pretot | Class), SIMS))
@
@
\end{document}

%%% Local Variables:
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
%%% End:
Binary file modified inst/doc/Usinglmer.pdf
Binary file not shown.
Binary file modified inst/doc/figs/f-adg1.pdf
Binary file not shown.
Binary file modified inst/doc/figs/f-bib1.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions man/Multilocation.Rd
Expand Up @@ -52,8 +52,8 @@ if (require("lme4", quietly = TRUE, character = TRUE)) {
Multilocation$Grp <- with(Multilocation, Block:Location)
print(fm1Mult <- lmer(Adj ~ Location * Trt + (1|Grp), Multilocation))
print(anova(fm1Mult))
print(fm2Mult <- lmer(Adj ~ Location + Trt + (1|Grp), Multilocation))
print(fm3Mult <- lmer(Adj ~ Location + (1|Grp), Multilocation))
print(fm2Mult <- lmer(Adj ~ Location + Trt + (1|Grp), Multilocation), corr=FALSE)
print(fm3Mult <- lmer(Adj ~ Location + (1|Grp), Multilocation), corr=FALSE)
print(fm4Mult <- lmer(Adj ~ Trt + (1|Grp), Multilocation))
print(fm5Mult <- lmer(Adj ~ 1 + (1|Grp), Multilocation))
print(anova(fm2Mult))
Expand Down

0 comments on commit a4e3597

Please sign in to comment.