Skip to contents

summary() method for pop_data objects

Usage

# S3 method for class 'pop_data'
summary(object, strata = NULL, ...)

# S3 method for class 'summary.pop_data'
print(x, ...)

Arguments

object

a pop_data object (from as_pop_data())

strata

a character() specifying grouping column(s)

...

unused

x

an object of class "summary.pop_data"; usually, the result of a call to summary.pop_data()

Value

a summary.pop_data object, which is a list containing two summary tables:

  • age_summary summarizing age

  • ab_summary summarizing value, stratified by antigen_iso

Examples

library(dplyr)

xs_data <- load_pop_data("https://osf.io/download//n6cp3/")
summary(xs_data, strata = "Country")
#> 
#> n = 3336 
#> 
#> Distribution of age: 
#> 
#> # A tibble: 3 × 8
#>   Country        n   min first_quartile median  mean third_quartile   max
#>   <chr>      <int> <dbl>          <dbl>  <dbl> <dbl>          <dbl> <dbl>
#> 1 Bangladesh   802   0.6            4.9    9.2  9.43           14    18  
#> 2 Nepal       1546   0.9            5.3   10.8 11.3            16.7  25  
#> 3 Pakistan     988   0.8            4.9    9   10.1            14.8  24.3
#> 
#> Distributions of antigen-isotype measurements:
#> 
#> # A tibble: 6 × 8
#>   antigen_iso Country       Min `1st Qu.` Median `3rd Qu.`   Max `# NAs`
#>   <fct>       <chr>       <dbl>     <dbl>  <dbl>     <dbl> <dbl>   <int>
#> 1 HlyE_IgA    Bangladesh 0.0418     2.11    3.58      6.70 113.        0
#> 2 HlyE_IgG    Bangladesh 0.119      4.97    9.32     18.9  219.        0
#> 3 HlyE_IgA    Nepal      0          0.563   1.02      2.05  57.5       0
#> 4 HlyE_IgG    Nepal      0          0.897   1.62      3.37 184.        0
#> 5 HlyE_IgA    Pakistan   0          1.13    2.12      3.89 133.        0
#> 6 HlyE_IgG    Pakistan   0.192      1.04    2.40      5.15 135.        0
#>