-
Notifications
You must be signed in to change notification settings - Fork 1
/
anovas.R
69 lines (53 loc) · 2.03 KB
/
anovas.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
# Lets have some fun with ANOVAs!
# Load the data
source("load.R", print.eval=TRUE)
# The data of interest is f_recall_sum for free recall and p_recall_sum for prompted recall
# Free Recall First
f_recall_sum
library(psych)
# Overall total
describe(f_recall_sum$rating)
# Totals broken up into categories
describeBy(f_recall_sum$rating, f_recall_sum$profile)
describeBy(f_recall_sum$rating, f_recall_sum$Product)
describeBy(f_recall_sum$rating, f_recall_sum$Endorse)
# Is there a difference in recall for Product only
fit <- aov(rating ~ Product, data=f_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests
fit <- aov(rating ~ Endorse, data=f_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests
fit <- aov(rating ~ Product*Endorse, data=f_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests
# Next Prompted Recall
library(psych)
# Overall total
describe(p_recall_sum$rating)
# Totals broken up into categories
describeBy(p_recall_sum$rating, p_recall_sum$profile)
describeBy(p_recall_sum$rating, p_recall_sum$Product)
describeBy(p_recall_sum$rating, p_recall_sum$Endorse)
# Is there a difference in recall for Product only
fit <- aov(rating ~ Product, data=p_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests
fit <- aov(rating ~ Endorse, data=p_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests
fit <- aov(rating ~ Product*Endorse, data=p_recall_sum)
layout(matrix(c(1,2,3,4),2,2)) # optional layout
plot(fit)
summary(fit) # display Type I ANOVA table
drop1(fit,~.,test="F") # type III SS and F Tests