##Load Library

library(cluster)
library(vegan)
## Loading required package: permute
## Loading required package: lattice
## This is vegan 2.6-4
library(mice)
## 
## Attaching package: 'mice'
## The following object is masked from 'package:stats':
## 
##     filter
## The following objects are masked from 'package:base':
## 
##     cbind, rbind
library(vegan3d)
## Registered S3 methods overwritten by 'vegan3d':
##   method            from 
##   plot.orditkplot   vegan
##   points.orditkplot vegan
##   scores.orditkplot vegan
##   text.orditkplot   vegan
## 
## Attaching package: 'vegan3d'
## The following object is masked from 'package:vegan':
## 
##     orditkplot
library(rgl)
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(gt)
library(ecolTest)

##Load Data

df <- read.csv("~/Spring 2024 Analysis/03_06_wimpreshaped.csv")
df.label <- df
rownames(df) <- df$patientID
rownames(df.label) <- df.label$patientID

##Create Bray-Curtis Dissimilarity Matrix K = 5

bc.df <- vegdist(df[, -1], method = "bray")
bc.nmds <- metaMDS(bc.df, k = 5)
## Run 0 stress 0.100456 
## Run 1 stress 0.1028126 
## Run 2 stress 0.0999917 
## ... New best solution
## ... Procrustes: rmse 0.03955766  max resid 0.2003513 
## Run 3 stress 0.100691 
## Run 4 stress 0.1003921 
## ... Procrustes: rmse 0.02626809  max resid 0.2036821 
## Run 5 stress 0.1011025 
## Run 6 stress 0.09995234 
## ... New best solution
## ... Procrustes: rmse 0.03745685  max resid 0.174586 
## Run 7 stress 0.1000724 
## ... Procrustes: rmse 0.01584648  max resid 0.1107915 
## Run 8 stress 0.09974863 
## ... New best solution
## ... Procrustes: rmse 0.01395123  max resid 0.1106837 
## Run 9 stress 0.1004439 
## Run 10 stress 0.1008212 
## Run 11 stress 0.1007872 
## Run 12 stress 0.1003616 
## Run 13 stress 0.09982063 
## ... Procrustes: rmse 0.03319124  max resid 0.1977776 
## Run 14 stress 0.09985513 
## ... Procrustes: rmse 0.03250572  max resid 0.1967259 
## Run 15 stress 0.0998246 
## ... Procrustes: rmse 0.02606871  max resid 0.16624 
## Run 16 stress 0.09972752 
## ... New best solution
## ... Procrustes: rmse 0.03184187  max resid 0.1964754 
## Run 17 stress 0.09989071 
## ... Procrustes: rmse 0.02852777  max resid 0.1923657 
## Run 18 stress 0.1007792 
## Run 19 stress 0.1004008 
## Run 20 stress 0.1002175 
## ... Procrustes: rmse 0.03980266  max resid 0.181249 
## *** Best solution was not repeated -- monoMDS stopping criteria:
##     18: no. of iterations >= maxit
##      2: stress ratio > sratmax

##Sheppards Test/Goodness of Fit + Plot

#shepards test/goodness of fit
goodness(bc.nmds)
##  [1] 0.006239293 0.012928383 0.015781720 0.010749206 0.010126939 0.010491241
##  [7] 0.009095497 0.010250590 0.015884863 0.013068478 0.012983790 0.014380482
## [13] 0.012168427 0.010240933 0.015463911 0.009410565 0.010823394 0.009259907
## [19] 0.016032795 0.013777080 0.014967095 0.010935054 0.012712017 0.009184557
## [25] 0.010988033 0.009231708 0.011092675 0.007565714 0.010689163 0.012129127
## [31] 0.008537647 0.005811253 0.012622963 0.011906492 0.013102393 0.009920484
## [37] 0.008808241 0.013318843 0.010239729 0.015681831 0.008023484 0.012476284
## [43] 0.009325798 0.009189075 0.010319640 0.008023484 0.010349978 0.012494280
## [49] 0.008440334 0.008409907 0.007966806 0.008123977 0.007961913 0.012517281
## [55] 0.011286338 0.006814091 0.010186489 0.008888280 0.007263204 0.009304598
## [61] 0.010182452 0.009953562 0.010690728 0.013551202 0.010561355 0.009276937
## [67] 0.008099057 0.007488717 0.007540704 0.007018132 0.006239359 0.006117995
## [73] 0.006478621 0.009743324 0.009837674 0.006658546 0.009623904 0.007864904
## [79] 0.006242787 0.015413059 0.008872156 0.010815483 0.008674632 0.007215805
## [85] 0.010568082 0.007303781 0.008184188 0.006646624 0.011423645 0.007978229
## [91] 0.005729226 0.008615373
stressplot(bc.nmds)

