require("tidyverse")
require("irr")
require("broom")
str(df)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   20 obs. of  4 variables:
 $ ID      : int  1 2 3 4 5 6 7 8 9 10 ...
 $ grupas  : chr  "student" "student" "dentist" "dentist" ...
 $ premolar: num  3.69 3.21 3.08 3.08 3.02 3.79 3.39 3.15 4.37 3.45 ...
 $ molar   : num  3.98 4.11 4.12 3.64 3.52 3.65 3.83 2.64 4.61 4.95 ...
summary(df)
       ID           grupas             premolar         molar      
 Min.   : 1.00   Length:20          Min.   :3.010   Min.   :2.640  
 1st Qu.: 5.75   Class :character   1st Qu.:3.132   1st Qu.:3.735  
 Median :10.50   Mode  :character   Median :3.390   Median :4.015  
 Mean   :10.50                      Mean   :3.378   Mean   :4.089  
 3rd Qu.:15.25                      3rd Qu.:3.493   3rd Qu.:4.580  
 Max.   :20.00                      Max.   :4.370   Max.   :4.990  
options(digits = 3)
df %>% 
        gather(tooth, value, -c(ID, grupas)) %>% 
        group_by(tooth, grupas) %>% 
        summarise(Mean = mean(value), SD = sd(value))
head(df)
df %>% 
        gather(tooth, value, -c(ID, grupas)) %>% 
        ggplot(aes(x = tooth, y = value, colour = grupas)) +
        geom_boxplot()

df %>% 
        gather(tooth, value, -c(ID, grupas)) %>% 
        ggplot(aes(x = value)) +
        geom_histogram() +
        facet_grid(tooth~grupas)

NA

Diferencias entre grupas y tooth

fit <- df %>% 
        gather(tooth, value, -c(ID, grupas)) %>% 
        do(anova(lm(value ~ grupas * tooth, data = .)))
fit
Analysis of Variance Table

Response: value
             Df Sum Sq Mean Sq F value  Pr(>F)    
grupas        1   0.00    0.00    0.02    0.90    
tooth         1   5.06    5.06   20.79 5.7e-05 ***
grupas:tooth  1   0.00    0.00    0.01    0.94    
Residuals    36   8.75    0.24                    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

ICC

df2 <- read_csv("icc_ilze.csv")
df2
df2 <- df2 %>% 
        select(d1, d2)
icc(df, model="twoway", type="agreement")
NAs introduced by coercionargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NANAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionNAs introduced by coercionargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NAargument is not numeric or logical: returning NA
 Single Score Intraclass Correlation

   Model: twoway 
   Type : agreement 

   Subjects = 20 
     Raters = 4 
   ICC(A,1) = NA

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(19,NA) = NA , p = NA 

 95%-Confidence Interval for ICC Population Values:
  NA < ICC < NA
icc(df2, model="oneway", type="agreement")
 Single Score Intraclass Correlation

   Model: oneway 
   Type : agreement 

   Subjects = 40 
     Raters = 2 
     ICC(1) = 0.999

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(39,40) = 2978 , p = 2.62e-59 

 95%-Confidence Interval for ICC Population Values:
  0.999 < ICC < 1
t.test(df2$d1, df2$d2)

    Welch Two Sample t-test

data:  df2$d1 and df2$d2
t = -0.004, df = 80, p-value = 1
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.264  0.263
sample estimates:
mean of x mean of y 
     3.73      3.73 
summary(df2)
       d1             d2      
 Min.   :2.64   Min.   :2.70  
 1st Qu.:3.37   1st Qu.:3.34  
 Median :3.64   Median :3.63  
 Mean   :3.73   Mean   :3.73  
 3rd Qu.:4.07   3rd Qu.:4.07  
 Max.   :4.99   Max.   :4.98  
df2 %>% 
        gather() %>% 
        ggplot(aes(x = key, y = value)) +
        geom_boxplot()

LS0tDQp0aXRsZTogIklDQyINCm91dHB1dDoNCiAgaHRtbF9ub3RlYm9vazogZGVmYXVsdA0KICBwZGZfZG9jdW1lbnQ6IGRlZmF1bHQNCi0tLQ0KYGBge3IsIGV2YWw9RkFMU0V9DQpyZXF1aXJlKCJ0aWR5dmVyc2UiKQ0KcmVxdWlyZSgiaXJyIikNCnJlcXVpcmUoImJyb29tIikNCmBgYA0KDQpgYGB7cn0NCmRmIDwtIHJlYWRfY3N2KCJpY2MyX2lsemUuY3N2IikNCnN0cihkZikNCmBgYA0KDQpgYGB7cn0NCnN1bW1hcnkoZGYpDQpgYGANCmBgYHtyfQ0Kb3B0aW9ucyhkaWdpdHMgPSAzKQ0KZGYgJT4lIA0KICAgICAgICBnYXRoZXIodG9vdGgsIHZhbHVlLCAtYyhJRCwgZ3J1cGFzKSkgJT4lIA0KICAgICAgICBncm91cF9ieSh0b290aCwgZ3J1cGFzKSAlPiUgDQogICAgICAgIHN1bW1hcmlzZShNZWFuID0gbWVhbih2YWx1ZSksIFNEID0gc2QodmFsdWUpKQ0KYGBgDQoNCmBgYHtyfQ0KZGYgJT4lIA0KICAgICAgICBnYXRoZXIodG9vdGgsIHZhbHVlLCAtYyhJRCwgZ3J1cGFzKSkgJT4lIA0KICAgICAgICBzdW1tYXJpc2UoTWVhbiA9IG1lYW4odmFsdWUpLCBTRCA9IHNkKHZhbHVlKSkNCmBgYA0KDQoNCmBgYHtyfQ0KZGYgJT4lIA0KICAgICAgICBnYXRoZXIodG9vdGgsIHZhbHVlLCAtYyhJRCwgZ3J1cGFzKSkgJT4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