-
Notifications
You must be signed in to change notification settings - Fork 0
/
Var_III.R
109 lines (80 loc) · 2.44 KB
/
Var_III.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#1
boxplot(ab ~ trat, data = hipo,
main = "Abundância da Macrofauna por Tratamento",
xlab = "Tratamento",
ylab = "Abundância de Macrofauna",
col = c("lightblue", "lightgreen"),
border = "black")
boxplot(ab ~ site, data = hipo,
main = "Abundância da Macrofauna por local",
xlab = "Local",
ylab = "Abundância de Macrofauna",
col = c("lightblue", "lightgreen"),
border = "black")
fit_hipo <- lmerTest::lmer(ab ~ trat + (1 | site),
data=hipo,
REML = T)
fit_hipo
anova(fit_hipo)
lmerTest::rand(fit_hipo)
residuos <- resid(fit_hipo)
predicoes <- fitted(fit_hipo)
plot(residuos ~ predicoes,
las = 1,
bty = "n",
xlab = "Fitted",
ylab = "Residuals")
qqnorm(residuos,
bty = "n",
las = 1,
col = "brown")
qqline(residuos,
col = "blue")
shapiro.test(residuos)
posthoc <- multcomp::glht(fit_hipo,
linfct = multcomp::mcp(trat = "Tukey"))
mcs <- summary(posthoc,
test = multcomp::adjusted("single-step"))
mcs
#1.2
hipo$site <- as.factor(hipo$site)
hipo$trat <- as.factor(hipo$trat)
vca_model <- VCA::anovaVCA(ab ~ trat/site, Data = hipo)
print(vca_model)
VCA::varPlot(ab ~ trat/site, Data = hipo)
#2
model_aov <- aov(Settlement ~ Treatment * Week + Error(Replicate), data = data_clean)
summary(model_aov)
fit.data <- lmerTest::lmer(Settlement ~ Treatment * Week + (1 | Replicate),
data_clean,
REML = T)
summary(fit.data)
anova(fit.data)
lmerTest::difflsmeans(fit.data,
which = c("Treatment",
"Week",
"Treatment:Week"))
with(data_clean,
interaction.plot(Week, Treatment, Settlement,
ylim = c(0, 2),
lwd = 2,
ylab = "Média da Colonização",
xlab = "Semana",
trace.label = "Tratamento",
las = 1,
xtick = T,
bty = "n"))
residuos <- resid(fit.data)
predicoes <- fitted(fit.data)
plot(residuos ~ predicoes,
las = 1,
bty = "n",
xlab = "Fitted",
ylab = "Residuals")
shapiro.test(residuos)
qqnorm(residuos,
bty = "n",
las = 1,
col = "brown")
qqline(residuos,
col = "blue")