AMR/man/septic_patients.Rd

67 lines
2.5 KiB
Plaintext
Raw Normal View History

2018-02-27 20:01:02 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{septic_patients}
\alias{septic_patients}
2018-09-01 21:19:46 +02:00
\title{Data set with 2000 blood culture isolates of septic patients}
2018-10-17 17:32:34 +02:00
\format{A \code{\link{data.frame}} with 2,000 observations and 49 variables:
2018-02-27 20:01:02 +01:00
\describe{
\item{\code{date}}{date of receipt at the laboratory}
\item{\code{hospital_id}}{ID of the hospital, from A to D}
2018-02-27 20:01:02 +01:00
\item{\code{ward_icu}}{logical to determine if ward is an intensive care unit}
\item{\code{ward_clinical}}{logical to determine if ward is a regular clinical ward}
\item{\code{ward_outpatient}}{logical to determine if ward is an outpatient clinic}
\item{\code{age}}{age of the patient}
2018-12-14 07:48:12 +01:00
\item{\code{gender}}{gender of the patient}
2018-02-27 20:01:02 +01:00
\item{\code{patient_id}}{ID of the patient, first 10 characters of an SHA hash containing irretrievable information}
2018-12-14 07:48:12 +01:00
\item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}}
\item{\code{peni:rifa}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{abname}}}
2018-02-27 20:01:02 +01:00
}}
\usage{
septic_patients
}
\description{
2018-09-01 21:19:46 +02:00
An anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found in septic patients in 4 different hospitals in the Netherlands, between 2001 and 2017. It is true, genuine data. This \code{data.frame} can be used to practice AMR analysis. For examples, press F1.
}
\examples{
# ----------- #
# PREPARATION #
# ----------- #
2018-09-01 21:19:46 +02:00
# Save this example data set to an object, so we can edit it:
my_data <- septic_patients
# load the dplyr package to make data science A LOT easier
library(dplyr)
2018-09-01 21:19:46 +02:00
# Add first isolates to our data set:
2018-04-02 11:11:21 +02:00
my_data <- my_data \%>\%
2018-08-31 13:36:19 +02:00
mutate(first_isolates = first_isolate(my_data, "date", "patient_id", "mo"))
# -------- #
# ANALYSIS #
# -------- #
# 1. Get the amoxicillin resistance percentages (p)
# and numbers (n) of E. coli, divided by hospital:
my_data \%>\%
2018-08-31 13:36:19 +02:00
filter(mo == guess_mo("E. coli"),
2018-04-02 11:11:21 +02:00
first_isolates == TRUE) \%>\%
group_by(hospital_id) \%>\%
summarise(n = n_rsi(amox),
2018-08-10 15:01:05 +02:00
p = portion_IR(amox))
2018-04-02 11:11:21 +02:00
# 2. Get the amoxicillin/clavulanic acid resistance
# percentages of E. coli, trend over the years:
2018-04-02 11:11:21 +02:00
my_data \%>\%
2018-08-31 13:36:19 +02:00
filter(mo == guess_mo("E. coli"),
2018-04-02 11:11:21 +02:00
first_isolates == TRUE) \%>\%
group_by(year = format(date, "\%Y")) \%>\%
summarise(n = n_rsi(amcl),
2018-08-10 15:01:05 +02:00
p = portion_IR(amcl, minimum = 20))
2018-02-27 20:01:02 +01:00
}
\keyword{datasets}