Skip to contents

A small synthetic cohort of 20 patients spanning the clinical patterns the package classifies (Normal, Obstructed, Restricted, Mixed, Non-specific, PRISm) plus a few bronchodilator-response cases. Demographics are random within plausible ranges; measured values were hand-picked so that each row lands in its target pattern after the GLI reference equations are applied.

Usage

pft_example

Format

A tibble with 20 rows and 11 columns:

patient_id

Integer 1-20. Synthetic identifier.

sex

Character: "M" or "F".

age

Numeric, years.

height

Numeric, centimetres.

race

One of "Caucasian", "AfrAm", "NEAsia", "SEAsia".

fev1_measured

Measured FEV1 in litres. May be NA.

fvc_measured

Measured FVC in litres.

fev1fvc_measured

Measured FEV1/FVC ratio.

tlc_measured

Measured TLC in litres. May be NA for rows intended to demonstrate spirometry-only workflows.

fev1_pre

Pre-bronchodilator FEV1 in litres. NA when not a BDR scenario.

fev1_post

Post-bronchodilator FEV1 in litres. NA when not a BDR scenario.

Source

data-raw/build_pft_example.R (synthetic; no real patient data).

Details

No real patient data. Generated by data-raw/build_pft_example.R. Provided for examples, vignettes, and quick experimentation.

Examples

