Analysis of feet and leg features

Effect of diet on automatically extracted features

Author

Juan Steibel

Published

December 16, 2024

Code
# good habit to run is the sessionInfo() function to print all relevant info
sessionInfo()
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

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

loaded via a namespace (and not attached):
 [1] htmlwidgets_1.6.4 compiler_4.4.2    fastmap_1.2.0     cli_3.6.3        
 [5] tools_4.4.2       htmltools_0.5.8.1 rstudioapi_0.17.1 yaml_2.3.10      
 [9] rmarkdown_2.29    knitr_1.49        jsonlite_1.8.9    xfun_0.49        
[13] digest_0.6.37     rlang_1.1.4       evaluate_1.0.1   
Code
# remove all objects if restarting script
rm(list=ls())

knitr::opts_knit$set(root.dir = "C:/Users/jsteibel/OneDrive/Documents/mina/")
getwd()
[1] "C:/Users/jsteibel/OneDrive/Documents/mina"
Code
# list all objects in your environment
ls()
character(0)
Code
# set tibble width for printing - print all columns
options(tibble.width = Inf)

# remove scientific notation (by default will print)
options(scipen=999)

First read and summarize data

Code
library(readxl)
library(readr)
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
Code
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Code
library(lme4)
Loading required package: Matrix

Attaching package: 'Matrix'

The following objects are masked from 'package:tidyr':

    expand, pack, unpack
Code
library(lmerTest)

Attaching package: 'lmerTest'

The following object is masked from 'package:lme4':

    lmer

The following object is masked from 'package:stats':

    step
Code
library(mmrm)
library(GGally)
Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2
Code
library(car)
Loading required package: carData
mmrm() registered as car::Anova extension

Attaching package: 'car'

The following object is masked from 'package:purrr':

    some

The following object is masked from 'package:dplyr':

    recode
Code
library(emmeans)
mmrm() registered as emmeans extension
Welcome to emmeans.
Caution: You lose important information if you filter this package's results.
See '? untidy'

Attaching package: 'emmeans'

The following object is masked from 'package:GGally':

    pigs
Code
library(broom.mixed)
rm(list=ls())

workdir<- "C:/Users/jsteibel/OneDrive/Documents/mina/"
features_file<-"4weeksfeaturesID.csv"
metadata_file<-"MasterSheetEF_4.18.23.xlsx"

features<-read_csv(paste0(workdir,features_file))
New names:
Rows: 256 Columns: 15
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," dbl
(14): PigID, KneeLeft, KneeRigth, HeelLeft, HeelRigth, Back, HockLeft, H... lgl
(1): ...15
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `` -> `...15`
Code
features
# A tibble: 256 × 15
   PigID KneeLeft KneeRigth HeelLeft HeelRigth  Back HockLeft HockRigth
   <dbl>    <dbl>     <dbl>    <dbl>     <dbl> <dbl>    <dbl>     <dbl>
 1  1483     135.      144.     136.     107.   167.     136.      136.
 2   450     142.      146.     132.     136.   164.     141.      137.
 3  1490     143.      147.     124.      93.8  168.     154.      151.
 4  4851     155.      144.     130.     144.   170.     138.      135.
 5   411     145.      142.     142.     124.   167.     142.      142.
 6  4891     151.      151.     137.     133.   159.     147.      137.
 7   397     141.      143.     136.     131.   165.     145.      142.
 8  4971     141.      145.     142.     134.   168.     139.      135.
 9   465     135.      145.     142.     153.   170.     135.      135.
10   443     138.      133.     143.     145.   169.     137.      128.
   ShoulderLeft ShoulderRigth Locomotion FrontLeg RearLeg  Week ...15
          <dbl>         <dbl>      <dbl>    <dbl>   <dbl> <dbl> <lgl>
 1         109.          120.          0        4       5     1 NA   
 2         121.          126.          0        4       6     1 NA   
 3         109.          117.          0        4       5     1 NA   
 4         117.          112.          0        5       5     1 NA   
 5         120.          105.          0        5       5     1 NA   
 6         134.          116.          0        4       5     1 NA   
 7         117.          104.          0        5       5     1 NA   
 8         113.          105.          0        4       4     1 NA   
 9         116.          140.          0        5       5     1 NA   
10         118.          118.          0        4       5     1 NA   
# ℹ 246 more rows
Code
mtd<-read_xlsx(paste0(workdir,metadata_file),sheet = "Full")%>%dplyr::select(Pen,Sex,"PigID",TRT)
mtd
# A tibble: 64 × 4
     Pen Sex   PigID   TRT
   <dbl> <chr> <dbl> <dbl>
 1     1 B       310     1
 2     1 B       495     1
 3     2 B       309     2
 4     2 B       492     2
 5     3 B       292     3
 6     3 B         6     3
 7     4 B       481     4
 8     4 B       487     4
 9    11 B       485     1
10    11 B       493     1
# ℹ 54 more rows
Code
dts<-left_join(features,mtd,by ="PigID")
dts
# A tibble: 256 × 18
   PigID KneeLeft KneeRigth HeelLeft HeelRigth  Back HockLeft HockRigth
   <dbl>    <dbl>     <dbl>    <dbl>     <dbl> <dbl>    <dbl>     <dbl>
 1  1483     135.      144.     136.     107.   167.     136.      136.
 2   450     142.      146.     132.     136.   164.     141.      137.
 3  1490     143.      147.     124.      93.8  168.     154.      151.
 4  4851     155.      144.     130.     144.   170.     138.      135.
 5   411     145.      142.     142.     124.   167.     142.      142.
 6  4891     151.      151.     137.     133.   159.     147.      137.
 7   397     141.      143.     136.     131.   165.     145.      142.
 8  4971     141.      145.     142.     134.   168.     139.      135.
 9   465     135.      145.     142.     153.   170.     135.      135.
