avg_set_rating<-setCounts2|>summarise("Avg Ratings Per Set"=mean(n))|>pull(1)d|>summarize("N Subjects"=n_distinct(sbjCode), "N Prototype Sets"=n_distinct(set))|>mutate("Avg Ratings Per Set"=avg_set_rating)|>kbl()
Table 1: Current counts of unique subjects, and prototype sets
N Subjects
N Prototype Sets
Avg Ratings Per Set
87
304
29
Prototype set counts
Display code
setCounts2|>group_by(n)|>summarise(nc=n())|>rename("Number of times prototype set has been included in the study"=n, "Number of prototype sets with this count"=nc)|>gt()|>tab_spanner(label ="Prototype Set Counts")|>tab_header(title ="Prototype Set Counts")|>tab_source_note("Note: The number of times a prototype set has been included in the study is equal to the number of participants who rated the set.")
Prototype Set Counts
Number of times prototype set has been included in the study
Number of prototype sets with this count
17
1
19
4
20
3
21
3
22
8
23
10
24
19
25
19
26
20
27
25
28
23
29
24
30
28
31
25
32
17
33
24
34
15
35
13
36
14
37
2
38
3
39
1
40
2
41
1
Note: The number of times a prototype set has been included in the study is equal to the number of participants who rated the set.
Display code
# d |> filter(sbjCode==11) |> select(sbjCode,date,trial,pair_label,set,rt,time_elapsed,time)# d |> group_by(sbjCode,set) |> # summarize (n=n()) |># gt()#d |> group_by(sbjCode, item_label_1, item_label_2) |> summarise(n=n())# (1-.33)^8# (factorial(8)/(factorial(6)*factorial(8-6))) * (.33^6)*((1-.33)^(8-6))# (factorial(8)/(factorial(7)*factorial(8-7))) *(.33^6)*((1-.33)^(8-7))# (factorial(8)/(factorial(8)*factorial(8-8))) *(.33^6)*(1-.33)^(8-8)# d |> pivot_longer(cols=c(item_label_1, item_label_2), names_to="item_label", values_to="item") |> # group_by(sbjCode, item) |> summarise(n=n())# patternCounts <- d |> pivot_longer(cols=c(item_label_1, item_label_2), names_to="item_label", values_to="item") |> # group_by(item) |> summarise(n=n(),resp=mean(response),sd=sd(response)) |> arrange(desc(n))# d |> # pivot_longer(cols=c(item_label_1, item_label_2), names_to="item_label", values_to="item") |> select(sbjCode,set,pair_label,item_label,item,response) |> group_by(set) |># summarize(n=n_distinct(sbjCode)) |> arrange(desc(n)) # d |> group_by(sbjCode, file) |> summarise(n=n())# d |> group_by(sbjCode, set) |> summarise(n=n())# d |> group_by(sbjCode) |> summarise(n_distinct(file))# d |> group_by(sbjCode) |> summarise(n_distinct(set))# sp <- setCounts2 |> # mutate(set=reorder(set,n)) |># ggplot(aes(x=set,y=n)) +# geom_col() +# theme(legend.title=element_blank(),# axis.text.x = element_text(size=5,angle = 90, hjust = 0.5, vjust = 0.5)) +# labs(x="Prototype Set", y="Number of Participants to rate set") sh<-setCounts2|>ggplot(aes(x=n))+geom_histogram(binwidth =1)+scale_x_continuous(breaks=seq(0, max(setCounts2$n), by =1))+geom_text(stat="count", aes(label=..count..), vjust=-0.5)+labs(x="Number of times prototype set has been included in the study", y="Number of prototype sets for each count")#sp/shsh
Rating Distributions
Display code
pgr<-d|>ggplot(aes(x=response))+geom_histogram(binwidth=1)+scale_x_continuous(breaks=seq(1, 9, by =1))+coord_cartesian(xlim =c(1, 9))+labs(title="Aggregate Rating Distribution", x="Rating", y="Count")pir<-d|>ggplot(aes(x=response))+geom_histogram(binwidth=1)+facet_wrap(~sbjCode)+scale_x_continuous(breaks=seq(1, 9, by =1))+coord_cartesian(xlim =c(1, 9))+labs(title="Rating Distribution per Sbj.", x="Rating", y="Count")pgr/pir
Reaction Time Distributions
Display code
prtg<-d|>ggplot(aes(x=rt))+geom_density()+labs(title="Aggregate Reaction Time Distribution", x="Reaction Time (ms)", y="Density")prtid<-d|>ggplot(aes(x=rt))+geom_density()+facet_wrap(~sbjCode,scale="free_x")+labs(title="Reaction Time Distribution per Sbj.", x="Reaction Time (ms)", y="Density")prtg/prtid
d%>%filter(pair_label%in%{pairCounts|>filter(n>=min_resp)|>slice_max(mean_resp,n=n_show, with_ties=FALSE)|>pull(pair_label)})|>group_by(pair_label)|>slice_head(n=1)%>%plot_dotsAll()+plot_annotation(title=glue::glue("Highest rated pairs ( out of sets with n>={min_resp} ratings)"), theme =theme(plot.title =element_text(hjust =0.4)))
Pattern Pair Table
All pairs with >=25 ratings
click on column headers to change sort order
e.g. clicking on “Mean Rating” will toggle showing the pairs rated most similar or most dissimilar
clicking on “SD” will toggle showing the pairs with the most or least agreement in ratings
note your screen may need to be at full width to see all columns
Table 3: Example of how data is structure after combining similarity ratings with CatLearn accuracy. 5 Pattern types * 3 Categories = 15 rows per subject in the 2024 study