library(DBI)
library(RSQLite)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(dplyr)
library(gtsummary)
library(gt)
ChickWeight %>%
tbl_summary()
| Characteristic | N = 5781 |
|---|---|
| weight | 103 (63, 164) |
| Time | 10 (4, 16) |
| Chick | |
| 18 | 2 (0.3%) |
| 16 | 7 (1.2%) |
| 15 | 8 (1.4%) |
| 13 | 12 (2.1%) |
| 9 | 12 (2.1%) |
| 20 | 12 (2.1%) |
| 10 | 12 (2.1%) |
| 8 | 11 (1.9%) |
| 17 | 12 (2.1%) |
| 19 | 12 (2.1%) |
| 4 | 12 (2.1%) |
| 6 | 12 (2.1%) |
| 11 | 12 (2.1%) |
| 3 | 12 (2.1%) |
| 1 | 12 (2.1%) |
| 12 | 12 (2.1%) |
| 2 | 12 (2.1%) |
| 5 | 12 (2.1%) |
| 14 | 12 (2.1%) |
| 7 | 12 (2.1%) |
| 24 | 12 (2.1%) |
| 30 | 12 (2.1%) |
| 22 | 12 (2.1%) |
| 23 | 12 (2.1%) |
| 27 | 12 (2.1%) |
| 28 | 12 (2.1%) |
| 26 | 12 (2.1%) |
| 25 | 12 (2.1%) |
| 29 | 12 (2.1%) |
| 21 | 12 (2.1%) |
| 33 | 12 (2.1%) |
| 37 | 12 (2.1%) |
| 36 | 12 (2.1%) |
| 31 | 12 (2.1%) |
| 39 | 12 (2.1%) |
| 38 | 12 (2.1%) |
| 32 | 12 (2.1%) |
| 40 | 12 (2.1%) |
| 34 | 12 (2.1%) |
| 35 | 12 (2.1%) |
| 44 | 10 (1.7%) |
| 45 | 12 (2.1%) |
| 43 | 12 (2.1%) |
| 41 | 12 (2.1%) |
| 47 | 12 (2.1%) |
| 49 | 12 (2.1%) |
| 46 | 12 (2.1%) |
| 50 | 12 (2.1%) |
| 42 | 12 (2.1%) |
| 48 | 12 (2.1%) |
| Diet | |
| 1 | 220 (38%) |
| 2 | 120 (21%) |
| 3 | 120 (21%) |
| 4 | 118 (20%) |
| 1 Median (Q1, Q3); n (%) | |
interpretation: The ChickWeight dataset consists of 5,781 individual observations collected from 50 chicks, each measured repeatedly over time, reflecting a longitudinal experimental design. The median body weight across all measurements was 103 grams, with an interquartile range (IQR) of 63 to 164 grams, indicating moderate variability in chick growth. Measurements were taken at various time points, with a median observation day of 10 (IQR: 4–16 days), showing that most data were collected during the early to mid-growth phase. Each chick contributed multiple observations, typically 12 measurements per chick, although a few chicks had slightly fewer observations, suggesting minor missing data. The chicks were assigned to four different diet groups to assess the impact of nutrition on growth: Diet 1 had the highest representation with 220 observations (38%), while Diets 2, 3, and 4 each accounted for roughly 20–21% of the data. This distribution allows for meaningful comparisons of growth trajectories across diet types. Overall, the dataset is well-structured for exploring both bivariate relationships (e.g., weight versus time, weight across diets) and more complex longitudinal analyses to investigate patterns of growth, treatment effects, and variability among individual chicks. The data provide a robust foundation for statistical modeling and visualizations to understand growth dynamics under different dietary regimens.
ChickWeight %>%
tbl_summary(by = Diet)
| Characteristic | 1 N = 2201 |
2 N = 1201 |
3 N = 1201 |
4 N = 1181 |
|---|---|---|---|---|
| weight | 88 (58, 137) | 105 (65, 163) | 126 (67, 200) | 130 (69, 185) |
| Time | 10 (4, 16) | 11 (5, 17) | 11 (5, 17) | 10 (4, 16) |
| Chick | ||||
| 18 | 2 (0.9%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 16 | 7 (3.2%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 15 | 8 (3.6%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 13 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 9 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 20 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 10 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 8 | 11 (5.0%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 17 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 19 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 4 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 6 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 11 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 3 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 1 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 12 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 2 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 5 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 14 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 7 | 12 (5.5%) | 0 (0%) | 0 (0%) | 0 (0%) |
| 24 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 30 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 22 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 23 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 27 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 28 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 26 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 25 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 29 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 21 | 0 (0%) | 12 (10%) | 0 (0%) | 0 (0%) |
| 33 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 37 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 36 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 31 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 39 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 38 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 32 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 40 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 34 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 35 | 0 (0%) | 0 (0%) | 12 (10%) | 0 (0%) |
| 44 | 0 (0%) | 0 (0%) | 0 (0%) | 10 (8.5%) |
| 45 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 43 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 41 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 47 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 49 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 46 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 50 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 42 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 48 | 0 (0%) | 0 (0%) | 0 (0%) | 12 (10%) |
| 1 Median (Q1, Q3); n (%) | ||||
interpretation: The data clearly show diet-dependent growth patterns, with Diets 3 and 4 promoting higher median weights than Diets 1 and 2. The longitudinal structure and consistent observation times make this dataset ideal for bivariate or mixed-effects analyses, allowing the investigation of how diet affects growth trajectories over time. Additionally, the distribution of repeated measures per chick ensures sufficient data for reliable statistical comparisons across diets.