# NMST432 Advanced Regression Models

## Exercise on description of longitudinal data

Back to course page

Dataset below is a dataset from a text by Luc Duchateau, Paul Janssen, and John Rowlands published by International Livestock Research Institute in Nairobi, Kenya.

### Story behind the data

The N'Dama breed of cattle is not affected as severely by trypanosomosis as some other breeds. Changes in PCV following experimental infection with trypanosomes have been studied to demonstrate differences in susceptibility between the N'Dama and Boran breeds.

### Data

Dataset which is read into R by the code below contains data on longitudinal measurements of the PCV on 12 cows (6 cows of Boran breed, 6 cows of N'Dama breed). There are the following variables in the dataset:

• `id`: identification of a cow;
• `breed`: identification of a breed (`BO` for Boran breed, `ND` for N'Dama breed);
• `time`: time of a measurement (in days);
• `PCV`: packed cell volume (%).
``````dt33 <- read.table("./Data/DJR_33.dat", header = TRUE, stringsAsFactors = FALSE)
dt33 <- transform(dt33, breed = factor(breed))
summary(dt33)
``````
``````##       id            breed        time            PCV
##  Length:168         BO:84   Min.   : 0.00   Min.   :15.90
##  Class :character   ND:84   1st Qu.: 7.00   1st Qu.:25.50
##  Mode  :character           Median :17.50   Median :28.75
##                             Mean   :16.78   Mean   :28.85
##                             3rd Qu.:25.00   3rd Qu.:32.12
##                             Max.   :35.00   Max.   :40.40
``````
``````with(dt33, table(id))
``````
``````## id
##   BO1 BO209 BO241 BO322 BO326  BO37  ND60  ND66  ND72  ND73  ND74  ND75
##    14    14    14    14    14    14    14    14    14    14    14    14
``````