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
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()