forked from WdeNooy/Statistical-Inference
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflowchartold.R
More file actions
65 lines (65 loc) · 8.18 KB
/
flowchartold.R
File metadata and controls
65 lines (65 loc) · 8.18 KB
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
# Overview of tests with conditions/requirements and SPSS commands ; interactive decision/flow chart - show complete diagram and pressing a button or clicking a cell hides all choices/cells that are not up- and downstream from this cell.
# Use visNetwork:: package (visHierarchicalLayout()) or networkD3:: package (diagonalNetwork()).
library(visNetwork)
nodes <- data.frame(id = 1:26, level = c(1, rep(2, 7), rep(3, 6), rep(4, 12)),
label = c("Research Question",
"Category Share",
"Overall Score Level",
"Score Variation",
"Score Level Change",
"Different Group Score Levels",
"Different Group Shares",
"Concurrent Score Levels",
"1 Category",
"3+ Categories",
"2 Groups",
"3+ Groups",
"Linear",
"Bend",
"binomial test",
"one-sample chi-squared test",
"one-sample t test",
"bootstrap test on one median",
"Levene's F test",
"paired-samples t test",
"independent-samples t test",
"analysis of variance: F test",
"chi-squared test",
"t test on Pearson correlation",
"Regression: F (model) & t test (coefficient)",
"test on Spearman's rho"),
title = c("What characteristics of your participants<br>are you interested in?",
"How many have ...?, Which part is ...?<br><b>Variables</b>: 1 dichotomy",
"How low/high is ...?<br><b>Variables</b>: 1 numeric",
"More (dis)agreement among ... than among ...? <br>Are scores more spread among ... than among ...?<br><b>Variables</b>: 1 categorical, 1 numeric",
"Does the score level increase/decrease ...?<br><b>Variables</b>: 1 numeric repeated",
"Does one group score higher than another group...?<br><b>Variables</b>: 1 categorical, 1 numeric",
"Do categories occur more/less <br>in one group than in another group...?<br><b>Variables</b>: 2 categorical",
"Does a score increase/decrease <br>if another score changes?<br><b>Variables</b>: 2+ numeric",
"What is the share of ...",
"Which categories occur<br>relatively frequently?",
"Does group ... score higher/<br>lower than group ...?",
"Do some groups score higher/<br>lower than other groups?",
"Can a straight line <br>represent the relation<br>between scores?",
"Is the relation between <br>scores clearly bend?",
"<b>Visual:</b> bar chart, pie chart<br><b>Measure:</b> proportion or percentage<br><b>Interpretation:</b> ... per cent of the ... have/are ... <br><b>Assumptions</b>: none",
"<b>Visual:</b> bar chart, pie chart<br><b>Measure:</b> relative frequencies<br><b>Interpretation:</b> ... per cent of the ... have/are ...<br>and/but ... per cent have/are ...<br><b>Assumptions:</b> expected frequencies<br>never below 1 and max 20% below 5",
"<b>Visual:</b> histogram<br><b>Measure:</b> one mean,<br>Cohen's <i>d</i><br><b>Interpretation:</b> the participants'<br>/respondents' average score<br>on ... is ... (M = ..., SD = ...)<br><b>Assumptions:</b> sample size above 30<br>or population normally<br>distributed; otherwise: bootstrap",
"<b>Visual:</b> boxplot<br><b>Measure:</b> one median<br><b>Interpretation:</b> half of the ...<br>have a score below/above ...<br><b>Assumptions:</b> none",
"<b>Visual:</b> error bar<br>chart, boxplot<br><b>Measure:</b> two variances<br>or standard deviations<br><b>Interpretation:</b> the scores on ... vary<BR>more/less among ... (SD/variance = ...) than<BR>among ... (SD/variance = ...)<br><b>Assumptions:</b> none",
"<b>Visual:</b> means plot<br>(error bar chart, boxplot)<br><b>Measure:</b> difference of<br>two means, Cohen's <i>d</i><br><b>Interpretation:</b> the average<br>score on ... increases/<br>decreases between ... (M = ..., SD = ...)<br>and ... (M = ..., SD = ...), this change is<br>small/medium/large<br><b>Assumptions:</b> sample size above 30<br>or population normally distributed;<br>otherwise: bootstrap",
"<b>Visual:</b> means plot<br>(error bar chart, boxplot)<br><b>Measure:</b> difference of<br>two means, Cohen's <i>d</i><br><b>Interpretation:</b> there is a small/<br>medium/large difference between<br>the average score on ...<br>among ... (M = ..., SD = ...)<br>and among ... (M = ..., SD = ...)<br><b>Assumptions:</b> sample size above<br>30 or population normally<br>distributed; otherwise: bootstrap",
"<b>Visual:</b> means plot<b><br>Measure:</b> variance in means,<br>eta or eta<sup2</sup>, differences<br>between pairs of means<br><b>Interpretation:</b> there are<BR>no/small/medium/large differences<br>among the average scores on ... .<br>Group ... (M = ..., SD = ...)<br>has a lower/higher score than<br>group ... (M = ..., SD = ...)<br><b>Assumptions:</b> groups of equal<br>size or groups with equal<br>population variances (Levene's F test)",
"<b>Visual:</b> stacked or<br>clustered bar chart<br><b>Measure:</b> Phi, Cramer's V,<br>Goodman & Kruskals tau,<br>Kendalls tau-b<br><b>Interpretation:</b> the association<BR>between ... and ... is weak/medium/<br>strong. ... occurs relatively<BR>frequently among group ... but ...<br>is relatively rare with group ...<br><b>Assumptions:</b> expected<BR> frequencies never below 1<br>and max 20% below 5, otherwise<br>exact test; in a 2x2 table,<br>use Fisher's exact test",
"<b>Visual:</b> scatterplot (with regression<br>line)<br><b>Measure:</b> (Pearson) correlation<br><b>Interpretation:</b> There is a weak/medium/<br>strong correlation between ... and ...:<br>the higher the score on ..., the<br>higher/lower the score on ... .<br><b>Assumptions:</b> none.",
"<b>Visual:</b> scatterplots (with regression line)<br><b>Measures</b> for multiple regression:<BR><I>R</I><sup>2</sup>, regression coefficients (b or b*)<br><b>Interpretation:</b> When ... increases by<BR>one unit, the predicted value of ...<BR>increases/decreases with ... .<BR>This effect is weak/medium/strong.<BR>The variance in ... and ... (and ...)<BR>accounts for ...% of the variance in ... .<br><b>Assumptions:</b> residuals normally<BR>distributed and homoscedastic",
"<b>Visual:</b> scatterplot (with regression line)<br><b>Measure:</b> (Spearman's) rho<br><b>Interpretation:</b> There is a weak/<BR>medium/strong rank correlation between ...<BR>and ...: The higher the score on ..., the<BR>higher/lower the score on ... .<br><b>Assumptions:</b> not relevant (SPSS uses<BR>t aproximation if applicable)"),
shape = "dot", size = 20, font.size = 42, shadow = "FALSE")
edges <- data.frame(from = c(1, 1, 1, 1, 1, 1, 1, 2, 2, 6, 6, 8, 8, 9, 10, 3, 3, 4, 7, 5, 11, 12, 13, 13, 14), to = c(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 20, 21, 22, 24, 25, 26), shadow = "TRUE")
p <- visNetwork(nodes, edges, width = "100%") %>%
visEdges(arrows = "to") %>%
visHierarchicalLayout(direction = "LR", levelSeparation = 600) %>%
visOptions(highlightNearest = list(enabled = TRUE, algorithm = "hierarchical",
degree = list(from = 3, to = 1))) %>%
visInteraction(dragNodes = FALSE)
rm(nodes, edges)