##Permdisp (Tests whether spread of data in space is similar across different groups)

permdisp_result_bc <- betadisper(bc.df, group = df$pneumonia, type = "centroid")

summary(permdisp_result_bc)
##                 Length Class  Mode   
## eig               89   -none- numeric
## vectors         8188   -none- numeric
## distances         92   -none- numeric
## group             92   factor numeric
## centroids        178   -none- numeric
## group.distances    2   -none- numeric
## call               4   -none- call
perm_test_result_bc <- permutest(permdisp_result_bc, permutations = 9999)
print(perm_test_result_bc)
## 
## Permutation test for homogeneity of multivariate dispersions
## Permutation: free
## Number of permutations: 9999
## 
## Response: Distances
##           Df  Sum Sq    Mean Sq      F N.Perm Pr(>F)
## Groups     1 0.00073 0.00072966 0.2684   9999 0.6013
## Residuals 90 0.24468 0.00271868

##Permanova

permanova_bc <- adonis2(bc.df ~ df$pneumonia)
print(permanova_bc)
## Permutation test for adonis under reduced model
## Terms added sequentially (first to last)
## Permutation: free
## Number of permutations: 999
## 
## adonis2(formula = bc.df ~ df$pneumonia)
##              Df SumOfSqs      R2      F Pr(>F)  
## df$pneumonia  1    0.631 0.01583 1.4481  0.048 *
## Residual     90   39.232 0.98417                
## Total        91   39.863 1.00000                
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

##NMDS with Spider

nmds_scores <- scores(bc.nmds, display = "sites")
x <- nmds_scores[,1]
y <- nmds_scores[,2]
z <- nmds_scores[,3]

# Determine colors based on pneumonia status
colors <- ifelse(df.label$pneumonia == "1", "red", "blue")

# Split data into two groups based on pneumonia status
group1_indices <- which(df.label$pneumonia == "1")
group2_indices <- which(df.label$pneumonia == "0")

# Calculate centroids for each group
center_x_group1 <- mean(x[group1_indices])
center_y_group1 <- mean(y[group1_indices])
center_z_group1 <- mean(z[group1_indices])

center_x_group2 <- mean(x[group2_indices])
center_y_group2 <- mean(y[group2_indices])
center_z_group2 <- mean(z[group2_indices])

# Plot the NMDS plot in 3D
plot3d(x, y, z, col = colors, size = 3)

# Add spiders for Group 1 (Pneumonia)
for (i in group1_indices) {
  segments3d(x = c(x[i], center_x_group1), y = c(y[i], center_y_group1), z = c(z[i], center_z_group1), col = "gray")
}

# Add spiders for Group 2 (No Pneumonia)
for (i in group2_indices) {
  segments3d(x = c(x[i], center_x_group2), y = c(y[i], center_y_group2), z = c(z[i], center_z_group2), col = "gray")
}

# Highlight the centroids
spheres3d(center_x_group1, center_y_group1, center_z_group1, radius = 0.05, color = "red")
spheres3d(center_x_group2, center_y_group2, center_z_group2, radius = 0.05, color = "blue")

rglwidget()

##PERMANOVA Table for Bray Curtis

library(gt)

# Create a data frame with the Bray-Curtis PERMANOVA output
permanova_data <- data.frame(
  Source = c("df$pneumonia", "Residuals", "Total"),
  Df = c(1, 90, 91),
  SumsOfSqs = c(0.631, 39.232, 39.863),   # Adjusted values to match output
  MeanSqs = c(0.631/1, 39.232/90, NA),    # Calculate MeanSqs as SumOfSqs/Df
  F_Model = c(1.4481, NA, NA),            # Adjusted F values and NAs where applicable
  R2 = c(0.01583, 0.98417, 1.00000),      # R2 values as per the output
  Pr_F = c("0.036 *", NA, NA)             # Pr(>F) with significance notation
)

