Last updated: 2018-12-11

workflowr checks: (Click a bullet for more information)
  • R Markdown file: up-to-date

    Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

  • Environment: empty

    Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

  • Seed: set.seed(20181208)

    The command set.seed(20181208) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

  • Session information: recorded

    Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

  • Repository version: 9e03886

    Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

    Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
    
    Ignored files:
        Ignored:    .DS_Store
        Ignored:    .Rhistory
        Ignored:    .Rproj.user/
        Ignored:    analysis/article_v1_cache/
        Ignored:    docs/.DS_Store
        Ignored:    docs/figure/.DS_Store
    
    Untracked files:
        Untracked:  data/aggregated_pbp.csv
    
    Unstaged changes:
        Modified:   analysis/index.Rmd
        Modified:   analysis/license.Rmd
    
    
    Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
Expand here to see past versions:
    File Version Author Date Message
    html 7ebf017 jasonbaik94 2018-12-11 Build site.
    html f95677b jasonbaik94 2018-12-08 Build site.
    Rmd 4b11459 jasonbaik94 2018-12-08 Publish analysis files


5v5

Goal

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 62963, number of events= 49419 

            coef exp(coef) se(coef)      z Pr(>|z|)    
session -0.09473   0.90962  0.01846 -5.132 2.86e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session    0.9096      1.099    0.8773    0.9431

Concordance= 0.503  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 27.08  on 1 df,   p=2e-07
Wald test            = 26.34  on 1 df,   p=3e-07
Score (logrank) test = 26.36  on 1 df,   p=3e-07

Hit

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 593885, number of events= 579925 

            coef exp(coef) se(coef)     z Pr(>|z|)    
session 0.276985  1.319146 0.004529 61.16   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.319     0.7581     1.307     1.331

Concordance= 0.513  (se = 0 )
Rsquare= 0.006   (max possible= 1 )
Likelihood ratio test= 3472  on 1 df,   p=<2e-16
Wald test            = 3740  on 1 df,   p=<2e-16
Score (logrank) test = 3764  on 1 df,   p=<2e-16

Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 600637, number of events= 586677 

             coef exp(coef)  se(coef)      z Pr(>|z|)    
session -0.020532  0.979677  0.005197 -3.951  7.8e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session    0.9797      1.021    0.9697    0.9897

Concordance= 0.501  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 15.7  on 1 df,   p=7e-05
Wald test            = 15.61  on 1 df,   p=8e-05
Score (logrank) test = 15.61  on 1 df,   p=8e-05

Faceoff

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 621877, number of events= 607915 

            coef exp(coef) se(coef)    z Pr(>|z|)    
session 0.024445  1.024746 0.004999 4.89 1.01e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.025     0.9759     1.015     1.035

Concordance= 0.501  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 23.74  on 1 df,   p=1e-06
Wald test            = 23.91  on 1 df,   p=1e-06
Score (logrank) test = 23.91  on 1 df,   p=1e-06

Stoppage in Play

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 539208, number of events= 525246 

            coef exp(coef) se(coef)    z Pr(>|z|)    
session 0.046143  1.047224 0.005328 8.66   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.047     0.9549     1.036     1.058

Concordance= 0.502  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 74.03  on 1 df,   p=<2e-16
Wald test            = 75  on 1 df,   p=<2e-16
Score (logrank) test = 75.02  on 1 df,   p=<2e-16

Blocked Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 315613, number of events= 301653 

            coef exp(coef) se(coef)     z Pr(>|z|)    
session 0.073772  1.076561 0.006935 10.64   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.077     0.9289     1.062     1.091

Concordance= 0.503  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 110.8  on 1 df,   p=<2e-16
Wald test            = 113.2  on 1 df,   p=<2e-16
Score (logrank) test = 113.2  on 1 df,   p=<2e-16

Missed Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 260810, number of events= 246850 

            coef exp(coef) se(coef)     z Pr(>|z|)
