2025-11-03

R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

R.version
##                _                           
## platform       x86_64-apple-darwin20       
## arch           x86_64                      
## os             darwin20                    
## system         x86_64, darwin20            
## status                                     
## major          4                           
## minor          5.1                         
## year           2025                        
## month          06                          
## day            13                          
## svn rev        88306                       
## language       R                           
## version.string R version 4.5.1 (2025-06-13)
## nickname       Great Square Root
library(pkgconfig)
# loads package pkgconfig
library(fastmap)
# loads package fastmap
library(doParallel)
# Loads package for paralel computing
library(skimr)
# Loads skimr for "summary" af database
library(MASS)
# loads the package MASS
library(psych)
# loads the package psych 
library(lubridate)
# loads the package lubridate for converting to date variable
library(magrittr)
# loads package for forward pipe
library(glue)
# loads package for interpreted string litterals
library(ruler)
# loads package ruler
library(kableExtra)
# loads package for construction of tables
library(readxl)
library(readr)
# loads package for import of Excel files
library(janitor)
# loads package for changing variable names
library(gtsummary)
# loads package for summary tables
library(gt)
# loads helper for gtsummary
library(labelled)
# loads supplementary package to gtsummary
library(flextable)
# loads functions for tabular reporting
library(fastmap)
library(stringr)
# loads function for automatic creation of dummies
library(dummy)
library(fastDummies)
# loading packages for visualisering af missing data
library(naniar)
library(visdat)
library(UpSetR)
# Alder og køn beregnet ud fra cpr nummer
library(cprr)
# Hjælpepakke til gtsummary
library(labelled)
# loads another package for penalized regression
library(xgboost)
# loads package for penalized logistic regression
# library(penalized)

library(dplyr)
library(systemfonts)

library(gganimate)
# loads packages for animated plots
library(car)
library(olsrr)

library(eq5d)
# loads package for calculation of EQ5D-5L values
library(glmnet)
# loads package for generalized linear models
library(KMEANS.KNN)
# loads package for cluster analysis
#library(StepReg)
# loads package for stepwise regression
library(poolr)
# loads packages for pooling p values
library(multtest)
library(metap)
library(moderndive)
# loads package rank based partially paired data
library(robustrank)
library(writexl)
library(flowchart)
# loads package for logistic regression analysis
library(StepReg)
# Loads package for slides
library(revealjs)
library(broom.helpers)
library(parameters)

Data file import:

# Data import
# AIS_Data_86 <- read_xlsx("~/Desktop/Long_Term_AIS/
# Exports_AIS_Longterm/86completerecords.xlsx")

Missing

# Number of variables with missing values:
n_var_miss(AIS_Data_86)
## [1] 14

Upset plot:

gg_miss_upset(AIS_Data_86, nsets = n_var_miss(AIS_Data_86))

Cases with many missing values:

# Percentage of cases missing 1-6 values of the 170 variables
miss_case_table(AIS_Data_86)
## # A tibble: 6 × 3
##   n_miss_in_case n_cases pct_cases
##            <int>   <int>     <dbl>
## 1              4      12     14.0 
## 2              5      26     30.2 
## 3              6      20     23.3 
## 4              7      17     19.8 
## 5              8       9     10.5 
## 6              9       2      2.33

Variables with missing values:

# Which variables have missing values
miss_var_which(AIS_Data_86)
##  [1] "body_curve_area"           "shoulderblade_rotation"   
##  [3] "bothers_most"              "cause_nowork"             
##  [5] "navn"                      "major_curve_cobb_sidebend"
##  [7] "minor_curve_sidebend"      "ponte_numbers"            
##  [9] "duration_surg"             "bloodloss_intraop"        
## [11] "what_else_1"               "add_on_perop_mm"          
## [13] "what_else_2"               "what_else_3"

Sex distribution:

Sex <- as.factor(Gender)
summary(Sex)
## Female   Male 
##     69     17

Age at follow-up:

Age_prom <- age(AIS_Data_86$cpr, 
                date = AIS_Data_86$prom_answer_date, unit = "year")
Age_prom <- round(as.numeric(Age_prom), digits = 0)
summary(Age_prom)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    18.0    23.0    25.0    24.9    27.0    32.0

Age at follow-up histogram:

