Objective

According to Wikipedia, statistical hypothesis testing is a method of statistical inference used to determine whether the data sufficiently supports a particular hypothesis.

This vignette presents three examples of hypothesis testing between continuous variables. The dataset comprised 616 respondents from 10 public and private sector organisations.

The tests examine the relationship between:

  • self-efficacy and emotion towards organisational change
  • irrational ideas and emotion towards organisational change
  • emotion and reaction towards organisational change.

Workflow

Tidied the raw dataset and derived hypotheses for testing. The null hypothesis (H0) implies the variables are independent, while the alternative hypothesis (Ha) implies the variables are associated or related. The correlation coefficient measures and assesses the level of association between the variables.

Before each test, a brief exploratory analysis previews the variables. The correlation analysis includes a scatter plot highlighting the regression line and loess smoothing curve. The analysis calculates the correlation coefficient between the variables with an interpretation of significance. A table at the end of the vignette summarises testing results.

Results

Test 1: Self-efficacy and emotion

Test 1 examines the relationship between self-efficacy and emotion towards organisational change.

Hypothesis
H0: Self-efficacy and emotion towards change are independent; there is no association between these two variables.
Ha: Self-efficacy and emotion towards change are associated; a relationship exists between these two variables.

1.1 Explore data

Table 1 provides a statistical summary of the variables.

Table 1 Self-efficacy and emotion statistical summary
vars n mean sd median trimmed mad min max range skew kurtosis se
self-efficacy 1 616 5.61 0.70 5.71 5.65 0.70 1.71 7 5.29 -0.97 2.27 0.03
emotion 2 616 4.11 1.04 4.07 4.11 0.93 1.00 7 6.00 0.06 -0.02 0.04

Charts 1 and 2 show a combined density histogram for both variables.

Charts 3 and 4 illustrate combined violin box plots for self-efficacy and emotion towards organisational change.

1.2 Correlation Analysis

Chart 5 scatter plot (with jitter) illustrates the relationship between self-efficacy and emotion towards organisational change. The scatter plot shows that the higher an individual’s self-efficacy, the more positive their emotions were towards organisational change and vice-versa.

Output 1 provides the correlation coefficient between these two variables, including the effect size. The output shows that the correlation coefficient for self-efficacy and emotion towards organisational change was 0.400463.

Output 1


    Pearson's product-moment correlation

data:  self_efficacy and emotion
t = 10.829, df = 614, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.3319677 0.4647574
sample estimates:
     cor 
0.400463 
       cor 
"moderate" 
(Rules: cohen1988)

Based on these findings, the null hypothesis was rejected. The results show a “moderate” positive relationship between self-efficacy and emotion towards organisational change.


Test 2: Irrational ideas and emotion

Test 2 examines the relationship between irrational ideas and emotion towards organisational change.

Hypothesis
H0: Irrational ideas and emotion towards change are independent; there is no association between these two variables.
Ha: Irrational ideas and emotion towards change are associated; a relationship exists between these two variables.

2.1 Explore data

Table 2 provides a statistical summary of the variables.

Table 2 Irrational ideas and emotion statistical summary
vars n mean sd median trimmed mad min max range skew kurtosis se
irrational ideas 1 616 3.67 0.77 3.65 3.66 0.82 1.2 5.8 4.6 0.04 -0.19 0.03
emotion 2 616 4.11 1.04 4.07 4.11 0.93 1.0 7.0 6.0 0.06 -0.02 0.04

Charts 6 and 7 show a combined density histogram for both variables.

Charts 8 and 9 illustrate combined violin box plots for irrational ideas and emotion towards organisational change.

2.2 Correlation Analysis

Chart 6 scatter plot (with jitter) illustrates the relationship between irrational ideas and emotion towards organisational change. The scatter plot shows that the lower the level of irrational ideas, the more positive the emotion was towards organisational change and vice-versa.

Output 2 provides the correlation coefficient between these two variables, including the effect size. The output shows that the correlation coefficient for irrational ideas and emotion towards organisational change was -0.3765441.

Output 2


    Pearson's product-moment correlation

data:  irrational_ideas and emotion
t = -10.072, df = 614, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.4423823 -0.3066690
sample estimates:
       cor 
-0.3765441 
       cor 
"moderate" 
(Rules: cohen1988)

Based on these findings, the null hypothesis was rejected. The results show a “moderate” negative relationship between irrational ideas and emotion towards organisational change.


Test 3: Emotion and reaction to change

Test 3 examines the relationship between emotion and reaction to organisational change.

Hypothesis
H0: Emotion and reaction to change are independent; there is no association between these two variables.
Ha: Emotion and reaction to change are associated; a relationship exists between these two variables.

3.1 Explore data

Table 3 provides a statistical summary of the variables.