# Use gt to create and format the table
gt_table <- gt(permanova_data) %>%
  tab_header(
    title = "Bray-Curtis PERMANOVA Results"
  ) %>%
  cols_label(
    Source = "Source",
    Df = "Degrees of Freedom",
    SumsOfSqs = "Sum of Squares",
    MeanSqs = "Mean Squares",
    F_Model = "F Model",
    R2 = "R²",
    Pr_F = "Pr(>F)"
  ) %>%
  tab_style(
    style = cell_text(weight = "bold"),
    locations = cells_column_labels()
  ) %>%
  fmt_missing(
    columns = c("MeanSqs", "F_Model", "Pr_F"),
    missing_text = "-"
  ) %>%
  tab_footnote(
    footnote = "Signif. codes: ‘*’ 0.05",
    locations = cells_body(columns = vars(Pr_F), rows = Pr_F == "0.036 *")
  )
## Warning: Since gt v0.6.0 the `fmt_missing()` function is deprecated and will soon be
## removed.
## • Use the `sub_missing()` function instead.
## This warning is displayed once every 8 hours.
## Warning: Since gt v0.3.0, `columns = vars(...)` has been deprecated.
## • Please use `columns = c(...)` instead.
# Display the table
print(gt_table)
## <div id="sobbdmzqla" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
##   <style>#sobbdmzqla table {
##   font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
##   -webkit-font-smoothing: antialiased;
##   -moz-osx-font-smoothing: grayscale;
## }
## 
## #sobbdmzqla thead, #sobbdmzqla tbody, #sobbdmzqla tfoot, #sobbdmzqla tr, #sobbdmzqla td, #sobbdmzqla th {
##   border-style: none;
## }
## 
## #sobbdmzqla p {
##   margin: 0;
##   padding: 0;
## }
## 
## #sobbdmzqla .gt_table {
##   display: table;
##   border-collapse: collapse;
##   line-height: normal;
##   margin-left: auto;
##   margin-right: auto;
##   color: #333333;
##   font-size: 16px;
##   font-weight: normal;
##   font-style: normal;
##   background-color: #FFFFFF;
##   width: auto;
##   border-top-style: solid;
##   border-top-width: 2px;
##   border-top-color: #A8A8A8;
##   border-right-style: none;
##   border-right-width: 2px;
##   border-right-color: #D3D3D3;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #A8A8A8;
##   border-left-style: none;
##   border-left-width: 2px;
##   border-left-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_caption {
##   padding-top: 4px;
##   padding-bottom: 4px;
## }
## 
## #sobbdmzqla .gt_title {
##   color: #333333;
##   font-size: 125%;
##   font-weight: initial;
##   padding-top: 4px;
##   padding-bottom: 4px;
##   padding-left: 5px;
##   padding-right: 5px;
##   border-bottom-color: #FFFFFF;
##   border-bottom-width: 0;
## }
## 
## #sobbdmzqla .gt_subtitle {
##   color: #333333;
##   font-size: 85%;
##   font-weight: initial;
##   padding-top: 3px;
##   padding-bottom: 5px;
##   padding-left: 5px;
##   padding-right: 5px;
##   border-top-color: #FFFFFF;
##   border-top-width: 0;
## }
## 
## #sobbdmzqla .gt_heading {
##   background-color: #FFFFFF;
##   text-align: center;
##   border-bottom-color: #FFFFFF;
##   border-left-style: none;
##   border-left-width: 1px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 1px;
##   border-right-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_bottom_border {
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_col_headings {
##   border-top-style: solid;
##   border-top-width: 2px;
##   border-top-color: #D3D3D3;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   border-left-style: none;
##   border-left-width: 1px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 1px;
##   border-right-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_col_heading {
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: normal;
##   text-transform: inherit;
##   border-left-style: none;
##   border-left-width: 1px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 1px;
##   border-right-color: #D3D3D3;
##   vertical-align: bottom;
##   padding-top: 5px;
##   padding-bottom: 6px;
##   padding-left: 5px;
##   padding-right: 5px;
##   overflow-x: hidden;
## }
## 
## #sobbdmzqla .gt_column_spanner_outer {
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: normal;
##   text-transform: inherit;
##   padding-top: 0;
##   padding-bottom: 0;
##   padding-left: 4px;
##   padding-right: 4px;
## }
## 
## #sobbdmzqla .gt_column_spanner_outer:first-child {
##   padding-left: 0;
## }
## 
## #sobbdmzqla .gt_column_spanner_outer:last-child {
##   padding-right: 0;
## }
## 
## #sobbdmzqla .gt_column_spanner {
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   vertical-align: bottom;
##   padding-top: 5px;
##   padding-bottom: 5px;
##   overflow-x: hidden;
##   display: inline-block;
##   width: 100%;
## }
## 
## #sobbdmzqla .gt_spanner_row {
##   border-bottom-style: hidden;
## }
## 
## #sobbdmzqla .gt_group_heading {
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: initial;
##   text-transform: inherit;
##   border-top-style: solid;
##   border-top-width: 2px;
##   border-top-color: #D3D3D3;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   border-left-style: none;
##   border-left-width: 1px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 1px;
##   border-right-color: #D3D3D3;
##   vertical-align: middle;
##   text-align: left;
## }
## 
## #sobbdmzqla .gt_empty_group_heading {
##   padding: 0.5px;
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: initial;
##   border-top-style: solid;
##   border-top-width: 2px;
##   border-top-color: #D3D3D3;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   vertical-align: middle;
## }
## 
## #sobbdmzqla .gt_from_md > :first-child {
##   margin-top: 0;
## }
## 
## #sobbdmzqla .gt_from_md > :last-child {
##   margin-bottom: 0;
## }
## 
## #sobbdmzqla .gt_row {
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
##   margin: 10px;
##   border-top-style: solid;
##   border-top-width: 1px;
##   border-top-color: #D3D3D3;
##   border-left-style: none;
##   border-left-width: 1px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 1px;
##   border-right-color: #D3D3D3;
##   vertical-align: middle;
##   overflow-x: hidden;
## }
## 
## #sobbdmzqla .gt_stub {
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: initial;
##   text-transform: inherit;
##   border-right-style: solid;
##   border-right-width: 2px;
##   border-right-color: #D3D3D3;
##   padding-left: 5px;
##   padding-right: 5px;
## }
## 
## #sobbdmzqla .gt_stub_row_group {
##   color: #333333;
##   background-color: #FFFFFF;
##   font-size: 100%;
##   font-weight: initial;
##   text-transform: inherit;
##   border-right-style: solid;
##   border-right-width: 2px;
##   border-right-color: #D3D3D3;
##   padding-left: 5px;
##   padding-right: 5px;
##   vertical-align: top;
## }
## 
## #sobbdmzqla .gt_row_group_first td {
##   border-top-width: 2px;
## }
## 
## #sobbdmzqla .gt_row_group_first th {
##   border-top-width: 2px;
## }
## 
## #sobbdmzqla .gt_summary_row {
##   color: #333333;
##   background-color: #FFFFFF;
##   text-transform: inherit;
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
## }
## 
## #sobbdmzqla .gt_first_summary_row {
##   border-top-style: solid;
##   border-top-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_first_summary_row.thick {
##   border-top-width: 2px;
## }
## 
## #sobbdmzqla .gt_last_summary_row {
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_grand_summary_row {
##   color: #333333;
##   background-color: #FFFFFF;
##   text-transform: inherit;
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
## }
## 
## #sobbdmzqla .gt_first_grand_summary_row {
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
##   border-top-style: double;
##   border-top-width: 6px;
##   border-top-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_last_grand_summary_row_top {
##   padding-top: 8px;
##   padding-bottom: 8px;
##   padding-left: 5px;
##   padding-right: 5px;
##   border-bottom-style: double;
##   border-bottom-width: 6px;
##   border-bottom-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_striped {
##   background-color: rgba(128, 128, 128, 0.05);
## }
## 
## #sobbdmzqla .gt_table_body {
##   border-top-style: solid;
##   border-top-width: 2px;
##   border-top-color: #D3D3D3;
##   border-bottom-style: solid;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_footnotes {
##   color: #333333;
##   background-color: #FFFFFF;
##   border-bottom-style: none;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   border-left-style: none;
##   border-left-width: 2px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 2px;
##   border-right-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_footnote {
##   margin: 0px;
##   font-size: 90%;
##   padding-top: 4px;
##   padding-bottom: 4px;
##   padding-left: 5px;
##   padding-right: 5px;
## }
## 
## #sobbdmzqla .gt_sourcenotes {
##   color: #333333;
##   background-color: #FFFFFF;
##   border-bottom-style: none;
##   border-bottom-width: 2px;
##   border-bottom-color: #D3D3D3;
##   border-left-style: none;
##   border-left-width: 2px;
##   border-left-color: #D3D3D3;
##   border-right-style: none;
##   border-right-width: 2px;
##   border-right-color: #D3D3D3;
## }
## 
## #sobbdmzqla .gt_sourcenote {
##   font-size: 90%;
##   padding-top: 4px;
##   padding-bottom: 4px;
##   padding-left: 5px;
##   padding-right: 5px;
## }
## 
## #sobbdmzqla .gt_left {
##   text-align: left;
## }
## 
## #sobbdmzqla .gt_center {
##   text-align: center;
## }
## 
## #sobbdmzqla .gt_right {
##   text-align: right;
##   font-variant-numeric: tabular-nums;
## }
## 
## #sobbdmzqla .gt_font_normal {
##   font-weight: normal;
## }
## 
## #sobbdmzqla .gt_font_bold {
##   font-weight: bold;
## }
## 
## #sobbdmzqla .gt_font_italic {
##   font-style: italic;
## }
## 
## #sobbdmzqla .gt_super {
##   font-size: 65%;
## }
## 
## #sobbdmzqla .gt_footnote_marks {
##   font-size: 75%;
##   vertical-align: 0.4em;
##   position: initial;
## }
## 
## #sobbdmzqla .gt_asterisk {
##   font-size: 100%;
##   vertical-align: 0;
## }
## 
## #sobbdmzqla .gt_indent_1 {
##   text-indent: 5px;
## }
## 
## #sobbdmzqla .gt_indent_2 {
##   text-indent: 10px;
## }
## 
## #sobbdmzqla .gt_indent_3 {
##   text-indent: 15px;
## }
## 
## #sobbdmzqla .gt_indent_4 {
##   text-indent: 20px;
## }
## 
## #sobbdmzqla .gt_indent_5 {
##   text-indent: 25px;
## }
## </style>
##   <table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
##   <thead>
##     <tr class="gt_heading">
##       <td colspan="7" class="gt_heading gt_title gt_font_normal gt_bottom_border" style>Bray-Curtis PERMANOVA Results</td>
##     </tr>
##     
##     <tr class="gt_col_headings">
##       <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="Source">Source</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="Degrees of Freedom">Degrees of Freedom</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="Sum of Squares">Sum of Squares</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="Mean Squares">Mean Squares</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="F Model">F Model</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="R²">R²</th>
##       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="font-weight: bold;" scope="col" id="Pr(&amp;gt;F)">Pr(&gt;F)</th>
##     </tr>
##   </thead>
##   <tbody class="gt_table_body">
##     <tr><td headers="Source" class="gt_row gt_left">df$pneumonia</td>
## <td headers="Df" class="gt_row gt_right">1</td>
## <td headers="SumsOfSqs" class="gt_row gt_right">0.631</td>
## <td headers="MeanSqs" class="gt_row gt_right">0.6310000</td>
## <td headers="F_Model" class="gt_row gt_right">1.4481</td>
## <td headers="R2" class="gt_row gt_right">0.01583</td>
## <td headers="Pr_F" class="gt_row gt_right"><span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"><sup>1</sup></span> 0.036 *</td></tr>
##     <tr><td headers="Source" class="gt_row gt_left">Residuals</td>
## <td headers="Df" class="gt_row gt_right">90</td>
## <td headers="SumsOfSqs" class="gt_row gt_right">39.232</td>
## <td headers="MeanSqs" class="gt_row gt_right">0.4359111</td>
## <td headers="F_Model" class="gt_row gt_right">-</td>
## <td headers="R2" class="gt_row gt_right">0.98417</td>
## <td headers="Pr_F" class="gt_row gt_right">-</td></tr>
##     <tr><td headers="Source" class="gt_row gt_left">Total</td>
## <td headers="Df" class="gt_row gt_right">91</td>
## <td headers="SumsOfSqs" class="gt_row gt_right">39.863</td>
## <td headers="MeanSqs" class="gt_row gt_right">-</td>
## <td headers="F_Model" class="gt_row gt_right">-</td>
## <td headers="R2" class="gt_row gt_right">1.00000</td>
## <td headers="Pr_F" class="gt_row gt_right">-</td></tr>
##   </tbody>
##   
##   <tfoot class="gt_footnotes">
##     <tr>
##       <td class="gt_footnote" colspan="7"><span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"><sup>1</sup></span> Signif. codes: ‘*’ 0.05</td>
##     </tr>
##   </tfoot>
## </table>
## </div>