session 0.011792  1.011862 0.007892 1.494    0.135

        exp(coef) exp(-coef) lower .95 upper .95
session     1.012     0.9883    0.9963     1.028

Concordance= 0.5  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 2.22  on 1 df,   p=0.1
Wald test            = 2.23  on 1 df,   p=0.1
Score (logrank) test = 2.23  on 1 df,   p=0.1

Giveaway

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 198541, number of events= 184609 

            coef exp(coef) se(coef)     z Pr(>|z|)    
session 0.058468  1.060211 0.008877 6.586 4.51e-11 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session      1.06     0.9432     1.042     1.079

Concordance= 0.502  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 42.67  on 1 df,   p=6e-11
Wald test            = 43.38  on 1 df,   p=5e-11
Score (logrank) test = 43.39  on 1 df,   p=4e-11

Takeaway

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 165716, number of events= 151773 

            coef exp(coef) se(coef)     z Pr(>|z|)   
session -0.02786   0.97252  0.01024 -2.72  0.00652 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session    0.9725      1.028    0.9532    0.9922

Concordance= 0.501  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 7.46  on 1 df,   p=0.006
Wald test            = 7.4  on 1 df,   p=0.007
Score (logrank) test = 7.4  on 1 df,   p=0.007

Coach’s Challenge

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 806, number of events= 416 

            coef exp(coef) se(coef)     z Pr(>|z|)
session -0.08781   0.91594  0.18700 -0.47    0.639

        exp(coef) exp(-coef) lower .95 upper .95
session    0.9159      1.092    0.6349     1.321

Concordance= 0.504  (se = 0.008 )
Rsquare= 0   (max possible= 0.997 )
Likelihood ratio test= 0.23  on 1 df,   p=0.6
Wald test            = 0.22  on 1 df,   p=0.6
Score (logrank) test = 0.22  on 1 df,   p=0.6

PP

Goal

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 29103, number of events= 18930 

           coef exp(coef) se(coef)     z Pr(>|z|)
session 0.02208   1.02233  0.02827 0.781    0.435

        exp(coef) exp(-coef) lower .95 upper .95
session     1.022     0.9782    0.9672     1.081

Concordance= 0.501  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 0.61  on 1 df,   p=0.4
Wald test            = 0.61  on 1 df,   p=0.4
Score (logrank) test = 0.61  on 1 df,   p=0.4

Hit

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 56285, number of events= 43881 

           coef exp(coef) se(coef)     z Pr(>|z|)    
session 0.28121   1.32473  0.01606 17.51   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.325     0.7549     1.284     1.367

Concordance= 0.514  (se = 0.001 )
Rsquare= 0.005   (max possible= 1 )
Likelihood ratio test= 284.4  on 1 df,   p=<2e-16
Wald test            = 306.5  on 1 df,   p=<2e-16
Score (logrank) test = 308.5  on 1 df,   p=<2e-16

Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 149139, number of events= 135282 

           coef exp(coef) se(coef)     z Pr(>|z|)  
session 0.02334   1.02362  0.01055 2.213   0.0269 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.024     0.9769     1.003     1.045

Concordance= 0.501  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 4.86  on 1 df,   p=0.03
Wald test            = 4.9  on 1 df,   p=0.03
Score (logrank) test = 4.9  on 1 df,   p=0.03

Faceoff

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 182622, number of events= 168684 

            coef exp(coef) se(coef)     z Pr(>|z|)   
session 0.027610  1.027994 0.009439 2.925  0.00344 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.028     0.9728     1.009     1.047