hist(Age_prom, breaks = 15)

Age at the time of surgery:

Age_surgery <- age(AIS_Data_86$cpr, date = AIS_Data_86$surgery_date, 
                   unit = "year")
Age_surgery <- round(as.numeric(Age_surgery), digits = 0)
summary(Age_surgery)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   12.00   14.00   16.00   15.91   17.00   21.00

Age at the time of surgery histogram:

hist(Age_surgery, breaks = 10)

Follow-up time in years:

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   4.463   6.667   9.092   8.957  11.037  13.811

Follow-up time in years histogram:

hist(Follow_up_time_y)

Lenke class:

AIS_Data_86$lenke <- as.factor(AIS_Data_86$lenke)
summary(AIS_Data_86$lenke)
##  1  2  3  4  5  7 
## 48  8  9  3 17  1

Thoracic Cobb angles Lenke 1-4 at different times:

moderndive::tidy_summary(Lenke1to4)
## # A tibble: 7 × 11
##   column                n group type    min    Q1  mean median    Q3   max    sd
##   <chr>             <int> <chr> <chr> <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 cobb_preop_t         68 <NA>  nume…    30    41  50.5   48    57      97 13.4 
## 2 cobb_postop_0_t      68 <NA>  nume…     2     8  11.7   10.5  15      38  6.71
## 3 cobb_postop_last…    68 <NA>  nume…     1    10  14.6   13    17.2    34  7.30
## 4 lenke                48 1     fact…    NA    NA  NA     NA    NA      NA NA   
## 5 lenke                 8 2     fact…    NA    NA  NA     NA    NA      NA NA   
## 6 lenke                 9 3     fact…    NA    NA  NA     NA    NA      NA NA   
## 7 lenke                 3 4     fact…    NA    NA  NA     NA    NA      NA NA

Thoracolumbar Cobb angles Lenke 5 at different times:

moderndive::tidy_summary(Lenke5)
## # A tibble: 4 × 11
##   column                n group type    min    Q1  mean median    Q3   max    sd
##   <chr>             <int> <chr> <chr> <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 cobb_preop_tl        17 <NA>  nume…    31    37 40.9      40    43    60  7.18
## 2 cobb_postop_0_tl     17 <NA>  nume…     0     5  9.12      7    13    23  6.60
## 3 cobb_postop_last…    17 <NA>  nume…     3     7 12.9       9    17    35  8.96
## 4 lenke                17 5     fact…    NA    NA NA        NA    NA    NA NA

RADIOLOGICAL RESULTS

Decrease in thoracic Cobb angle from preop to immediately postop (%) based on Lenke classification (1-4):

Cobb_thoracic_pre_postop0 <- (Lenke1to4$cobb_preop_t - Lenke1to4$cobb_postop_0_t)
# Numeric:
summary(Cobb_thoracic_pre_postop0)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   19.00   31.00   36.00   38.75   44.50   73.00
# SD
sd(Cobb_thoracic_pre_postop0)
## [1] 11.18017

Decrease in thoracic Cobb angle from preop to immediately postop (%) based on Lenke classification (1-4):

# Percentage
summary((Cobb_thoracic_pre_postop0/Lenke1to4$cobb_preop_t)*100)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   54.05   69.39   77.48   76.87   84.31   95.65
sd((Cobb_thoracic_pre_postop0/Lenke1to4$cobb_preop_t)*100)
## [1] 10.993

Decrease in Cobb angle from preop to last follow-up (%) based on Lenke classification (1-4):

Cobb_thoracic_pre_lastfu_t <- (Lenke1to4$cobb_preop_t - Lenke1to4$cobb_postop_lastfu_t)
# Numeric:
summary(Cobb_thoracic_pre_lastfu_t)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   16.00   28.75   35.50   35.91   41.00   74.00
sd(Cobb_thoracic_pre_lastfu_t)
## [1] 11.32918

Decrease in Cobb angle from preop to last follow-up (%) based on Lenke classification (1-4):

# Percentage:
summary((Cobb_thoracic_pre_lastfu_t/Lenke1to4$cobb_preop_t)*100)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   41.67   62.97   72.13   71.12   80.35   97.50
sd((Cobb_thoracic_pre_lastfu_t/Lenke1to4$cobb_preop_t)*100)
## [1] 12.28751