data(pft_example)
head(pft_example)
#> # A tibble: 6 × 11
#>   patient_id sex     age height race      fev1_measured fvc_measured
#>        <dbl> <chr> <dbl>  <dbl> <chr>             <dbl>        <dbl>
#> 1          1 M        35    178 Caucasian           4.2          5.1
#> 2          2 F        28    165 Caucasian           3.2          3.8
#> 3          3 M        55    175 AfrAm               3.8          4.7
#> 4          4 M        62    170 Caucasian           1.8          3.8
#> 5          5 F        58    162 AfrAm               1.2          2.3
#> 6          6 M        70    168 Caucasian           1.1          2.8
#> # ℹ 4 more variables: fev1fvc_measured <dbl>, tlc_measured <dbl>,
#> #   fev1_pre <dbl>, fev1_post <dbl>
pft_interpret(pft_example)
#> <pft_result>
#> 
#> --- Row 1 ---
#> Patient: 35 yo, M, 178 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z       Severity
#>  FEV1 (2022)      4.12   4.2      0.15   normal  
#>  FVC (2022)       5.02   5.1      0.116  normal  
#>  FEV1/FVC (2022)  0.822  0.823    0.0107 normal  
#>  FRC              3.31  -        -       -       
#>  TLC              7.17     7     -0.2    normal  
#>  RV               1.56  -        -       -       
#>  RV/TLC           21.6  -        -       -       
#>  ERV              1.68  -        -       -       
#>  IC               3.87  -        -       -       
#>  VC               5.63  -        -       -       
#>  DLCO             32.2  -        -       -       
#>  KCO (tr)         4.84  -        -       -       
#>  VA               6.69  -        -       -       
#> 
#> Pattern: Normal (NNNN)
#> PRISm: FALSE
#> 
#> --- Row 2 ---
#> Patient: 28 yo, F, 165 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z       Severity
#>  FEV1 (2022)      3.16   3.2      0.0884 normal  
#>  FVC (2022)       3.69   3.8      0.216  normal  
#>  FEV1/FVC (2022)  0.862  0.842   -0.343  normal  
#>  FRC              2.65  -        -       -       
#>  TLC              5.29     5     -0.468  normal  
#>  RV               1.18  -        -       -       
#>  RV/TLC           22.4  -        -       -       
#>  ERV              1.35  -        -       -       
#>  IC               2.62  -        -       -       
#>  VC               4.07  -        -       -       
#>  DLCO             22.7  -        -       -       
#>  KCO (tr)         4.6   -        -       -       
#>  VA               4.97  -        -       -       
#> 
#> Pattern: Normal (NNNN)
#> PRISm: FALSE
#> 
#> --- Row 3 ---
#> Patient: 55 yo, M, 175 cm, AfrAm 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      3.42   3.8      0.759 normal  
#>  FVC (2022)       4.32   4.7      0.594 normal  
#>  FEV1/FVC (2022)  0.789  0.808    0.302 normal  
#>  FRC              3.4   -        -      -       
#>  TLC              6.96   6.4     -0.68  normal  
#>  RV               1.96  -        -      -       
#>  RV/TLC           27.8  -        -      -       
#>  ERV              1.32  -        -      -       
#>  IC               3.64  -        -      -       
#>  VC               5.06  -        -      -       
#>  DLCO             27.6  -        -      -       
#>  KCO (tr)         4.38  -        -      -       
#>  VA               6.34  -        -      -       
#> 
#> Pattern: Normal (NNNN)
#> PRISm: FALSE
#> 
#> --- Row 4 ---
#> Patient: 62 yo, M, 170 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z        Severity
#>  FEV1 (2022)      2.97   1.8     -2.45    mild    
#>  FVC (2022)       3.8    3.8      0.00552 normal  
#>  FEV1/FVC (2022)  0.784  0.474   -3.39    moderate
#>  FRC              3.26  -        -        -       
#>  TLC              6.49   6.2     -0.37    normal  
#>  RV               2.06  -        -        -       
#>  RV/TLC           31.1  -        -        -       
#>  ERV              1.12  -        -        -       
#>  IC               3.27  -        -        -       
#>  VC               4.5   -        -        -       
#>  DLCO             24.9  -        -        -       
#>  KCO (tr)         4.28  -        -        -       
#>  VA               5.85  -        -        -       
#> 
#> Pattern: Obstructed (ANAN)
#> PRISm: FALSE
#> BDR FEV1: TRUE ( 13.5% of predicted)
#> 
#> --- Row 5 ---
#> Patient: 58 yo, F, 162 cm, AfrAm 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      2.41   1.2     -2.88  moderate
#>  FVC (2022)         3    2.3     -1.43  normal  
#>  FEV1/FVC (2022)  0.802  0.522   -3.22  moderate
#>  FRC              2.68  -        -      -       
#>  TLC              5.09   4.8     -0.479 normal  
#>  RV               1.67  -        -      -       
#>  RV/TLC           32.3  -        -      -       
#>  ERV              0.864 -        -      -       
#>  IC               2.48  -        -      -       
#>  VC               3.45  -        -      -       
#>  DLCO             19.8  -        -      -       
#>  KCO (tr)         4.25  -        -      -       
#>  VA               4.68  -        -      -       
#> 
#> Pattern: Obstructed (ANAN)
#> PRISm: FALSE
#> BDR FEV1: TRUE ( 10.4% of predicted)
#> 
#> --- Row 6 ---
#> Patient: 70 yo, M, 168 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      2.67   1.1     -3.41  moderate
#>  FVC (2022)       3.48   2.8     -1.25  normal  
#>  FEV1/FVC (2022)  0.776  0.393   -3.63  moderate
#>  FRC              3.29  -        -      -       
#>  TLC              6.27   6.5      0.287 normal  
#>  RV               2.22  -        -      -       
#>  RV/TLC           35.1  -        -      -       
#>  ERV              1.03  -        -      -       
#>  IC               2.92  -        -      -       
#>  VC               4.03  -        -      -       
#>  DLCO             23.1  -        -      -       
#>  KCO (tr)         4.15  -        -      -       
#>  VA               5.6   -        -      -       
#> 
#> Pattern: Obstructed (ANAN)
#> PRISm: FALSE
#> 
#> --- Row 7 ---
#> Patient: 50 yo, F, 160 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z       Severity
#>  FEV1 (2022)      2.54   1.7     -2.06   mild    
#>  FVC (2022)       3.1    2.1     -2.09   mild    
#>  FEV1/FVC (2022)  0.814  0.81    -0.0663 normal  
#>  FRC              2.56  -        -       -       
#>  TLC              5.02   3.5     -2.84   moderate
#>  RV               1.45  -        -       -       
#>  RV/TLC           28.5  -        -       -       
#>  ERV              0.989 -        -       -       
#>  IC               2.48  -        -       -       
#>  VC               3.59  -        -       -       
#>  DLCO             20.1  -        -       -       
#>  KCO (tr)         4.36  -        -       -       
#>  VA               4.64  -        -       -       
#> 
#> Pattern: Restricted (AANA)
#> PRISm: TRUE
#> 
#> --- Row 8 ---
#> Patient: 65 yo, M, 172 cm, NEAsia 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      2.97   2.4     -1.21  normal  
#>  FVC (2022)       3.84   2.9     -1.59  normal  
#>  FEV1/FVC (2022)  0.778  0.828    0.758 normal  
#>  FRC              3.42  -        -      -       
#>  TLC              6.65   4.5     -2.65  moderate
#>  RV               2.2   -        -      -       
#>  RV/TLC           32.6  -        -      -       
#>  ERV              1.14  -        -      -       
#>  IC               3.27  -        -      -       
#>  VC               4.5   -        -      -       
#>  DLCO              25   -        -      -       
#>  KCO (tr)         4.2   -        -      -       
#>  VA               5.99  -        -      -       
#> 
#> Pattern: Restricted (NNNA)
#> PRISm: FALSE
#> 
#> --- Row 9 ---
#> Patient: 68 yo, M, 170 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z     Severity
#>  FEV1 (2022)      2.8    0.95    -3.81 moderate
#>  FVC (2022)       3.64   1.9     -3.12 moderate
#>  FEV1/FVC (2022)  0.777  0.5     -2.99 moderate
#>  FRC              3.37  -        -     -       
#>  TLC              6.46   4.3     -2.69 moderate
#>  RV               2.23  -        -     -       
#>  RV/TLC           34.1  -        -     -       
#>  ERV              1.08  -        -     -       
#>  IC               3.08  -        -     -       
#>  VC               4.24  -        -     -       
#>  DLCO              24   -        -     -       
#>  KCO (tr)         4.16  -        -     -       
#>  VA               5.79  -        -     -       
#> 
#> Pattern: Mixed (AAAA)
#> PRISm: FALSE
#> 
#> --- Row 10 ---
#> Patient: 72 yo, F, 158 cm, AfrAm 
#> 
#>  Measure         Pred  Measured Z     Severity
#>  FEV1 (2022)      1.96  0.7     -3.27 moderate
#>  FVC (2022)       2.52  1.5     -2.26 mild    
#>  FEV1/FVC (2022)  0.79  0.467   -3.34 moderate
#>  FRC              2.6  -        -     -       
#>  TLC              4.65  3.4     -2.15 mild    
#>  RV               1.87 -        -     -       
#>  RV/TLC           40.2 -        -     -       
#>  ERV              0.65 -        -     -       
#>  IC               2.04 -        -     -       
#>  VC               2.75 -        -     -       
#>  DLCO              18  -        -     -       
#>  KCO (tr)         4.21 -        -     -       
#>  VA               4.26 -        -     -       
#> 
#> Pattern: Mixed (AAAA)
#> PRISm: FALSE
#> 
#> --- Row 11 ---
#> Patient: 60 yo, M, 175 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      3.26   2.2     -2.05  mild    
#>  FVC (2022)       4.17   2.7     -2.35  mild    
#>  FEV1/FVC (2022)  0.782  0.815    0.518 normal  
#>  FRC              3.49  -        -      -       
#>  TLC              6.95     6     -1.14  normal  
#>  RV               2.13  -        -      -       
#>  RV/TLC           30.1  -        -      -       
#>  ERV              1.27  -        -      -       
#>  IC               3.54  -        -      -       
#>  VC               4.89  -        -      -       
#>  DLCO             26.7  -        -      -       
#>  KCO (tr)         4.27  -        -      -       
#>  VA               6.3   -        -      -       
#> 
#> Pattern: Non-specific (AANN)
#> PRISm: TRUE
#> 
#> --- Row 12 ---
#> Patient: 45 yo, F, 160 cm, SEAsia 
#> 
#>  Measure         Pred   Measured Z       Severity
#>  FEV1 (2022)      2.65   1.9     -1.84   mild    
#>  FVC (2022)       3.21   2.3     -1.9    mild    
#>  FEV1/FVC (2022)  0.822  0.826    0.0625 normal  
#>  FRC              2.54  -        -       -       
#>  TLC              5.04   4.6     -0.778  normal  
#>  RV               1.34  -        -       -       
#>  RV/TLC           26.4  -        -       -       
#>  ERV              1.09  -        -       -       
#>  IC               2.49  -        -       -       
#>  VC               3.71  -        -       -       
#>  DLCO             20.5  -        -       -       
#>  KCO (tr)         4.42  -        -       -       
#>  VA               4.69  -        -       -       
#> 
#> Pattern: Non-specific (AANN)
#> PRISm: TRUE
#> 
#> --- Row 13 ---
#> Patient: 40 yo, M, 172 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      3.68   2.5     -2.22  mild    
#>  FVC (2022)       4.48   3.3     -1.89  mild    
#>  FEV1/FVC (2022)  0.818  0.758   -0.984 normal  
#>  FRC              3.03  -        -      -       
#>  TLC              6.64  NA       NA     <NA>    
#>  RV               1.49  -        -      -       
#>  RV/TLC           22.3  -        -      -       
#>  ERV              1.42  -        -      -       
#>  IC               3.6   -        -      -       
#>  VC               5.16  -        -      -       
#>  DLCO             29.1  -        -      -       
#>  KCO (tr)         4.77  -        -      -       
#>  VA               6.15  -        -      -       
#> PRISm: TRUE
#> 
#> --- Row 14 ---
#> Patient: 55 yo, F, 163 cm, AfrAm 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      2.52   1.8     -1.73  mild    
#>  FVC (2022)       3.13   2.4     -1.45  normal  
#>  FEV1/FVC (2022)  0.805  0.75    -0.819 normal  
#>  FRC              2.7   -        -      -       
#>  TLC              5.19  NA       NA     <NA>    
#>  RV               1.62  -        -      -       
#>  RV/TLC           30.8  -        -      -       
#>  ERV              0.936 -        -      -       
#>  IC               2.54  -        -      -       
#>  VC               3.59  -        -      -       
#>  DLCO             20.3  -        -      -       
#>  KCO (tr)         4.26  -        -      -       
#>  VA               4.78  -        -      -       
#> PRISm: FALSE
#> 
#> --- Row 15 ---
#> Patient: 35 yo, F, 165 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      3.06     2     -2.37  mild    
#>  FVC (2022)       3.65   3.2     -0.865 normal  
#>  FEV1/FVC (2022)  0.841  0.625   -2.84  moderate
#>  FRC              2.71  -        -      -       
#>  TLC              5.38   5.1     -0.455 normal  
#>  RV               1.27  -        -      -       
#>  RV/TLC           23.4  -        -      -       
#>  ERV              1.34  -        -      -       
#>  IC               2.68  -        -      -       
#>  VC               4.12  -        -      -       
#>  DLCO             22.4  -        -      -       
#>  KCO (tr)         4.47  -        -      -       
#>  VA               5.03  -        -      -       
#> 
#> Pattern: Obstructed (ANAN)
#> PRISm: FALSE
#> BDR FEV1: TRUE ( 16.3% of predicted)
#> 
#> --- Row 16 ---
#> Patient: 48 yo, M, 178 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      3.79   2.3     -2.6   moderate
#>  FVC (2022)       4.73     4     -1.06  normal  
#>  FEV1/FVC (2022)  0.797  0.575   -2.98  moderate
#>  FRC              3.44  -        -      -       
#>  TLC              7.23   6.8     -0.504 normal  
#>  RV               1.8   -        -      -       
#>  RV/TLC           24.7  -        -      -       
#>  ERV              1.49  -        -      -       
#>  IC               3.85  -        -      -       
#>  VC               5.44  -        -      -       
#>  DLCO             29.8  -        -      -       
#>  KCO (tr)         4.51  -        -      -       
#>  VA               6.66  -        -      -       
#> 
#> Pattern: Obstructed (ANAN)
#> PRISm: FALSE
#> BDR FEV1: TRUE ( 15.8% of predicted)
#> 
#> --- Row 17 ---
#> Patient: 10 yo, F, 140 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      1.91   1.8     -0.464 normal  
#>  FVC (2022)       2.16   2.1     -0.196 normal  
#>  FEV1/FVC (2022)  0.893  0.857   -0.63  normal  
#>  FRC              1.45  -        -      -       
#>  TLC              2.91   3.2      0.719 normal  
#>  RV               0.675 -        -      -       
#>  RV/TLC           21.4  -        -      -       
#>  ERV              0.716 -        -      -       
#>  IC               1.42  -        -      -       
#>  VC               2.4   -        -      -       
#>  DLCO             15.4  -        -      -       
#>  KCO (tr)         5.49  -        -      -       
#>  VA               2.83  -        -      -       
#> 
#> Pattern: Normal (NNNN)
#> PRISm: FALSE
#> 
#> --- Row 18 ---
#> Patient: 12 yo, M, 150 cm, NEAsia 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      2.39   2.2     -0.619 normal  
#>  FVC (2022)       2.78   2.6     -0.501 normal  
#>  FEV1/FVC (2022)  0.866  0.846   -0.331 normal  
#>  FRC              1.85  -        -      -       
#>  TLC              3.83     4      0.338 normal  
#>  RV               0.899 -        -      -       
#>  RV/TLC           21.5  -        -      -       
#>  ERV              0.94  -        -      -       
#>  IC               1.95  -        -      -       
#>  VC               3.11  -        -      -       
#>  DLCO             19.8  -        -      -       
#>  KCO (tr)         5.45  -        -      -       
#>  VA               3.65  -        -      -       
#> 
#> Pattern: Normal (NNNN)
#> PRISm: FALSE
#> 
#> --- Row 19 ---
#> Patient: 85 yo, F, 155 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z      Severity
#>  FEV1 (2022)      1.66   1.2     -1.38  normal  
#>  FVC (2022)       2.18   1.8     -0.891 normal  
#>  FEV1/FVC (2022)  0.781  0.667   -1.36  normal  
#>  FRC             NA     -        -      -       
#>  TLC             NA      4.3     NA     <NA>    
#>  RV              NA     -        -      -       
#>  RV/TLC          NA     -        -      -       
#>  ERV             NA     -        -      -       
#>  IC              NA     -        -      -       
#>  VC              NA     -        -      -       
#>  DLCO             16.7  -        -      -       
#>  KCO (tr)         4.17  -        -      -       
#>  VA               3.96  -        -      -       
#> PRISm: FALSE
#> 
#> --- Row 20 ---
#> Patient: 90 yo, M, 168 cm, Caucasian 
#> 
#>  Measure         Pred   Measured Z     Severity
#>  FEV1 (2022)      2.23   1.4     -2.1  mild    
#>  FVC (2022)       3.07   2.4     -1.33 normal  
#>  FEV1/FVC (2022)  0.755  0.583   -1.78 mild    
#>  FRC             NA     -        -     -       
#>  TLC             NA        5     NA    <NA>    
#>  RV              NA     -        -     -       
#>  RV/TLC          NA     -        -     -       
#>  ERV             NA     -        -     -       
#>  IC              NA     -        -     -       
#>  VC              NA     -        -     -       
#>  DLCO             20.6  -        -     -       
#>  KCO (tr)         3.82  -        -     -       
#>  VA               5.4   -        -     -       
#> 
#> Pattern: Obstructed (ANA?)
#> PRISm: FALSE
#> 
#> Use `as_tibble(x)` or `as.data.frame(x)` for the full output (67 columns).