10   443     138.      133.     143.     145.   169.     137.      128.
   ShoulderLeft ShoulderRigth Locomotion FrontLeg RearLeg  Week ...15   Pen
          <dbl>         <dbl>      <dbl>    <dbl>   <dbl> <dbl> <lgl> <dbl>
 1         109.          120.          0        4       5     1 NA       32
 2         121.          126.          0        4       6     1 NA       33
 3         109.          117.          0        4       5     1 NA       34
 4         117.          112.          0        5       5     1 NA       42
 5         120.          105.          0        5       5     1 NA       51
 6         134.          116.          0        4       5     1 NA       53
 7         117.          104.          0        5       5     1 NA       54
 8         113.          105.          0        4       4     1 NA       54
 9         116.          140.          0        5       5     1 NA       61
10         118.          118.          0        4       5     1 NA       61
   Sex     TRT
   <chr> <dbl>
 1 G         2
 2 G         3
 3 G         4
 4 B         2
 5 B         1
 6 B         3
 7 B         4
 8 B         4
 9 G         1
10 G         1
# ℹ 246 more rows
Code
dts<-mutate(dts,period=as.factor(Week),Pen=as.factor(Pen),ID=as.factor(PigID),
            TRT=as.factor(TRT),Sex=as.factor(Sex))
dts
# A tibble: 256 × 20
   PigID KneeLeft KneeRigth HeelLeft HeelRigth  Back HockLeft HockRigth
   <dbl>    <dbl>     <dbl>    <dbl>     <dbl> <dbl>    <dbl>     <dbl>
 1  1483     135.      144.     136.     107.   167.     136.      136.
 2   450     142.      146.     132.     136.   164.     141.      137.
 3  1490     143.      147.     124.      93.8  168.     154.      151.
 4  4851     155.      144.     130.     144.   170.     138.      135.
 5   411     145.      142.     142.     124.   167.     142.      142.
 6  4891     151.      151.     137.     133.   159.     147.      137.
 7   397     141.      143.     136.     131.   165.     145.      142.
 8  4971     141.      145.     142.     134.   168.     139.      135.
 9   465     135.      145.     142.     153.   170.     135.      135.
10   443     138.      133.     143.     145.   169.     137.      128.
   ShoulderLeft ShoulderRigth Locomotion FrontLeg RearLeg  Week ...15 Pen  
          <dbl>         <dbl>      <dbl>    <dbl>   <dbl> <dbl> <lgl> <fct>
 1         109.          120.          0        4       5     1 NA    32   
 2         121.          126.          0        4       6     1 NA    33   
 3         109.          117.          0        4       5     1 NA    34   
 4         117.          112.          0        5       5     1 NA    42   
 5         120.          105.          0        5       5     1 NA    51   
 6         134.          116.          0        4       5     1 NA    53   
 7         117.          104.          0        5       5     1 NA    54   
 8         113.          105.          0        4       4     1 NA    54   
 9         116.          140.          0        5       5     1 NA    61   
10         118.          118.          0        4       5     1 NA    61   
   Sex   TRT   period ID   
   <fct> <fct> <fct>  <fct>
 1 G     2     1      1483 
 2 G     3     1      450  
 3 G     4     1      1490 
 4 B     2     1      4851 
 5 B     1     1      411  
 6 B     3     1      4891 
 7 B     4     1      397  
 8 B     4     1      4971 
 9 G     1     1      465  
10 G     1     1      443  
# ℹ 246 more rows

How NOT to do stuff

Look at the intuitive (and dated way of doing things in R): copying and pasting the same code multiple times.

Code
w2<-filter(dts,Week==3)
w2
# A tibble: 64 × 20
   PigID KneeLeft KneeRigth HeelLeft HeelRigth  Back HockLeft HockRigth
   <dbl>    <dbl>     <dbl>    <dbl>     <dbl> <dbl>    <dbl>     <dbl>
 1   438     144.      140.     146.      158.  158.     145.      138.
 2   318     144.      139.     144.      149.  168.     146.      143.
 3   497     145.      146.     146.      149.  161.     146.      133.
 4   464     158.      143.     140.      153.  151.     149.      137.
 5   321     149.      141.     137.      152.  159.     145.      139.
 6   470     144.      142.     145.      152.  165.     141.      135.
 7  1487     142.      147.     140.      150.  165.     144.      136.
 8  1486     147.      145.     139.      148.  165.     143.      139.
 9   447     142.      142.     144.      152.  165.     143.      141.
10   454     150.      140.     129.      133.  153.     145.      142.
   ShoulderLeft ShoulderRigth Locomotion FrontLeg RearLeg  Week ...15 Pen  
          <dbl>         <dbl>      <dbl>    <dbl>   <dbl> <dbl> <lgl> <fct>
 1         122.          126.          0        4       5     3 NA    74   
 2         123.          112.          0        5       5     3 NA    74   
 3         118.          111.          0        5       6     3 NA    73   
 4         127.          110.          0        5       5     3 NA    73   
 5         131.          123.          1        4       5     3 NA    72   
 6         123.          113.          0        4       5     3 NA    72   
 7         121.          116.          0        5       5     3 NA    71   
 8         122.          111.          1        4       5     3 NA    71   
 9         120.          109.          0        4       5     3 NA    64   