Decrease in thoracolumbar Cobb angle from preop to immediately postop (%) based on Lenke classification 5:

Cobb_lumbar_pre_postop0 <- (Lenke5$cobb_preop_tl - Lenke5$cobb_postop_0_tl)
# Numeric:
summary(Cobb_lumbar_pre_postop0)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   22.00   27.00   30.00   31.76   36.00   44.00
sd(Cobb_lumbar_pre_postop0)
## [1] 6.533849

Decrease in thoracolumbar Cobb angle from preop to immediately postop (%) based on Lenke classification 5:

# Percentage:
summary((Cobb_lumbar_pre_postop0/Lenke5$cobb_preop_tl)*100)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   57.89   68.29   80.65   78.44   89.80  100.00
sd((Cobb_lumbar_pre_postop0/Lenke5$cobb_preop_tl)*100)
## [1] 14.04599

Decrease in Cobb angle from preop to last follow up (%) based on Lenke classification 5:

Cobb_lumbar_pre_lastfu <- (Lenke5$cobb_preop_tl - Lenke5$cobb_postop_lastfu_tl)
# Numeric:
summary(Cobb_lumbar_pre_postop0)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   22.00   27.00   30.00   31.76   36.00   44.00
sd(Cobb_lumbar_pre_postop0)
## [1] 6.533849

Decrease in Cobb angle from preop to last follow up (%) based on Lenke classification 5:

# Percentage:
summary((Cobb_lumbar_pre_lastfu/Lenke5$cobb_preop_tl)*100)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   10.26   55.26   75.00   68.52   83.67   91.67
sd((Cobb_lumbar_pre_postop0/Lenke5$cobb_preop_tl)*100)
## [1] 14.04599

PROM RESULTS

SRS22 Satisfaction

summary(Satisfaction_SRS22_dicho)
## Not Satisfied     Satisfied 
##            14            72
summary(AIS_Data_86$srs_22_21)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.000   1.000   2.000   1.802   2.000   5.000
# 84% very satisfied or satisfied with the treatment (72:86)
summary(AIS_Data_86$srs_22_22)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     1.0     1.0     1.0     1.5     2.0     5.0
# 90% would definitely or probably have the same treatment (77:86)

SRS22 function - summary and SD

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.400   3.050   3.400   3.284   3.400   4.200
## [1] 0.354421

12.8% inconsistency for EQ5D-5L usual activities and question 5 SRS22 concerning activity:

SRS22_EQ55_Inconcistency_Activity <- subset(AIS_Data_86, srs_22_5 <= 3 &
                                              eq55_usual_activities == 1)
(nrow(SRS22_EQ55_Inconcistency_Activity)/86)*100
## [1] 12.7907

SRS22 pain - summary and SD

SRS22_pain <- (AIS_Data_86_SRS_scores$srs_22_1 + 
                 AIS_Data_86_SRS_scores$srs_22_2 +     
                 AIS_Data_86_SRS_scores$srs_22_8 +
                 AIS_Data_86_SRS_scores$srs_22_11 +
                 AIS_Data_86_SRS_scores$srs_22_17)/5
summary(SRS22_pain)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    2.20    3.40    4.00    3.73    4.20    4.60
sd(SRS22_pain)
## [1] 0.6118573

SRS22 self image - summary and SD

SRS22_selfimage <- (AIS_Data_86_SRS_scores$srs_22_4 + 
                      AIS_Data_86_SRS_scores$srs_22_6 + 
                      AIS_Data_86_SRS_scores$srs_22_10 + 
                      AIS_Data_86_SRS_scores$srs_22_14 +
                      AIS_Data_86_SRS_scores$srs_22_19)/5
summary(SRS22_selfimage)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.200   3.600   4.200   4.016   4.400   5.000
sd(SRS22_selfimage)
## [1] 0.6929664

SRS22 mental health - summary and SD

SRS22_mentalhealth <- (AIS_Data_86_SRS_scores$srs_22_3 + 
                         AIS_Data_86_SRS_scores$srs_22_7 + 
                         AIS_Data_86_SRS_scores$srs_22_13 +
                         AIS_Data_86_SRS_scores$srs_22_16 +
                         AIS_Data_86_SRS_scores$srs_22_20)/5
