Project Topic

Researchers in Sri Lanka wanted to explore the effectiveness of the Beck Anxiety Inventory Questionnaire at gauging anxiety as compared to self-reported levels of anxiety.

Data Sources

Source: https://figshare.com/articles/dataset/Beck_Anxiety_Inventory_Questionnaire_Responses_xlsx/12231026

Data Import/Cleaning

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
data <- read_csv("/Users/home/Desktop/Project/Beck Anxiety Inventory Questionnaire (Responses).csv")
## Rows: 100 Columns: 26
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (2): gender, age_group
## dbl (24): Participant_ID, tingling, hot, wobbly, non_relax, fear_worst, dizz...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
data <- tibble(data)

data <- data[-c(37),] # To remove an outlier who's data was not possible due to the BAI having an upper limit of 63, and this person had a reported score of 96

Plots/Figures

Figure 1.

Barchart - Showing Average BAI Score by Gender

## Loading required package: lattice
## Loading required package: plyr
## ------------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## ------------------------------------------------------------------------------
## 
## Attaching package: 'plyr'
## The following objects are masked from 'package:dplyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## The following object is masked from 'package:purrr':
## 
##     compact
## Warning in qt(conf.interval/2 + 0.5, datac$N - 1): NaNs produced
## Warning: Removed 1 rows containing missing values (`geom_segment()`).

Figure 2.

Lollipop Plot - Showing self_rated_anxiety scores on the Y axis, and age_group on the X axis.

Figure 3.

Pearson Correlegram - Showing the relationships between individual question scores within the BAI as well as self reported scores and ultimate BAI scores.

## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
## Warning in ggcorr(data_fig_3, method = c("everything", "pearson")): data in
## column(s) 'gender', 'age_group' are not numeric and were ignored

Figure 4.

Stacked Area Chart - Showing anxiety scores (self_reported_anxiety/BAI) for each participant.

Figure 5.

Heatmap - Showing each question’s reported rating per participant.

## $rowInd
##  [1]  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] 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] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
## [76] 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
## 
## $colInd
##  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
## 
## $Rowv
## NULL
## 
## $Colv
## NULL

Figure 6.

Violin Plot - Bai Score by Age Group along with basic statistics

## You can cite this package as:
##      Patil, I. (2021). Visualizations with statistical details: The 'ggstatsplot' approach.
##      Journal of Open Source Software, 6(61), 3167, doi:10.21105/joss.03167

Figure 7.

Scatter Plot - Showing BAI Scores, with age group and gender features.

## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
##       Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
##       if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow

Figure 8.

Animated Stacked Density Plot - Showing density curves for each bai score, stacked by age group.

## 
## Attaching package: 'plotly'
## The following objects are masked from 'package:plyr':
## 
##     arrange, mutate, rename, summarise
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.