Concordance= 0.501  (se = 0 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 8.49  on 1 df,   p=0.004
Wald test            = 8.56  on 1 df,   p=0.003
Score (logrank) test = 8.56  on 1 df,   p=0.003

Stoppage in Play

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 89081, number of events= 75430 

           coef exp(coef) se(coef)     z Pr(>|z|)   
session 0.04011   1.04093  0.01400 2.866  0.00416 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.041     0.9607     1.013      1.07

Concordance= 0.501  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 8.12  on 1 df,   p=0.004
Wald test            = 8.21  on 1 df,   p=0.004
Score (logrank) test = 8.21  on 1 df,   p=0.004

Blocked Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 80615, number of events= 67154 

           coef exp(coef) se(coef)    z Pr(>|z|)    
session 0.08889   1.09296  0.01450 6.13 8.81e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.093     0.9149     1.062     1.124

Concordance= 0.504  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 36.65  on 1 df,   p=1e-09
Wald test            = 37.57  on 1 df,   p=9e-10
Score (logrank) test = 37.6  on 1 df,   p=9e-10

Missed Shot

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 72190, number of events= 58910 

           coef exp(coef) se(coef)     z Pr(>|z|)  
session 0.03503   1.03565  0.01590 2.203   0.0276 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session     1.036     0.9656     1.004     1.068

Concordance= 0.501  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 4.8  on 1 df,   p=0.03
Wald test            = 4.85  on 1 df,   p=0.03
Score (logrank) test = 4.85  on 1 df,   p=0.03

Giveaway

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 51732, number of events= 39696 

           coef exp(coef) se(coef)   z Pr(>|z|)    
session 0.07699   1.08003  0.01878 4.1 4.13e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session      1.08     0.9259     1.041     1.121

Concordance= 0.504  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 16.45  on 1 df,   p=5e-05
Wald test            = 16.81  on 1 df,   p=4e-05
Score (logrank) test = 16.82  on 1 df,   p=4e-05

Takeaway

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 40081, number of events= 28970 

            coef exp(coef) se(coef)      z Pr(>|z|)  
session -0.04084   0.95998  0.02337 -1.748   0.0805 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

        exp(coef) exp(-coef) lower .95 upper .95
session      0.96      1.042     0.917     1.005

Concordance= 0.502  (se = 0.001 )
Rsquare= 0   (max possible= 1 )
Likelihood ratio test= 3.09  on 1 df,   p=0.08
Wald test            = 3.05  on 1 df,   p=0.08
Score (logrank) test = 3.05  on 1 df,   p=0.08

Coach’s Challenge

Call:
survival::coxph(formula = survival::Surv(time_diff, event_type) ~ 
    session, data = df_cox)

  n= 251, number of events= 127 

           coef exp(coef) se(coef)      z Pr(>|z|)
session -0.1034    0.9018   0.3166 -0.327    0.744

        exp(coef) exp(-coef) lower .95 upper .95
session    0.9018      1.109    0.4848     1.677

Concordance= 0.497  (se = 0.017 )
Rsquare= 0   (max possible= 0.988 )
Likelihood ratio test= 0.11  on 1 df,   p=0.7
Wald test            = 0.11  on 1 df,   p=0.7
Score (logrank) test = 0.11  on 1 df,   p=0.7

Survival Curves

5v5 Faceoffs

Expand here to see past versions of unnamed-chunk-23-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

5v5 Stoppages in Play

Expand here to see past versions of unnamed-chunk-24-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

5v5 Blocked Shot

Expand here to see past versions of unnamed-chunk-25-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

5v5 Missed Shot

Expand here to see past versions of unnamed-chunk-26-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

5v5 Giveaway

Expand here to see past versions of unnamed-chunk-27-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

5v5 Takeaway

Expand here to see past versions of unnamed-chunk-28-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Shots on PP

Expand here to see past versions of unnamed-chunk-29-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Faceoffs on PP

Expand here to see past versions of unnamed-chunk-30-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Stoppage on PP

Expand here to see past versions of unnamed-chunk-31-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Missed Shot on PP

Expand here to see past versions of unnamed-chunk-32-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Takeaway on PP

Expand here to see past versions of unnamed-chunk-33-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Exponential distribution interarrival times

Since the entire dataset will crash RStudio due to memory limits, let’s do this on just the 2017-2018 season.

GOAL

Expand here to see past versions of unnamed-chunk-34-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

HIT

Expand here to see past versions of unnamed-chunk-35-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

SHOT

Expand here to see past versions of unnamed-chunk-36-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

FAC (Faceoffs)

Expand here to see past versions of unnamed-chunk-37-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

STOP

Expand here to see past versions of unnamed-chunk-38-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

BLOCK

Expand here to see past versions of unnamed-chunk-39-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

MISS

Expand here to see past versions of unnamed-chunk-40-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

GIVE

Expand here to see past versions of unnamed-chunk-41-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

TAKE

Expand here to see past versions of unnamed-chunk-42-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Coach’s Challenge

Expand here to see past versions of unnamed-chunk-43-1.png:
Version Author Date
f95677b jasonbaik94 2018-12-08

Session information

R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.1

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] bindrcpp_0.2.2  ggfortify_0.4.5 rms_5.1-2       SparseM_1.77   
 [5] Hmisc_4.1-1     Formula_1.2-3   lattice_0.20-38 survminer_0.4.3
 [9] ggpubr_0.2      magrittr_1.5    survival_2.43-1 forcats_0.3.0  