summary(SRS22_mentalhealth)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.200   3.000   3.200   3.095   3.350   3.800
sd(SRS22_mentalhealth)
## [1] 0.2938215

SRS22 satisfaction - summary and SD

SRS22_satisfaction <- (AIS_Data_86_SRS_scores$srs_22_21 + 
                         AIS_Data_86_SRS_scores$srs_22_22)/2
summary(SRS22_satisfaction)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.000   4.000   4.500   4.349   5.000   5.000
sd(SRS22_satisfaction)
## [1] 0.7517422

SRS22 total - summary and SD

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.591   3.466   3.682   3.606   3.864   4.091
## [1] 0.3719924

Calculating the SRS22 sum without the satisfaction score - summary and SD

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.450   3.400   3.625   3.531   3.800   4.050
## [1] 0.3657423

EQ5D-5L

## # A tibble: 5 × 11
##   column     n group type      min    Q1  mean median    Q3   max    sd
##   <chr>  <int> <chr> <chr>   <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 MO        86 <NA>  numeric     1     1  1.35      1     2     4 0.628
## 2 SC        86 <NA>  numeric     1     1  1.19      1     1     3 0.448
## 3 UA        86 <NA>  numeric     1     1  1.64      1     2     5 0.932
## 4 PD        86 <NA>  numeric     1     2  2.24      2     3     5 0.969
## 5 AD        86 <NA>  numeric     1     1  1.60      1     2     5 0.924

Descriptive statistics for the EQ5D-5L utility score

summary(EQ5D_utility_scores)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -0.0040  0.7940  0.8800  0.8087  0.9520  1.0000
sd(EQ5D_utility_scores)
## [1] 0.2241251
# Danish mean score 0.91-0.93 in the same age group compared 
# to 0.81 in our AIS group. Danish EQ5D-3L scores for 
# varicose veins 0.837, hemorrhoids 0.795, musculoskeletal disease 0.783

EQ5D-5L General health VAS

summary(AIS_Data_86$eq55_generalhealth_slider)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   14.00   65.75   80.00   72.92   85.00  100.00
sd(AIS_Data_86$eq55_generalhealth_slider)
## [1] 19.20185

LSS the sum of the 5 scores - low is better:

lss <- lss(EQ5D_5L, version = "5L")
summary(lss)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   5.000   6.000   7.000   8.023   9.000  19.000

Plot HSDC

SAQ appearance score

summary(AIS_Data_86_SAQ_appearance_score)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   10.00   13.00   17.00   17.24   21.00   28.00       2

SAQ expectance score

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    4.00    7.00   10.00   10.78   14.00   20.00
## [1] 4.686404

SAQ total score

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   14.00   22.00   28.50   28.01   35.00   45.00       2
## [1] NA

Table 2:

Table 2. Generic Patient Reported Outcome Measures at Last Follow-up
Variable N = 861
SRS22 Function 3.40 (3.00, 3.40)
SRS22 Pain 4.00 (3.40, 4.20)
SRS22 Self Image 4.20 (3.60, 4.40)
SRS22 Mental Health 3.20 (3.00, 3.40)
SRS22 Total Score 3.68 (3.45, 3.86)
SAQ Appearance Score 17.0 (13.0, 21.0)
    Unknown 2
SAQ Expectance Score 10.0 (7.0, 14.0)
SAQ Total Score 29 (22, 35)
    Unknown 2
1 Median (Q1, Q3)

Table 4:

Table 4. Generic PROM’s grouped by Satisfaction at Last Follow-up
Variable Not Satisfied
N = 14
1
Satisfied
N = 72
1
p-value2
SRS22 Function 2.90 (2.80, 3.40) 3.40 (3.20, 3.40) 0.001
SRS22 Pain 2.80 (2.60, 3.60) 4.00 (3.60, 4.20) <0.001
SRS22 Self Image 3.20 (3.00, 4.20) 4.20 (3.80, 4.60) 0.003
SRS22 Mental Health 3.00 (2.80, 3.20) 3.20 (3.00, 3.40) 0.076
SRS22 Total Score 3.02 (2.77, 3.41) 3.73 (3.57, 3.91) <0.001
SAQ Appearance Score 21.5 (16.0, 24.0) 16.0 (13.0, 20.0) 0.016
    Unknown 0 2
