subset.SeroData | R Documentation |
This function creates a serological survey of the class SeroData
.
## S3 method for class 'SeroData'
subset(data, sub = seq(1, data$N), loc = NULL, category = NULL)
sub |
Used in the |
loc |
Used in the |
sex |
An optional character factor defining the sex of the individuals. It can be a single chain of characters or a vector of the same size as the number of sampled individuals. Default = |
... |
Additional arguments (not used). |
A list with the class SeroData
, which contains the
following items:
age: A vector of integers containing the age of the sampled individuals at the time of the latest sampling, of length N.
age_at_sampling: A vector of integers containing the age of the sampled individuals at the time of sampling, of length N.
Y: A vector of seropositivity status, of length N.
N: The number of individuals considered.
A: The maximal age.
NGroups: The total number of age groups.
sampling_year: A vector of sampling years, of length N.
location: A vector of the sampling location, of length N.
sex: A vector of the sex of each individual, of length N.
Nathanael Hoze nathanael.hoze@gmail.com
## A very simple example of a serological survey with three individuals:
data = SeroData(age_at_sampling = c(10,32,24), Y=c(0,1,1), max_age = 50, age_cats = 1, sampling_year = 2017)
seroprevalence(data = data)
data2 = subset(data,c(1,3))
# add example with subset(data, location)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.