knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

The graph below describes the test choice algorithm employed in the \texttt{DescrTab2} package. Some of the branching steps are dependent on the data and some can be manipulated by the user. The type of data (\texttt{numeric}, \texttt{ordered} factor and unordered \texttt{factor}) is automatically determined, as is the number of groups and the number of categories in categorical variables. The user may choose to apply nonparametric instead of parametric tests, asymptotic instead of exact and paired instead of unpaired tests.

The default configuration of arguments is \texttt{test_options=list(paired=F, nonparametric=F, exact=F)}. In a scenario with 2 groups, this will give Welch's t-test for numerical variables and a chi-squared test for categorical variables with 2 categories.

Test choices can be manually overwritten via the appropriately titled parameter \texttt{test_override}. If, for example, you want to calculate Boschloo's test only for the gender variable and use a chi-squared test (default) for everything else, you can request this by supplying the following argument: \newline \texttt{var_options=list(gender=list(test_options = list(test_override="Boschloo's test")))}.

\vspace{1.5cm}

\hspace{-2.5cm}\begin{tikzcd}[scale cd=0.28, sep=10pt] & & & & & & & & & & \textbf{\text{Which test is chosen for the variable } \texttt{var}\text{?}} \arrow[ld, "\texttt{is.factor(var)==T}" description] \arrow[rd, "\texttt{is.numeric(var)==T}" description] & & & & & & & \ & & & & & & & & & \textbf{\text{Categorical}} \arrow[rd, "\texttt{is.ordered(var)==T}" description] \arrow[llld, "\texttt{is.ordered(var)==F}" description] & & \textbf{\text{Numerical}} \arrow[ld, "\texttt{nonparametric==T}" description] \arrow[rrrd, "\texttt{nonparametric==F}" description] & & & & & & \ & & & & & & \textbf{\text{Nominal}} \arrow[ld, "\texttt{exact==F}" description] \arrow[rd, "\texttt{exact==T}" description] & & & & \textbf{\text{Ordinal}} \arrow[ldd, "\texttt{paired==T}" description] \arrow[rdd, "\texttt{paired==F}" description] & & & & \textbf{\text{\stackanchor{Continuous}{and normally distributed}}} \arrow[ldd, "\texttt{paired==T}" description] \arrow[rrdd, "\texttt{paired==F}" description] & & & \ & & & & & \textbf{\text{Asymptotic}} \arrow[d, "\texttt{paired==F}" description] \arrow[ld, "\texttt{paired==T}" description] & & \textbf{\text{Exact}} \arrow[ld, "\texttt{paired==T}" description] \arrow[d, "\texttt{paired==F}" description] & & & & & & & & & & \ & & & & \textbf{\text{Paired}} \arrow[llld] \arrow[lllld] & \textbf{\text{Independent}} \arrow[lld] \arrow[llld] & \textbf{\text{Paired}} \arrow[lld] & \textbf{\text{Independent}} \arrow[ld] \arrow[d] \arrow[lld] & & \textbf{\text{Paired}} \arrow[ld] \arrow[d] & & \textbf{\text{Independent}} \arrow[rd] \arrow[ld] \arrow[d] & & \textbf{\text{Paired}} \arrow[rd] \arrow[d] & & & \textbf{\text{Independent}} \arrow[ld] \arrow[d] \arrow[rd] & \ \text{2x2 table} \arrow[d] & {\text{\stackanchor{K repetitions x L Groups table,}{binary response}}} \arrow[d] & \text{1xL table} \arrow[d] & \text{KxL table} \arrow[d] & \text{2x2 table} \arrow[d] & \text{1xL table} \arrow[d] & \text{2x2 table} \arrow[d] & \text{\stackanchor{KxL table or}{large n}} \arrow[d] & \text{2 groups} \arrow[d] & \geq \text{3 groups} \arrow[d] & \text{1 group} \arrow[d] & \text{2 groups} \arrow[d] & \geq\text{ 3 groups} \arrow[d] & \text{2 groups} \arrow[d] & \geq \text{3 groups} \arrow[d] & \text{1 group} \arrow[d] & \text{2 groups} \arrow[d] & \geq \text{3 groups} \arrow[d] \ \text{McNemar's test} & \text{Cochrane's Q test} & \text{Chi-squared goodness-of-fit test} & \text{Pearson's Chi-squared test} & \text{Exact McNemar's test} & \text{Exact binomial test} & \text{Boschloo's test} & \text{Fisher's exact test} & \text{Wilcoxon's two-sample signed-rank test} & \text{Friedman's test} & \text{Wilcoxon's one-sample signed-rank test} & \text{Mann-Whitney's U test} & \text{Kruskal-Wallis's one-way ANOVA} & \text{Student's paired t-test} & {\text{\stackanchor{Mixed model ANOVA,}{subject ID as random effect}}} & \text{Student's one-sample t-test} & \text{Welch's t-test} & \text{F-test (ANOVA)}
\end{tikzcd}



imbi-heidelberg/DescrTab2 documentation built on Feb. 5, 2024, 6:51 a.m.