Learn R Programming

cv (version 2.0.4)

Pigs: Body Weights of 48 Pigs in 9 Successive Weeks

Description

This data set appears in Table 3.1 of Diggle, Liang, and Zeger (1994).

Usage

data("Pigs", package = "cv")

Arguments

Format

A data frame with 432 rows and 3 columns.

id

Pig id number, 1--48.

week

Week number, 1--9.

weight

Weight in kg.

Examples

Run this code
library("lme4")
m.p <- lmer(weight ~ week + (1 | id) + (1 | week),
            data=Pigs, REML=FALSE,
            control=lmerControl(optimizer="bobyqa"))
summary(m.p)
cv(m.p, clusterVariables=c("id", "week"), k=10, seed=8469)

Run the code above in your browser using DataLab