Table 3 Emotion and reaction to organisational change statistical summary
vars n mean sd median trimmed mad min max range skew kurtosis se
emotion 1 616 4.11 1.04 4.07 4.11 0.93 1 7 6 0.06 -0.02 0.04
reaction 2 616 4.55 1.66 5.00 4.64 1.48 1 7 6 -0.46 -0.91 0.07

Charts 11 and 12 show a combined density histogram for both variables.

Charts 13 and 14 illustrate combined violin box plots for emotion and reaction to organisational change.

3.2 Correlation Analysis

Chart 15 scatter plot (with jitter) illustrates the relationship between emotion and reaction towards organisational change. The scatter plot shows that individuals reporting positive emotions about the change were more likely to support organisational change and vice-versa.

Output 3 provides the correlation coefficient between these two variables, including the effect size. The output shows that the correlation coefficient for emotion and reaction to organisational change was 0.6196301.

Output 3


    Pearson's product-moment correlation

data:  emotion and reaction
t = 19.562, df = 614, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.5684583 0.6660260
sample estimates:
      cor 
0.6196301 
    cor 
"large" 
(Rules: cohen1988)

Based on these findings, the null hypothesis was rejected. The results show a “large” positive relationship between emotion and reaction towards organisational change.


Summary

Table 4 summarises the testing results. Variables are listed with respective correlation coefficients, significance level, p-value and hypothesis outcome.

Table 4 Summary of continuous variable hypothesis testing
variables coefficient significance p_value H0
self-efficacy and emotion 0.400463 moderate <2.2e-16 reject
irrational ideas and emotion -0.3765441 moderate <2.2e-16 reject
emotion and reaction to change 0.6196301 large <2.2e-16 reject
* Significance level: p < 0.05

References:

Self-efficacy was measured using the ‘Self-efficacy scale: Construction and validation’ by Sherer, Maddux, Mercandante, Prentice-Dunn and Rogers, published in Psychological Reports.
Irrational ideas were measured using the ‘Irrational belief scale’ developed by Malouff and Schutte, published in the Sourcebook of Adult Assessment Strategies, based on Ellis and Harper’s work, published in A New Guide to Rational Living.
Emotion was measured using ‘A semantic differential mood scale’ by Lorr and Wunderlich, published in the Journal of Clinical Psychology.


Session information and package update

## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value
##  version  R version 4.4.0 (2024-04-24 ucrt)
##  os       Windows 11 x64 (build 22631)
##  system   x86_64, mingw32
##  ui       RTerm
##  language (EN)
##  collate  English_Australia.utf8
##  ctype    English_Australia.utf8
##  tz       Australia/Brisbane
##  date     2024-07-29
##  pandoc   3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package           * version  date (UTC) lib source
##  abind               1.4-5    2016-07-21 [1] CRAN (R 4.4.0)
##  askpass             1.2.0    2023-09-03 [1] CRAN (R 4.4.0)
##  backports           1.5.0    2024-05-23 [1] CRAN (R 4.4.0)
##  bayestestR          0.14.0   2024-07-24 [1] CRAN (R 4.4.1)
##  broom               1.0.6    2024-05-17 [1] CRAN (R 4.4.0)
##  bslib               0.7.0    2024-03-29 [1] CRAN (R 4.4.0)
##  cachem              1.1.0    2024-05-16 [1] CRAN (R 4.4.0)
##  car                 3.1-2    2023-03-30 [1] CRAN (R 4.4.0)
##  carData             3.0-5    2022-01-06 [1] CRAN (R 4.4.0)
##  cli                 3.6.3    2024-06-21 [1] CRAN (R 4.4.1)
##  coda                0.19-4.1 2024-01-31 [1] CRAN (R 4.4.0)
##  codetools           0.2-20   2024-03-31 [2] CRAN (R 4.4.0)
##  colorspace          2.1-0    2023-01-23 [1] CRAN (R 4.4.1)
##  cowplot             1.1.3    2024-01-22 [1] CRAN (R 4.4.0)
##  crayon              1.5.3    2024-06-20 [1] CRAN (R 4.4.1)
##  crul                1.5.0    2024-07-19 [1] CRAN (R 4.4.1)
##  curl                5.2.1    2024-03-01 [1] CRAN (R 4.4.0)
##  data.table        * 1.15.4   2024-03-30 [1] CRAN (R 4.4.0)
##  datawizard          0.12.2   2024-07-21 [1] CRAN (R 4.4.1)
##  devtools            2.4.5    2022-10-11 [1] CRAN (R 4.4.0)
##  digest              0.6.36   2024-06-23 [1] CRAN (R 4.4.1)
##  dplyr             * 1.1.4    2023-11-17 [1] CRAN (R 4.4.0)
##  effectsize        * 0.8.9    2024-07-03 [1] CRAN (R 4.4.1)
##  ellipsis            0.3.2    2021-04-29 [1] CRAN (R 4.4.0)
##  emmeans             1.10.3   2024-07-01 [1] CRAN (R 4.4.1)
##  estimability        1.5.1    2024-05-12 [1] CRAN (R 4.4.0)
##  evaluate            0.24.0   2024-06-10 [1] CRAN (R 4.4.0)
##  fansi               1.0.6    2023-12-08 [1] CRAN (R 4.4.0)
##  farver              2.1.2    2024-05-13 [1] CRAN (R 4.4.0)
##  fastmap             1.2.0    2024-05-15 [1] CRAN (R 4.4.0)
##  flextable         * 0.9.6    2024-05-05 [1] CRAN (R 4.4.0)
##  fontBitstreamVera   0.1.1    2017-02-01 [1] CRAN (R 4.4.0)
##  fontLiberation      0.1.0    2016-10-15 [1] CRAN (R 4.4.0)
##  fontquiver          0.2.1    2017-02-01 [1] CRAN (R 4.4.0)
##  forcats           * 1.0.0    2023-01-29 [1] CRAN (R 4.4.0)
##  fs                  1.6.4    2024-04-25 [1] CRAN (R 4.4.0)
##  gdtools             0.3.7    2024-03-05 [1] CRAN (R 4.4.0)
##  generics            0.1.3    2022-07-05 [1] CRAN (R 4.4.0)
##  gfonts              0.2.0    2023-01-08 [1] CRAN (R 4.4.0)
##  ggplot2           * 3.5.1    2024-04-23 [1] CRAN (R 4.4.0)
##  ggpubr            * 0.6.0    2023-02-10 [1] CRAN (R 4.4.0)
##  ggsignif            0.6.4    2022-10-13 [1] CRAN (R 4.4.0)
##  glue                1.7.0    2024-01-09 [1] CRAN (R 4.4.0)
##  gtable              0.3.5    2024-04-22 [1] CRAN (R 4.4.0)
##  here              * 1.0.1    2020-12-13 [1] CRAN (R 4.4.0)
##  highr               0.11     2024-05-26 [1] CRAN (R 4.4.0)
##  hms                 1.1.3    2023-03-21 [1] CRAN (R 4.4.0)
##  htmltools           0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0)
##  htmlwidgets         1.6.4    2023-12-06 [1] CRAN (R 4.4.0)
##  httpcode            0.3.0    2020-04-10 [1] CRAN (R 4.4.0)
##  httpuv              1.6.15   2024-03-26 [1] CRAN (R 4.4.0)
##  insight             0.20.2   2024-07-13 [1] CRAN (R 4.4.0)
##  jquerylib           0.1.4    2021-04-26 [1] CRAN (R 4.4.0)
##  jsonlite            1.8.8    2023-12-04 [1] CRAN (R 4.4.0)
##  kableExtra        * 1.4.0    2024-01-24 [1] CRAN (R 4.4.0)
##  knitr               1.48     2024-07-07 [1] CRAN (R 4.4.1)
##  labeling            0.4.3    2023-08-29 [1] CRAN (R 4.4.0)
##  later               1.3.2    2023-12-06 [1] CRAN (R 4.4.0)
##  lattice             0.22-6   2024-03-20 [2] CRAN (R 4.4.0)
##  lifecycle           1.0.4    2023-11-07 [1] CRAN (R 4.4.0)
##  lubridate         * 1.9.3    2023-09-27 [1] CRAN (R 4.4.0)
##  magrittr            2.0.3    2022-03-30 [1] CRAN (R 4.4.0)
##  MASS                7.3-60.2 2024-04-24 [2] local
##  Matrix              1.7-0    2024-03-22 [2] CRAN (R 4.4.0)
##  memoise             2.0.1    2021-11-26 [1] CRAN (R 4.4.0)
##  mgcv                1.9-1    2023-12-21 [2] CRAN (R 4.4.0)
##  mime                0.12     2021-09-28 [1] CRAN (R 4.4.0)
##  miniUI              0.1.1.1  2018-05-18 [1] CRAN (R 4.4.0)
##  mnormt              2.1.1    2022-09-26 [1] CRAN (R 4.4.0)
##  multcomp            1.4-26   2024-07-18 [1] CRAN (R 4.4.1)
##  munsell             0.5.1    2024-04-01 [1] CRAN (R 4.4.0)
##  mvtnorm             1.2-5    2024-05-21 [1] CRAN (R 4.4.0)
##  nlme                3.1-164  2023-11-27 [2] CRAN (R 4.4.0)
##  officer             0.6.6    2024-05-05 [1] CRAN (R 4.4.0)
##  openssl             2.2.0    2024-05-16 [1] CRAN (R 4.4.0)
##  parameters          0.22.1   2024-07-21 [1] CRAN (R 4.4.1)
##  pillar              1.9.0    2023-03-22 [1] CRAN (R 4.4.0)
##  pkgbuild            1.4.4    2024-03-17 [1] CRAN (R 4.4.0)
##  pkgconfig           2.0.3    2019-09-22 [1] CRAN (R 4.4.0)
##  pkgload             1.4.0    2024-06-28 [1] CRAN (R 4.4.1)
##  profvis             0.3.8    2023-05-02 [1] CRAN (R 4.4.0)
##  promises            1.3.0    2024-04-05 [1] CRAN (R 4.4.0)
##  psych             * 2.4.6.26 2024-06-27 [1] CRAN (R 4.4.1)
##  purrr             * 1.0.2    2023-08-10 [1] CRAN (R 4.4.0)
##  R6                  2.5.1    2021-08-19 [1] CRAN (R 4.4.0)
##  ragg                1.3.2    2024-05-15 [1] CRAN (R 4.4.0)
##  Rcpp                1.0.13   2024-07-17 [1] CRAN (R 4.4.1)
##  readr             * 2.1.5    2024-01-10 [1] CRAN (R 4.4.0)
##  remotes             2.5.0    2024-03-17 [1] CRAN (R 4.4.0)
##  rlang               1.1.4    2024-06-04 [1] CRAN (R 4.4.0)
##  rmarkdown           2.27     2024-05-17 [1] CRAN (R 4.4.0)
##  rprojroot           2.0.4    2023-11-05 [1] CRAN (R 4.4.0)
##  rstatix             0.7.2    2023-02-01 [1] CRAN (R 4.4.0)
##  rstudioapi          0.16.0   2024-03-24 [1] CRAN (R 4.4.0)
##  sandwich            3.1-0    2023-12-11 [1] CRAN (R 4.4.0)
##  sass                0.4.9    2024-03-15 [1] CRAN (R 4.4.0)
##  scales              1.3.0    2023-11-28 [1] CRAN (R 4.4.0)
##  sessioninfo         1.2.2    2021-12-06 [1] CRAN (R 4.4.0)
##  shiny               1.8.1.1  2024-04-02 [1] CRAN (R 4.4.0)
##  stringi             1.8.4    2024-05-06 [1] CRAN (R 4.4.0)
##  stringr           * 1.5.1    2023-11-14 [1] CRAN (R 4.4.0)
##  survival            3.5-8    2024-02-14 [2] CRAN (R 4.4.0)
##  svglite             2.1.3    2023-12-08 [1] CRAN (R 4.4.0)
##  systemfonts         1.1.0    2024-05-15 [1] CRAN (R 4.4.0)
##  textshaping         0.4.0    2024-05-24 [1] CRAN (R 4.4.0)
##  TH.data             1.1-2    2023-04-17 [1] CRAN (R 4.4.0)
##  tibble            * 3.2.1    2023-03-20 [1] CRAN (R 4.4.0)
##  tidyr             * 1.3.1    2024-01-24 [1] CRAN (R 4.4.0)
##  tidyselect          1.2.1    2024-03-11 [1] CRAN (R 4.4.0)
##  tidyverse         * 2.0.0    2023-02-22 [1] CRAN (R 4.4.0)
##  timechange          0.3.0    2024-01-18 [1] CRAN (R 4.4.0)
##  tzdb                0.4.0    2023-05-12 [1] CRAN (R 4.4.0)
##  urlchecker          1.0.1    2021-11-30 [1] CRAN (R 4.4.0)
##  usethis             2.2.3    2024-02-19 [1] CRAN (R 4.4.0)
##  utf8                1.2.4    2023-10-22 [1] CRAN (R 4.4.0)
##  uuid                1.2-0    2024-01-14 [1] CRAN (R 4.4.0)
##  vctrs               0.6.5    2023-12-01 [1] CRAN (R 4.4.0)
##  viridisLite         0.4.2    2023-05-02 [1] CRAN (R 4.4.0)
##  withr               3.0.0    2024-01-16 [1] CRAN (R 4.4.0)
##  xfun                0.46     2024-07-18 [1] CRAN (R 4.4.1)
##  xml2                1.3.6    2023-12-04 [1] CRAN (R 4.4.0)
##  xtable              1.8-4    2019-04-21 [1] CRAN (R 4.4.0)
##  yaml                2.3.9    2024-07-05 [1] CRAN (R 4.4.1)
##  zip                 2.3.1    2024-01-27 [1] CRAN (R 4.4.0)
##  zoo                 1.8-12   2023-04-13 [1] CRAN (R 4.4.0)
## 
##  [1] C:/Users/wayne/AppData/Local/R/win-library/4.4
##  [2] C:/Program Files/R/R-4.4.0/library
## 
## ──────────────────────────────────────────────────────────────────────────────