SAQ Expectance Score 13.0 (8.0, 16.0) 10.0 (7.0, 14.0) 0.3
SAQ Total Score 37 (24, 39) 27 (21, 33) 0.048
    Unknown 0 2
1 Median (Q1, Q3)
2 Wilcoxon rank sum test

Logistic regression analysis with StepReg:

Variable

Odds Ratio

SD

Statistic

p-value

(Intercept)

1.7646115

0.98130082

0.5787527

0.56275602

Current Work Status

0.2690329

0.69535611

-1.8881284

0.05900871

Decrease in high thoracic Cobb angle

1.0848954

0.04766959

1.7093405

0.08738789

Educational Level

5.9203149

0.86619321

2.0531097

0.04006194

Reoperation

0.2777188

0.88724731

-1.4439561

0.14875134

tidy_summary paired data:

## # A tibble: 10 × 11
##    column               n group type    min    Q1  mean median    Q3   max    sd
##    <chr>            <int> <chr> <chr> <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
##  1 DS_SRS22_functi…    27 <NA>  nume…  2.2   3.8   4.19   4.4   4.9   5    0.835
##  2 SRS22_function      27 <NA>  nume…  2.4   3     3.19   3.2   3.4   4    0.400
##  3 DS_SRS22_pain       27 <NA>  nume…  1.2   3.1   3.73   4     4.4   5    0.997
##  4 SRS22_pain          27 <NA>  nume…  2.2   3.3   3.70   4     4.2   4.6  0.669
##  5 DS_SRS22_selfim…    27 <NA>  nume…  1.6   2.7   3.07   3     3.5   4.8  0.759
##  6 SRS22_selfimage     27 <NA>  nume…  3     3.9   4.18   4.2   4.4   5    0.539
##  7 DS_SRS22_mental…    27 <NA>  nume…  2     3.6   4.00   4     4.6   5    0.712
##  8 SRS22_mentalhea…    27 <NA>  nume…  2.2   2.8   3.08   3.2   3.4   3.4  0.334
##  9 DS_SRS22_total20    27 <NA>  nume…  2.2   3.5   3.75   3.85  4.2   4.85 0.664
## 10 SRS22_total_20      27 <NA>  nume…  2.45  3.45  3.54   3.6   3.78  4.05 0.376

Mean comparision paired SRS22

  • Function: DaneSpine > AIS **
  • Pain: DaneSpine = AIS (NS)
  • Selfimage: DaneSpine < AIS **
  • Mental Health: DaneSpine > AIS **
  • Total 20: DaneSpine ~ AIS (p = 0.04) (p < 0.001**)

Wilcox SR22 function & pain before surgery and 5-13 years after scoliosis surgery (paired data):

## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  DaneSpine_SRS22_paired$DS_SRS22_function and DaneSpine_SRS22_paired$SRS22_function
## V = 316.5, p-value = 0.00003577
## alternative hypothesis: true location shift is not equal to 0
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  DaneSpine_SRS22_paired$DS_SRS22_pain and DaneSpine_SRS22_paired$SRS22_pain
## V = 157.5, p-value = 0.563
## alternative hypothesis: true location shift is not equal to 0

Wilcox SR22 selfimage before surgery and 5-13 years after scoliosis surgery (paired data):

V = 0, p-value = 0.00001292

alternative hypothesis: true location shift is not equal to 0

Wilcox SR22 mental health before surgery and 5-13 years after scoliosis surgery (paired data):

V = 289, p-value = 0.00007464

alternative hypothesis: true location shift is not equal to 0

Wilcox SR22 total score (20) before surgery and 5-13 years after scoliosis surgery (paired data):

V = 257, p-value = 0.03954

alternative hypothesis: true location shift is not equal to 0

Summary + sd unpaired data SRS22 function DS:

summary(DaneSpine_SRS22_anti$DS_SRS22_function)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.600   3.600   4.000   4.009   4.575   5.000
sd(DaneSpine_SRS22_anti$DS_SRS22_function)
## [1] 0.7276221

Summary + sd unpaired data SRS22 function AIS:

summary(AIS_Data_86_anti$SRS22_function)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.400   3.200   3.400   3.329   3.400   4.200
sd(AIS_Data_86_anti$SRS22_function)
## [1] 0.3253915

Summary + sd unpaired data SRS22 pain DS:

summary(DaneSpine_SRS22_anti$DS_SRS22_pain)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1.20    3.00    3.80    3.65    4.40    5.00
sd(DaneSpine_SRS22_anti$DS_SRS22_pain)
## [1] 0.932074

Summary + sd unpaired data SRS22 pain AIS:

summary(AIS_Data_86_anti$SRS22_pain)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.400   3.600   4.000   3.742   4.200   4.600
sd(AIS_Data_86_anti$SRS22_pain)
## [1] 0.5896239

Summary + sd unpaired data SRS22 selfimage DS:

summary(DaneSpine_SRS22_anti$DS_SRS22_selfimage)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.200   2.348   3.000   2.912   3.475   5.000
sd(DaneSpine_SRS22_anti$DS_SRS22_selfimage)
## [1] 0.7958262

Summary + sd unpaired data SRS22 selfimage AIS:

summary(AIS_Data_86_anti$SRS22_selfimage)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.200   3.400   4.000   3.942   4.500   5.000
sd(AIS_Data_86_anti$SRS22_selfimage)
## [1] 0.7456086

Summary + sd unpaired data SRS22 mental health DS:

summary(DaneSpine_SRS22_anti$DS_SRS22_mentalhealth)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.400   3.400   3.800   3.775   4.400   5.000
sd(DaneSpine_SRS22_anti$DS_SRS22_mentalhealth)
## [1] 0.7724052

Summary + sd unpaired data SRS22 mental health AIS:

summary(AIS_Data_86_anti$SRS22_mentalhealth)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.200   3.000   3.200   3.102   3.200   3.800
sd(AIS_Data_86_anti$SRS22_mentalhealth)
## [1] 0.2763628

Summary + sd unpaired data SRS22 total20 DS:

summary(DaneSpine_SRS22_anti$DS_SRS22_total20)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.850   3.100   3.725   3.587   4.050   4.760
sd(DaneSpine_SRS22_anti$DS_SRS22_total20)
## [1] 0.6410582

Summary + sd unpaired data SRS22 total20 AIS:

summary(AIS_Data_86_anti$SRS22_total_20)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.700   3.400   3.650   3.529   3.800   4.000
sd(AIS_Data_86_anti$SRS22_total_20)
## [1] 0.3643846

Mean comparision unpaired SRS22

  • Function: DaneSpine > AIS **
  • Pain: DaneSpine ~ AIS
  • Selfimage: DaneSpine < AIS **
  • Mental Health: DaneSpine > AIS **
  • Total 20: DaneSpine ~ AIS (p = 0.18) (p < 0.001**)

wilcox unpaired data - function and pain:

## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DaneSpine_SRS22_anti$DS_SRS22_function and AIS_Data_86_anti$SRS22_function
## W = 5061, p-value = 0.00000000003724
## alternative hypothesis: true location shift is not equal to 0
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DaneSpine_SRS22_anti$DS_SRS22_pain and AIS_Data_86_anti$SRS22_pain
## W = 3099, p-value = 0.9252
## alternative hypothesis: true location shift is not equal to 0

wilcox unpaired data - selfimage and mentalheath:

## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DaneSpine_SRS22_anti$DS_SRS22_selfimage and AIS_Data_86_anti$SRS22_selfimage
## W = 1045, p-value = 0.000000000001318
## alternative hypothesis: true location shift is not equal to 0
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DaneSpine_SRS22_anti$DS_SRS22_mentalhealth and AIS_Data_86_anti$SRS22_mentalhealth
## W = 4971.5, p-value = 0.0000000003067
## alternative hypothesis: true location shift is not equal to 0

wilcox unpaired data - total20:

## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DaneSpine_SRS22_anti$DS_SRS22_total20 and AIS_Data_86_anti$SRS22_total_20
## W = 3523.5, p-value = 0.178
## alternative hypothesis: true location shift is not equal to 0

Partially matched wilcoxon rank based test which is used to compare two groups when some of the data pairs are missing or unmatched (Fong, Huang, Lemos and McElrath 2018, Biostatics, doi:10.1093/biostatistics/kxx039)