[13] stringr_1.3.1   dplyr_0.7.8     purrr_0.2.5     readr_1.2.1    
[17] tidyr_0.8.2     tibble_1.4.2    ggplot2_3.1.0   tidyverse_1.2.1

loaded via a namespace (and not attached):
 [1] nlme_3.1-137        cmprsk_2.2-7        lubridate_1.7.4    
 [4] RColorBrewer_1.1-2  httr_1.3.1          rprojroot_1.3-2    
 [7] tools_3.5.1         backports_1.1.2     R6_2.3.0           
[10] rpart_4.1-13        lazyeval_0.2.1      colorspace_1.3-2   
[13] nnet_7.3-12         withr_2.1.2         tidyselect_0.2.5   
[16] gridExtra_2.3       compiler_3.5.1      git2r_0.23.0       
[19] cli_1.0.1           rvest_0.3.2         quantreg_5.36      
[22] htmlTable_1.12      xml2_1.2.0          sandwich_2.5-0     
[25] labeling_0.3        scales_1.0.0        checkmate_1.8.5    
[28] survMisc_0.5.5      polspline_1.1.13    mvtnorm_1.0-8      
[31] digest_0.6.18       foreign_0.8-71      rmarkdown_1.10     
[34] R.utils_2.7.0       base64enc_0.1-3     pkgconfig_2.0.2    
[37] htmltools_0.3.6     htmlwidgets_1.3     rlang_0.3.0.1      
[40] readxl_1.1.0        rstudioapi_0.8      bindr_0.1.1        
[43] generics_0.0.2      zoo_1.8-4           jsonlite_1.5       
[46] acepack_1.4.1       R.oo_1.22.0         Matrix_1.2-15      
[49] Rcpp_1.0.0          munsell_0.5.0       R.methodsS3_1.7.1  
[52] stringi_1.2.4       multcomp_1.4-8      whisker_0.3-2      
[55] yaml_2.2.0          MASS_7.3-51.1       plyr_1.8.4         
[58] grid_3.5.1          crayon_1.3.4        haven_2.0.0        
[61] splines_3.5.1       hms_0.4.2           knitr_1.20         
[64] pillar_1.3.0        codetools_0.2-15    glue_1.3.0         
[67] evaluate_0.12       latticeExtra_0.6-28 data.table_1.11.8  
[70] modelr_0.1.2        MatrixModels_0.4-1  cellranger_1.1.0   
[73] gtable_0.2.0        km.ci_0.5-2         assertthat_0.2.0   
[76] xtable_1.8-3        broom_0.5.1         KMsurv_0.1-5       
[79] workflowr_1.1.1     cluster_2.0.7-1     TH.data_1.0-9      

This reproducible R Markdown analysis was created with workflowr 1.1.1