Learn R Programming

datarium (version 0.2.0)

infections: Infection Count Data for Poisson Regression

Description

A simulated dataset giving the number of infections recorded for 100 patients over a one-year follow-up in a placebo-controlled study. It is designed for teaching Poisson regression of a count outcome on a treatment group and a continuous covariate.

Usage

data("infections")

Arguments

Format

A data frame with 100 rows and 4 columns.

id

patient identifier (1 to 100).

treatment

the treatment group, "placebo" or "treated".

age

the patient's age, in years.

count

the number of infections recorded during the one-year follow-up (a count outcome).

Examples

Run this code
data(infections)
head(infections)

# Poisson regression of the infection count on treatment and age
fit <- glm(count ~ treatment + age, family = poisson, data = infections)
summary(fit)

Run the code above in your browser using DataLab