Mixed data partially matched Wilcoxon test:

  • Function (p < 0.001)
  • Pain (NS)
  • Self Image (p < 0.001)
  • Mental Health (p < 0.001)
  • Total 20 (p < 0.001)

SRS22 DS and AIS function

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=27), Ypaired (m=27), Xextra (lx=106), Yextra (n=59)
## Z = -8.4311, p-value < 0.00000000000000022
## alternative hypothesis: two.sided

SRS22 DS and AIS pain

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=27), Ypaired (m=27), Xextra (lx=106), Yextra (n=59)
## Z = -0.43408, p-value = 0.6642
## alternative hypothesis: two.sided

SRS22 DS and AIS selfimage

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=27), Ypaired (m=27), Xextra (lx=106), Yextra (n=59)
## Z = 9.3755, p-value < 0.00000000000000022
## alternative hypothesis: two.sided

SRS22 DS and AIS mental health

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=27), Ypaired (m=27), Xextra (lx=106), Yextra (n=59)
## Z = -8.456, p-value < 0.00000000000000022
## alternative hypothesis: two.sided

SRS22 DS and AIS Total 20

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=27), Ypaired (m=27), Xextra (lx=106), Yextra (n=59)
## Z = -2.6541, p-value = 0.007952
## alternative hypothesis: two.sided

Analyzing difference from before the surgical intervention to the last follow-up EQ5D-5L and EQ5D_3L using DaneSpine data:

Paired EQ5D utility score for the 3L to 5L data (DaneSpine):

summary(EQ5D_paired$Utility_3L_to_5L)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.2280  0.7970  0.8700  0.8395  0.9700  0.9700
sd(EQ5D_paired$Utility_3L_to_5L)
## [1] 0.1602152

Paired EQ5D utility score for the 3L to 5L data (AIS):

summary(EQ5D_paired$Utility_5L)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -0.0040  0.7760  0.9060  0.7909  0.9520  1.0000
sd(EQ5D_paired$Utility_5L)
## [1] 0.2651763

Wilcoxon test for the paired EQ5D utility score:

wilcox.test(EQ5D_paired$Utility_3L_to_5L, EQ5D_paired$Utility_5L, paired = TRUE)
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  EQ5D_paired$Utility_3L_to_5L and EQ5D_paired$Utility_5L
## V = 241, p-value = 0.6189
## alternative hypothesis: true location shift is not equal to 0

Unpaired EQ5D utility score DaneSpine:

summary(DaneSpine_EQ5D_3L_to_5L_unpaired$Pre_EQ5D_3L_to_5L)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.2800  0.6940  0.8200  0.7712  0.8700  0.9700
sd(DaneSpine_EQ5D_3L_to_5L_unpaired$Pre_EQ5D_3L_to_5L)
## [1] 0.1717786

Unpaired EQ5D utility score AIS:

summary(AIS_Data_86_EQ5D_5L_anti$EQ5D_utility_scores)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.1080  0.8060  0.8800  0.8178  0.9520  1.0000
sd(AIS_Data_86_EQ5D_5L_anti$EQ5D_utility_scores)
## [1] 0.2020824

Wilcoxon test for the paired EQ5D utility score:

  • Wilcoxon rank sum test with continuity correction
  • data: DaneSpine_EQ5D_3L_to_5L_unpaired$Pre_EQ5D_3L_to_5L and
  • AIS_Data_86_EQ5D_5L_anti$EQ5D_utility_scores
  • W = 2139.5, p-value = 0.002705
  • alternative hypothesis: true location shift is not equal to 0

Partially matched wilcoxon rank based test which is used to compare two groups when some of the data pairs are missing or unmatched:

## 
##  SR-MW, weighted linear combination
## 
## data:  Xpaired (m=29), Ypaired (m=29), Xextra (lx=105), Yextra (n=57)
## Z = 1.8562, p-value = 0.06342
## alternative hypothesis: two.sided

Comparison with known EQ5D utility scores

  • Median EQ5D-5L utility index at last follow-up: 0.88
  • Danish EQ5D-5L norms for the age group 18-29y: 0.93 and for the age group 30-39y: 0.91
  • Reference: Jensen MB, Jensen CE, Gudex C, Pedersen KM, Sørensen SS, Ehlers LH. Danish population health measured by the EQ-5D-5L. Scandinavian Journal of Public Health 2023;51:241-249.doi.org/10.1177/14034948211058060