10         132.          110.          0        4       5     3 NA    64   
   Sex   TRT   period ID   
   <fct> <fct> <fct>  <fct>
 1 G     4     3      438  
 2 G     4     3      318  
 3 G     3     3      497  
 4 G     3     3      464  
 5 G     2     3      321  
 6 G     2     3      470  
 7 G     1     3      1487 
 8 G     1     3      1486 
 9 G     4     3      447  
10 G     4     3      454  
# ℹ 54 more rows
Code
m1<-lmer(Locomotion~Sex*TRT+(1|Pen),data=w2)
Anova(m1,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: Locomotion
             Chisq Df Pr(>Chisq)   
(Intercept) 7.3846  1   0.006578 **
Sex         0.9231  1   0.336668   
TRT         4.1538  3   0.245324   
Sex:TRT     0.6923  3   0.875012   
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m1,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean   SE df lower.CL upper.CL
 1    0.625 0.13 24    0.356    0.894
 2    0.500 0.13 24    0.231    0.769
 3    0.375 0.13 24    0.106    0.644
 4    0.125 0.13 24   -0.144    0.394

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m1,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate    SE df t.ratio p.value
 TRT1 - TRT2    0.125 0.184 24   0.679  0.9039
 TRT1 - TRT3    0.250 0.184 24   1.359  0.5362
 TRT1 - TRT4    0.500 0.184 24   2.717  0.0546
 TRT2 - TRT3    0.125 0.184 24   0.679  0.9039
 TRT2 - TRT4    0.375 0.184 24   2.038  0.2024
 TRT3 - TRT4    0.250 0.184 24   1.359  0.5362

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m1<-lmer(FrontLeg~Sex*TRT+(1|Pen),data=w2)
Anova(m1)
Analysis of Deviance Table (Type II Wald chisquare tests)

Response: FrontLeg
         Chisq Df Pr(>Chisq)  
Sex     4.5849  1    0.03225 *
TRT     1.5283  3    0.67575  
Sex:TRT 3.3396  3    0.34217  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m1,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean    SE df lower.CL upper.CL
 1     4.19 0.131 24     3.92     4.46
 2     4.19 0.131 24     3.92     4.46
 3     4.19 0.131 24     3.92     4.46
 4     4.00 0.131 24     3.73     4.27

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m1,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate    SE df t.ratio p.value
 TRT1 - TRT2    0.000 0.186 24   0.000  1.0000
 TRT1 - TRT3    0.000 0.186 24   0.000  1.0000
 TRT1 - TRT4    0.188 0.186 24   1.009  0.7455
 TRT2 - TRT3    0.000 0.186 24   0.000  1.0000
 TRT2 - TRT4    0.188 0.186 24   1.009  0.7455
 TRT3 - TRT4    0.188 0.186 24   1.009  0.7455

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m1<-lmer(RearLeg~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova(m1,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: RearLeg
                Chisq Df          Pr(>Chisq)    
(Intercept) 1026.2169  1 <0.0000000000000002 ***
Sex            1.3494  1              0.2454    
TRT            1.8554  3              0.6029    
Sex:TRT        4.9759  3              0.1736    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m1,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean    SE df lower.CL upper.CL
 1     4.75 0.108 24     4.53     4.97
 2     5.12 0.108 24     4.90     5.35
 3     5.12 0.108 24     4.90     5.35
 4     5.06 0.108 24     4.84     5.28

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m1,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate    SE df t.ratio p.value
 TRT1 - TRT2  -0.3750 0.152 24  -2.464  0.0918
 TRT1 - TRT3  -0.3750 0.152 24  -2.464  0.0918
 TRT1 - TRT4  -0.3125 0.152 24  -2.054  0.1971
 TRT2 - TRT3   0.0000 0.152 24   0.000  1.0000
 TRT2 - TRT4   0.0625 0.152 24   0.411  0.9761
 TRT3 - TRT4   0.0625 0.152 24   0.411  0.9761

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(KneeLeft~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: KneeLeft
                 Chisq Df          Pr(>Chisq)    
(Intercept) 10189.5066  1 <0.0000000000000002 ***
Sex             0.7476  1              0.3872    
TRT             2.5067  3              0.4741    
Sex:TRT         2.1641  3              0.5391    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean   SE df lower.CL upper.CL
 1      146 1.03 24      144      148
 2      144 1.03 24      142      147
 3      145 1.03 24      143      147
 4      145 1.03 24      143      148

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2    1.415 1.45 24   0.973  0.7657
 TRT1 - TRT3    0.640 1.45 24   0.440  0.9708
 TRT1 - TRT4    0.382 1.45 24   0.263  0.9935
 TRT2 - TRT3   -0.775 1.45 24  -0.533  0.9502
 TRT2 - TRT4   -1.033 1.45 24  -0.710  0.8920
 TRT3 - TRT4   -0.258 1.45 24  -0.177  0.9980

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(KneeRigth~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: KneeRigth
                 Chisq Df          Pr(>Chisq)    
(Intercept) 14551.8944  1 <0.0000000000000002 ***
Sex             0.1828  1              0.6690    
TRT             3.9471  3              0.2672    
Sex:TRT         7.1058  3              0.0686 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean   SE df lower.CL upper.CL
 1      144 0.84 24      142      145
 2      145 0.84 24      143      146
 3      144 0.84 24      142      146
 4      144 0.84 24      142      146

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2  -0.8772 1.19 24  -0.738  0.8806
 TRT1 - TRT3  -0.2348 1.19 24  -0.198  0.9972
 TRT1 - TRT4  -0.2509 1.19 24  -0.211  0.9966
 TRT2 - TRT3   0.6425 1.19 24   0.541  0.9481
 TRT2 - TRT4   0.6263 1.19 24   0.527  0.9516
 TRT3 - TRT4  -0.0161 1.19 24  -0.014  1.0000

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(HeelLeft~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: HeelLeft
                Chisq Df            Pr(>Chisq)    
(Intercept) 9459.6374  1 < 0.00000000000000022 ***
Sex            0.0446  1             0.8327924    
TRT           16.5481  3             0.0008753 ***
Sex:TRT        3.4057  3             0.3332019    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean SE df lower.CL upper.CL
 1      138  1 24      136      140
 2      142  1 24      140      145
 3      143  1 24      141      145
 4      141  1 24      139      143

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2   -4.630 1.42 24  -3.272  0.0159
 TRT1 - TRT3   -5.343 1.42 24  -3.776  0.0048
 TRT1 - TRT4   -3.129 1.42 24  -2.211  0.1489
 TRT2 - TRT3   -0.713 1.42 24  -0.504  0.9574
 TRT2 - TRT4    1.501 1.42 24   1.061  0.7159
 TRT3 - TRT4    2.214 1.42 24   1.565  0.4167

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(HeelRigth~Sex*TRT+(1|Pen),data=w2)
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: HeelRigth
                Chisq Df          Pr(>Chisq)    
(Intercept) 6340.9020  1 <0.0000000000000002 ***
Sex            0.0558  1              0.8132    
TRT            6.0321  3              0.1101    
Sex:TRT        0.8419  3              0.8394    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean   SE df lower.CL upper.CL
 1      148 1.31 24      145      150
 2      151 1.31 24      149      154
 3      152 1.31 24      149      155
 4      151 1.31 24      149      154

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2  -3.5987 1.85 24  -1.944  0.2370
 TRT1 - TRT3  -4.3263 1.85 24  -2.337  0.1175
 TRT1 - TRT4  -3.6092 1.85 24  -1.950  0.2347
 TRT2 - TRT3  -0.7277 1.85 24  -0.393  0.9789
 TRT2 - TRT4  -0.0105 1.85 24  -0.006  1.0000
 TRT3 - TRT4   0.7171 1.85 24   0.387  0.9798

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(HockLeft~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: HockLeft
                 Chisq Df           Pr(>Chisq)    
(Intercept) 15588.9062  1 < 0.0000000000000002 ***
Sex             0.3058  1              0.58025    
TRT             9.4406  3              0.02397 *  
Sex:TRT         0.9048  3              0.82428    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean    SE df lower.CL upper.CL
 1      142 0.803 24      141      144
 2      145 0.803 24      143      147
 3      145 0.803 24      144      147
 4      146 0.803 24      144      147

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2   -2.796 1.14 24  -2.463  0.0920
 TRT1 - TRT3   -3.216 1.14 24  -2.833  0.0426
 TRT1 - TRT4   -3.630 1.14 24  -3.197  0.0189
 TRT2 - TRT3   -0.420 1.14 24  -0.370  0.9822
 TRT2 - TRT4   -0.834 1.14 24  -0.735  0.8821
 TRT3 - TRT4   -0.414 1.14 24  -0.364  0.9830

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(HockRigth~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: HockRigth
                 Chisq Df          Pr(>Chisq)    
(Intercept) 11333.9186  1 <0.0000000000000002 ***
Sex             0.4143  1              0.5198    
TRT             4.9086  3              0.1786    
Sex:TRT         1.7379  3              0.6285    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean    SE df lower.CL upper.CL
 1      137 0.904 24      135      139
 2      139 0.904 24      137      141
 3      138 0.904 24      136      140
 4      139 0.904 24      138      141

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2   -2.129 1.28 24  -1.666  0.3627
 TRT1 - TRT3   -1.335 1.28 24  -1.045  0.7254
 TRT1 - TRT4   -2.849 1.28 24  -2.229  0.1441
 TRT2 - TRT3    0.794 1.28 24   0.622  0.9241
 TRT2 - TRT4   -0.719 1.28 24  -0.563  0.9421
 TRT3 - TRT4   -1.514 1.28 24  -1.184  0.6422

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(Back~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: Back
                 Chisq Df          Pr(>Chisq)    
(Intercept) 13101.5268  1 <0.0000000000000002 ***
Sex             0.2824  1              0.5951    
TRT             1.4186  3              0.7012    
Sex:TRT         1.2613  3              0.7383    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean SE df lower.CL upper.CL
 1      163  1 24      161      165
 2      164  1 24      162      166
 3      162  1 24      160      164
 4      162  1 24      160      164

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2   -0.390 1.42 24  -0.274  0.9926
 TRT1 - TRT3    0.943 1.42 24   0.664  0.9096
 TRT1 - TRT4    1.314 1.42 24   0.925  0.7919
 TRT2 - TRT3    1.333 1.42 24   0.938  0.7849
 TRT2 - TRT4    1.704 1.42 24   1.199  0.6333
 TRT3 - TRT4    0.371 1.42 24   0.261  0.9936

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(ShoulderLeft~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: ShoulderLeft
                Chisq Df          Pr(>Chisq)    
(Intercept) 3496.2740  1 <0.0000000000000002 ***
Sex            0.5001  1              0.4795    
TRT            0.8723  3              0.8321    
Sex:TRT        0.8606  3              0.8349    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
 TRT emmean   SE df lower.CL upper.CL
 1      123 1.48 24      120      126
 2      127 1.48 24      124      130
 3      124 1.48 24      121      127
 4      125 1.48 24      122      128

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
Code
emmeans(m2,~TRT)%>%pairs()
NOTE: Results may be misleading due to involvement in interactions
 contrast    estimate  SE df t.ratio p.value
 TRT1 - TRT2   -3.546 2.1 24  -1.690  0.3507
 TRT1 - TRT3   -1.188 2.1 24  -0.566  0.9412
 TRT1 - TRT4   -2.159 2.1 24  -1.029  0.7344
 TRT2 - TRT3    2.358 2.1 24   1.124  0.6788
 TRT2 - TRT4    1.387 2.1 24   0.661  0.9106
 TRT3 - TRT4   -0.971 2.1 24  -0.463  0.9664

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 
Code
m2<-lmer(ShoulderRigth~Sex*TRT+(1|Pen),data=w2)
boundary (singular) fit: see help('isSingular')
Code
Anova (m2,type="III")
Analysis of Deviance Table (Type III Wald chisquare tests)

Response: ShoulderRigth
                Chisq Df          Pr(>Chisq)    
(Intercept) 3062.3510  1 <0.0000000000000002 ***
Sex            0.9750  1              0.3234    
TRT            8.4838  3              0.0370 *  
Sex:TRT        4.7821  3              0.1885    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
em2<-emmeans(m2,~TRT)
NOTE: Results may be misleading due to involvement in interactions
Code
em2%>%pairs()
 contrast    estimate   SE df t.ratio p.value
 TRT1 - TRT2    -2.93 2.04 24  -1.440  0.4877
 TRT1 - TRT3     1.48 2.04 24   0.724  0.8864
 TRT1 - TRT4    -1.81 2.04 24  -0.889  0.8107
 TRT2 - TRT3     4.41 2.04 24   2.165  0.1620
 TRT2 - TRT4     1.12 2.04 24   0.552  0.9452
 TRT3 - TRT4    -3.29 2.04 24  -1.613  0.3905

Results are averaged over the levels of: Sex 
Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 

How to do it with tidyverse

reformat

Code
data_long<-dts%>%ungroup()%>%select(-'...15')%>%pivot_longer(KneeLeft:RearLeg,names_to = "Pheno",values_to = "y") #move to long format
#check: Always check!
N_pivoted<-dts%>%ungroup()%>%select(KneeLeft:RearLeg)%>%ncol() #number of pivoted columns
N_obs<-nrow(dts) #number of rows in wide format
 
expected_length<-N_pivoted*N_obs #number of rows in long format: pivoted*rows in wide
expected_cols<-ncol(dts)-1-N_pivoted+2 #number of cols in long f: cols in wide -1 (15 fake column) - number pivoted +2 (value and name columns)

dim(data_long)
[1] 3072    9
Code
expected_length
[1] 3072
Code
expected_cols #all match!
[1] 9

fit model per trait

Code
lmef<-split(data_long,~data_long$Pheno+data_long$period)%>%map(lmer,formula=y~Sex*TRT+(1|Pen))
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
Warning: Model failed to converge with 1 negative eigenvalue: -2.6e-04
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
Code
length(lmef) #check splits: number of variables by number of periods (4) = 48
[1] 48
Code
anv<-lmef%>%map(Anova,type="III")%>%map(data.frame)%>%map(\(x) mutate(x,term=row.names(x),lpval= -log10(Pr..Chisq.+1.052954e-273)))%>% map_dfr(bind_rows,.id="Pheno")%>%as.tibble()
Warning: `as.tibble()` was deprecated in tibble 2.0.0.
ℹ Please use `as_tibble()` instead.
ℹ The signature and semantics have changed, see `?as_tibble`.
Code
dim(anv) #number of rows: 48*4 terms = 192
[1] 192   6
Code
emm<-lmef%>%map(emmeans,specs="TRT")
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
Code
emd<-emm%>%map(pairs)%>%map(data.frame)%>%map_dfr(bind_rows,.id="Pheno")
emm<-emm%>%map(data.frame)%>%map_dfr(bind_rows,.id="Pheno")
dim(emm) # #number of rows: 48*4 treatments = 192
[1] 192   7
Code
dim(emd) # #number of rows: 48*6 mean differences = 288
[1] 288   7

Represent results

A key step in highthroughput data analyses is to represent outputs in a meaningful way.

We start looking at the ANOVA tables

Code
anv<-mutate(anv,period=as.factor(str_split_i(Pheno,"[.]",2)),Pheno=as.factor(str_split_i(Pheno,"[.]",1)))
emm<-mutate(emm,period=as.factor(str_split_i(Pheno,"[.]",2)),Pheno=as.factor(str_split_i(Pheno,"[.]",1)))
emd<-mutate(emd,period=as.factor(str_split_i(Pheno,"[.]",2)),Pheno=as.factor(str_split_i(Pheno,"[.]",1)))


filter(anv,term=="Sex:TRT")%>%summary() #no interaction Sex by trt
       Pheno        Chisq              Df      Pr..Chisq.    
 Back     : 4   Min.   :0.3874   Min.   :3   Min.   :0.0686  
 FrontLeg : 4   1st Qu.:1.0039   1st Qu.:3   1st Qu.:0.3749  
 HeelLeft : 4   Median :1.8867   Median :3   Median :0.5966  
 HeelRigth: 4   Mean   :2.2919   Mean   :3   Mean   :0.5757  
 HockLeft : 4   3rd Qu.:3.1136   3rd Qu.:3   3rd Qu.:0.8003  
 HockRigth: 4   Max.   :7.1058   Max.   :3   Max.   :0.9428  
 (Other)  :24                                                
     term               lpval         period
 Length:48          Min.   :0.02557   1:12  
 Class :character   1st Qu.:0.09678   2:12  
 Mode  :character   Median :0.22469   3:12  
                    Mean   :0.30687   4:12  
                    3rd Qu.:0.42669         
                    Max.   :1.16367         
                                            
Code
sig10<-filter(anv,term=="TRT",lpval>1.3)%>%select(Pheno)%>%unlist()%>%as.character()
sig10
[1] "HeelLeft"      "HockLeft"      "ShoulderRigth"
Code
filter(anv,term=="TRT")%>%ggplot(aes(lpval,Pheno))+geom_col()+
  geom_vline(aes(xintercept=1.30103,color="5%"))+
  geom_vline(aes(xintercept=2.0,color="1%"))+
  facet_wrap(~period)

Code
filter(emm,Pheno%in%c("Locomotion","RearLeg","FrontLeg"))%>%ggplot(aes(x=TRT,y=emmean))+geom_bar(stat = "identity" )+
  geom_errorbar(aes(ymin = lower.CL, ymax = upper.CL),width=.2)+
  facet_grid(rows=vars(Pheno),cols=vars(period),scales="free")

Code
filter(emm,(Pheno%in%sig10))%>%ggplot(aes(x=TRT,y=emmean))+geom_bar(stat = "identity" )+
   geom_errorbar(aes(ymin = lower.CL, ymax = upper.CL),width=.2)+
  facet_grid(rows=vars(Pheno),cols=vars(period),scales="free")

Code
filter(emm,(Pheno%in%sig10))
           Pheno TRT   emmean        SE       df lower.CL upper.CL period
1       HeelLeft   1 137.6024 2.4280814 24.15710 132.5928 142.6120      1
2       HeelLeft   2 139.1028 2.3986888 23.20144 134.1431 144.0625      1
3       HeelLeft   3 141.3043 2.4280814 24.15710 136.2947 146.3139      1
4       HeelLeft   4 137.6680 2.4280814 24.15710 132.6585 142.6776      1
5       HockLeft   1 138.7786 2.0939140 24.09359 134.4578 143.0993      1
6       HockLeft   2 143.6907 2.0462553 22.60424 139.4536 147.9278      1
7       HockLeft   3 140.8840 2.0939140 24.09359 136.5632 145.2047      1
8       HockLeft   4 141.0238 2.0939140 24.09359 136.7031 145.3446      1
9  ShoulderRigth   1 121.2036 3.3608195 24.13149 114.2692 128.1380      1
10 ShoulderRigth   2 125.4265 3.2951195 22.77481 118.6063 132.2467      1
11 ShoulderRigth   3 122.5894 3.3608195 24.13149 115.6550 129.5238      1
12 ShoulderRigth   4 123.1106 3.3608195 24.13149 116.1762 130.0450      1
13      HeelLeft   1 139.7842 1.0376190 24.00000 137.6426 141.9257      2
14      HeelLeft   2 142.4436 1.0376190 24.00000 140.3020 144.5851      2
15      HeelLeft   3 143.5273 1.0376190 24.00000 141.3858 145.6688      2
16      HeelLeft   4 142.7436 1.0376190 24.00000 140.6020 144.8851      2
17      HockLeft   1 148.0227 1.5273191 24.00000 144.8704 151.1749      2
18      HockLeft   2 146.2462 1.5273191 24.00000 143.0940 149.3984      2
19      HockLeft   3 146.0816 1.5273191 24.00000 142.9294 149.2338      2
20      HockLeft   4 144.5845 1.5273191 24.00000 141.4323 147.7367      2
21 ShoulderRigth   1 116.0227 1.5588242 24.00000 112.8054 119.2399      2
22 ShoulderRigth   2 113.7261 1.5588242 24.00000 110.5089 116.9434      2
23 ShoulderRigth   3 113.5190 1.5588242 24.00000 110.3017 116.7362      2
24 ShoulderRigth   4 116.5432 1.5588242 24.00000 113.3259 119.7604      2
25      HeelLeft   1 137.8423 1.0006087 24.00000 135.7772 139.9075      3
26      HeelLeft   2 142.4722 1.0006087 24.00000 140.4070 144.5373      3
27      HeelLeft   3 143.1853 1.0006087 24.00000 141.1202 145.2505      3
28      HeelLeft   4 140.9710 1.0006087 24.00000 138.9058 143.0361      3
29      HockLeft   1 142.1882 0.8027541 24.00000 140.5314 143.8450      3
30      HockLeft   2 144.9839 0.8027541 24.00000 143.3271 146.6407      3
31      HockLeft   3 145.4044 0.8027541 24.00000 143.7476 147.0612      3
32      HockLeft   4 145.8181 0.8027541 24.00000 144.1613 147.4749      3
33 ShoulderRigth   1 114.1546 1.4404740 24.00000 111.1816 117.1275      3
34 ShoulderRigth   2 117.0886 1.4404740 24.00000 114.1156 120.0616      3
35 ShoulderRigth   3 112.6789 1.4404740 24.00000 109.7059 115.6519      3
36 ShoulderRigth   4 115.9648 1.4404740 24.00000 112.9919 118.9378      3
37      HeelLeft   1 140.1676 1.8803655 24.00000 136.2867 144.0484      4
38      HeelLeft   2 141.5092 1.8803655 24.00000 137.6283 145.3901      4
39      HeelLeft   3 145.2084 1.8803655 24.00000 141.3276 149.0893      4
40      HeelLeft   4 145.5826 1.8803655 24.00000 141.7017 149.4635      4
41      HockLeft   1 141.2591 1.8508824 24.00000 137.4391 145.0791      4
42      HockLeft   2 142.5497 1.8508824 24.00000 138.7297 146.3697      4
43      HockLeft   3 143.4125 1.8508824 24.00000 139.5924 147.2325      4
44      HockLeft   4 145.1643 1.8508824 24.00000 141.3443 148.9844      4
45 ShoulderRigth   1 113.5664 1.7072783 24.00000 110.0428 117.0901      4
46 ShoulderRigth   2 111.8618 1.7072783 24.00000 108.3381 115.3854      4
47 ShoulderRigth   3 113.3894 1.7072783 24.00000 109.8657 116.9130      4
48 ShoulderRigth   4 112.5120 1.7072783 24.00000 108.9883 116.0356      4
Code
filter(emd,(Pheno%in%sig10))
           Pheno    contrast    estimate       SE       df     t.ratio
1       HeelLeft TRT1 - TRT2 -1.50044271 3.413105 23.67959 -0.43961220
2       HeelLeft TRT1 - TRT3 -3.70192586 3.433826 24.15710 -1.07807625
3       HeelLeft TRT1 - TRT4 -0.06567285 3.433826 24.15710 -0.01912527
4       HeelLeft TRT2 - TRT3 -2.20148315 3.413105 23.67959 -0.64500887
5       HeelLeft TRT2 - TRT4  1.43476986 3.413105 23.67959  0.42037082
6       HeelLeft TRT3 - TRT4  3.63625301 3.433826 24.15710  1.05895098
7       HockLeft TRT1 - TRT2 -4.91216228 2.927736 23.35193 -1.67780245
8       HockLeft TRT1 - TRT3 -2.10540174 2.961242 24.09359 -0.71098613
9       HockLeft TRT1 - TRT4 -2.24523619 2.961242 24.09359 -0.75820769
10      HockLeft TRT2 - TRT3  2.80676054 2.927736 23.35193  0.95867959
11      HockLeft TRT2 - TRT4  2.66692609 2.927736 23.35193  0.91091761
12      HockLeft TRT3 - TRT4 -0.13983445 2.961242 24.09359 -0.04722156
13 ShoulderRigth TRT1 - TRT2 -4.22283372 4.706689 23.45502 -0.89719839
14 ShoulderRigth TRT1 - TRT3 -1.38575903 4.752917 24.13149 -0.29155972
15 ShoulderRigth TRT1 - TRT4 -1.90699533 4.752917 24.13149 -0.40122634
16 ShoulderRigth TRT2 - TRT3  2.83707469 4.706689 23.45502  0.60277506
17 ShoulderRigth TRT2 - TRT4  2.31583839 4.706689 23.45502  0.49203133
18 ShoulderRigth TRT3 - TRT4 -0.52123630 4.752917 24.13149 -0.10966662
19      HeelLeft TRT1 - TRT2 -2.65940408 1.467415 24.00000 -1.81230550
20      HeelLeft TRT1 - TRT3 -3.74312230 1.467415 24.00000 -2.55082752
21      HeelLeft TRT1 - TRT4 -2.95937263 1.467415 24.00000 -2.01672522
22      HeelLeft TRT2 - TRT3 -1.08371822 1.467415 24.00000 -0.73852202
23      HeelLeft TRT2 - TRT4 -0.29996854 1.467415 24.00000 -0.20441972
24      HeelLeft TRT3 - TRT4  0.78374968 1.467415 24.00000  0.53410230
25      HockLeft TRT1 - TRT2  1.77646631 2.159955 24.00000  0.82245509
26      HockLeft TRT1 - TRT3  1.94104176 2.159955 24.00000  0.89864900
27      HockLeft TRT1 - TRT4  3.43814307 2.159955 24.00000  1.59176577
28      HockLeft TRT2 - TRT3  0.16457545 2.159955 24.00000  0.07619391
29      HockLeft TRT2 - TRT4  1.66167676 2.159955 24.00000  0.76931068
30      HockLeft TRT3 - TRT4  1.49710131 2.159955 24.00000  0.69311677
31 ShoulderRigth TRT1 - TRT2  2.29654153 2.204510 24.00000  1.04174680
32 ShoulderRigth TRT1 - TRT3  2.50372945 2.204510 24.00000  1.13573045
33 ShoulderRigth TRT1 - TRT4 -0.52047381 2.204510 24.00000 -0.23609498
34 ShoulderRigth TRT2 - TRT3  0.20718792 2.204510 24.00000  0.09398365
35 ShoulderRigth TRT2 - TRT4 -2.81701534 2.204510 24.00000 -1.27784178
36 ShoulderRigth TRT3 - TRT4 -3.02420326 2.204510 24.00000 -1.37182543
37      HeelLeft TRT1 - TRT2 -4.62985755 1.415074 24.00000 -3.27181210
38      HeelLeft TRT1 - TRT3 -5.34298129 1.415074 24.00000 -3.77575998
39      HeelLeft TRT1 - TRT4 -3.12863891 1.415074 24.00000 -2.21093598
40      HeelLeft TRT2 - TRT3 -0.71312374 1.415074 24.00000 -0.50394788
41      HeelLeft TRT2 - TRT4  1.50121864 1.415074 24.00000  1.06087612
42      HeelLeft TRT3 - TRT4  2.21434238 1.415074 24.00000  1.56482400
43      HockLeft TRT1 - TRT2 -2.79578906 1.135266 24.00000 -2.46267364
44      HockLeft TRT1 - TRT3 -3.21625042 1.135266 24.00000 -2.83303746
45      HockLeft TRT1 - TRT4 -3.62998065 1.135266 24.00000 -3.19747215
46      HockLeft TRT2 - TRT3 -0.42046136 1.135266 24.00000 -0.37036381
47      HockLeft TRT2 - TRT4 -0.83419159 1.135266 24.00000 -0.73479851
48      HockLeft TRT3 - TRT4 -0.41373023 1.135266 24.00000 -0.36443470
49 ShoulderRigth TRT1 - TRT2 -2.93401363 2.037138 24.00000 -1.44026270
50 ShoulderRigth TRT1 - TRT3  1.47566489 2.037138 24.00000  0.72438146
51 ShoulderRigth TRT1 - TRT4 -1.81029622 2.037138 24.00000 -0.88864690
52 ShoulderRigth TRT2 - TRT3  4.40967852 2.037138 24.00000  2.16464416
53 ShoulderRigth TRT2 - TRT4  1.12371741 2.037138 24.00000  0.55161580
54 ShoulderRigth TRT3 - TRT4 -3.28596111 2.037138 24.00000 -1.61302836
55      HeelLeft TRT1 - TRT2 -1.34162385 2.659238 24.00000 -0.50451432
56      HeelLeft TRT1 - TRT3 -5.04087976 2.659238 24.00000 -1.89561031
57      HeelLeft TRT1 - TRT4 -5.41505267 2.659238 24.00000 -2.03631710
58      HeelLeft TRT2 - TRT3 -3.69925591 2.659238 24.00000 -1.39109599
59      HeelLeft TRT2 - TRT4 -4.07342882 2.659238 24.00000 -1.53180279
60      HeelLeft TRT3 - TRT4 -0.37417291 2.659238 24.00000 -0.14070679
61      HockLeft TRT1 - TRT2 -1.29059640 2.617543 24.00000 -0.49305643
62      HockLeft TRT1 - TRT3 -2.15336009 2.617543 24.00000 -0.82266465
63      HockLeft TRT1 - TRT4 -3.90521599 2.617543 24.00000 -1.49193957
64      HockLeft TRT2 - TRT3 -0.86276369 2.617543 24.00000 -0.32960822
65      HockLeft TRT2 - TRT4 -2.61461959 2.617543 24.00000 -0.99888314
66      HockLeft TRT3 - TRT4 -1.75185589 2.617543 24.00000 -0.66927492
67 ShoulderRigth TRT1 - TRT2  1.70465834 2.414456 24.00000  0.70602168
68 ShoulderRigth TRT1 - TRT3  0.17705189 2.414456 24.00000  0.07332993
69 ShoulderRigth TRT1 - TRT4  1.05441810 2.414456 24.00000  0.43671041
70 ShoulderRigth TRT2 - TRT3 -1.52760645 2.414456 24.00000 -0.63269175
71 ShoulderRigth TRT2 - TRT4 -0.65024024 2.414456 24.00000 -0.26931127
72 ShoulderRigth TRT3 - TRT4  0.87736621 2.414456 24.00000  0.36338048
      p.value period
1  0.97096839      1
2  0.70585852      1
3  0.99999741      1
4  0.91623720      1
5  0.97444215      1
6  0.71704871      1
7  0.35732416      1
8  0.89175782      1
9  0.87226264      1
10 0.77374511      1
11 0.79923729      1
12 0.99996105      1
13 0.80635036      1
14 0.99114593      1
15 0.97764192      1
16 0.93016438      1
17 0.96009688      1
18 0.99951419      1
19 0.29228498      2
20 0.07709528      2
21 0.20988513      2
22 0.88057902      2
23 0.99689226      2
24 0.94987392      2
25 0.84328078      2
26 0.80559993      2
27 0.40194349      2
28 0.99983662      2
29 0.86744824      2
30 0.89871062      2
31 0.72703790      2
32 0.67161407      2
33 0.99524013      2
34 0.99969377      2
35 0.58529936      2
36 0.52834390      2
37 0.01590110      3
38 0.00479502      3
39 0.14891233      3
40 0.95735309      3
41 0.71594354      3
42 0.41665865      3
43 0.09203464      3
44 0.04260952      3
45 0.01887649      3
46 0.98223827      3
47 0.88212196      3
48 0.98304713      3
49 0.48767613      3
50 0.88638597      3
51 0.81073407      3
52 0.16198759      3
53 0.94520439      3
54 0.39051473      3
55 0.95721911      4
56 0.25639559      4
57 0.20298794      4
58 0.51680262      4
59 0.43503188      4
60 0.99897710      4
61 0.95988122      4
62 0.84318188      4
63 0.45766977      4
64 0.98733111      4
65 0.75145737      4
66 0.90762239      4
67 0.89371028      4
68 0.99985433      4
69 0.97151779      4
70 0.92045818      4
71 0.99298467      4
72 0.98318848      4