Flowchart construction using Excel file and the flowchart package:

## [1] "Date"

Table 8:

Table 8. Patient Demographics DaneSpine pre-surgery
Variable N = 1331
Age at surgery 15.00 (14.00, 17.00)
Sex
    Female 92 (69%)
    Male 41 (31%)
1 Median (Q1, Q3); n (%)

Table 9:

Table 9. SRS22 DaneSpine before Surgery
Variable N = 1331
SRS22 Function 4.20 (3.60, 4.60)
SRS22 Pain 3.80 (3.00, 4.40)
SRS22 Self Image 3.00 (2.40, 3.50)
SRS22 Mental Health 3.80 (3.40, 4.40)
SRS22 Total for 20 Questions 3.75 (3.10, 4.10)
1 Median (Q1, Q3)

Table 10:

Table 10. EQ5D-3L scores DaneSpine pre-surgery
Variable N = 1341
EQ5D-3L Mobility
    1 97 (72%)
    2 37 (28%)
EQ5D-3L Self Care
    1 127 (95%)
    2 7 (5.2%)
EQ5D-3L Usual Activities
    1 71 (53%)
    2 61 (46%)
    3 2 (1.5%)
EQ5D-3L Pain/Discomfort
    1 30 (22%)
    2 90 (67%)
    3 14 (10%)
EQ5D-3L Anxiety/Depression
    1 111 (83%)
    2 20 (15%)
    3 3 (2.2%)
EQ5D-3L Utility score 0.78 (0.72, 0.82)
EQ5D-3L General Health VAS 75 (55, 90)
1 n (%); Median (Q1, Q3)

Table 12:

Table 12. SRS22 at Last Follow-up
Variable N = 861
SRS22 Function 3.40 (3.00, 3.40)
SRS22 Pain 4.00 (3.40, 4.20)
SRS22 Self Image 4.20 (3.60, 4.40)
SRS22 Mental Health 3.20 (3.00, 3.40)
SRS22 Total for 20 Questions 3.63 (3.40, 3.80)
1 Median (Q1, Q3)

Table 13

Table 13. SRS22 before surgery and SRS22 at last follow-up
SRS22 pre
SRS22 post
Characteristic N = 1331 Characteristic N = 861
SRS22 Function 4.20 (3.60, 4.60) SRS22 Function 3.40 (3.00, 3.40)
SRS22 Pain 3.80 (3.00, 4.40) SRS22 Pain 4.00 (3.40, 4.20)
SRS22 Self Image 3.00 (2.40, 3.50) SRS22 Self Image 4.20 (3.60, 4.40)
SRS22 Mental Health 3.80 (3.40, 4.40) SRS22 Mental Health 3.20 (3.00, 3.40)
SRS22 Total for 20 Questions 3.75 (3.10, 4.10) SRS22 Total for 20 Questions 3.63 (3.40, 3.80)
1 Median (Q1, Q3)

Table 1:

Table 1. Case Demographics last Follow-up
Variable N = 861
Age at surgery 16.00 (14.00, 17.00)
Sex
    Female 69 (80%)
    Male 17 (20%)
Time to last follow-up (y) 9.09 (6.67, 11.12)
Lenke classification
    1 48 (56%)
    2 8 (9.3%)
    3 9 (10%)
    4 3 (3.5%)
    5 17 (20%)
    not classifiable 1 (1.2%)
1 Median (Q1, Q3); n (%)

Table14

Table 14. Demographics Danespine and at last follow-up
Variable
Demographics DaneSpine
Demographics FU
N = 1331 N = 861
Age at surgery 15.00 (14.00, 17.00) 16.00 (14.00, 17.00)
Sex

    Female 92 (69%) 69 (80%)
    Male 41 (31%) 17 (20%)
Time to last follow-up (y)
9.09 (6.67, 11.12)
Lenke classification

1
48 (56%)
2
8 (9.3%)
3
9 (10%)
4
3 (3.5%)
5
17 (20%)
not classifiable
1 (1.2%)
1 Median (Q1, Q3); n (%)