Wonderful Wednesdays April 2021

Mobile app data Wonderful Wednesdays

COPD is a disease that effects adults typically aged 40 years or older. It is a chronic condition that effects the lungs of a patient. The intervention in this study was an self-management app that aimed to improve inhaler use and exercise capacity in individuals with COPD. Users of the intervention could access different videos to educate themselves around different topics to better understand COPD and what steps help improve their condition, such as exercise or smoking cessation. Users could also report other detail such as their medication use, their CAT score and even a daily symptom score on how they are feeling that day. All this information could be shared with their doctor who can then monitor and manage patients to ensure they get the right treatment for them.

Lovemore Gakava https://www.psiweb.org/sigs-special-interest-groups/visualisation
04-14-2021

Mobile app data

This was a 12-week small scale, open-label, parallel-group, randomised controlled trial of the app compared with usual care in people with mild-moderate COPD. The aim of the trial was to establish if the delivery of the self-management app would improve patients COPD impact. For this 60 participants were randomised 1:1 to either the app (N=29) or to usual care (N=31) and were stratified by COPD Severity, the study was not fully powered.

In the intervention arm:

The challenge was to explore these patterns/relationships visually.

Example 1. Animation: Dot plot over time


The video can be found here.

Pros: This is a more effective replacement to patient profile listings. It’s easy at a glance to detect patterns across patients: for example some patients had more data compared to others. You can compare across days if there are different activities for each subject.

Cons:

Possible improvements: Add an explanation to explain that activities occuring on the same week day for different weeks will be overlaid. Jittering could be used to show information where there is an overlay Frequency of activities is not visible and the size/area of the symbols could be adjusted to reflect this An overall plot showing all patients could be provided to check if there is a pattern over all patients A more effective way would be to show all the patients in grey and the patient for that panel in colour. This will help in comparing the patient to all the subjects.

link to code

Example 2. Dashboard/Multiplot: LineUp


The app can be found here.

Pros:

Cons: It might be difficult to view on smaller screens

Possible improvements:

link to code

Example 3. Visualization app





The app can be found here.

Pros:

Cons: It might be difficult to view on smaller screens

Possible improvements:

Example 3. Visualization app

Comments for the visualisation with the title: When did users register activities and watch COPD Education Videos on the App?

Pros:

Cons: The tradeoff of showing all patients in one view is that the lines for some patients will be very small

Possible improvements: There is a great variation in the number videos watched and the scale may benefit from using a logarithmic scale or cut off data (e.g. greater than 10)

Other representations: If the aim is to explore within patient patterns it might be best to have a filter to select a patient and the visualisation will show the different types of videos watched by that patient.

link to code

Code

Example 1. Animation: Dot plot over time

# Data viz PSI

#install.packages("readxl")
library("readxl")
library(lubridate)
library(dplyr)
library(ggplot2)
library(rayshader)
library(viridis)
library(gganimate)
library(scales)

setwd("C:/Users/lsh1703883/Documents/Data visualisation PSI")

viz_data <- read_excel("mobile app data.xlsx")

View(viz_data)

summary(viz_data)

str(viz_data)

viz_data$time <- lubridate::with_tz(viz_data$time, "Europe/London")
# hour
viz_data$hour <- hour(viz_data$time)
table(viz_data$hour)
# day 
viz_data$day <- wday(viz_data$date, label=TRUE)
table(viz_data$day)


# day of the week

viz_data <- viz_data %>% 
  group_by(AppID) %>% mutate(session=1:n()) 


viz_data <- viz_data %>% 
  group_by(AppID, date) %>% count(day,hour) 


viz_data <- na.omit(viz_data)

View(viz_data)


p <- ggplot(
  viz_data, 
  aes(x = as.factor(day), y=as.numeric(hour), size= 8)) + 
  geom_point(aes(fill = as.factor(AppID), colour=as.factor(AppID)))  + 
  xlab("Day of Activity in the App")+
  ylab("Time of Activity in the App ")+  
  labs(color = "Scenario")+ 
  scale_color_discrete()+
  theme_minimal()+
  guides(size = TRUE)+
  guides(alpha = FALSE)+
  guides(linetype = FALSE)+
  theme(legend.position = "none")+
  theme(axis.text = element_text(size = 12),
        title = element_text(size = 12,face="bold"),
        panel.border= element_rect(size=2,color="black",fill=NA))+
  scale_y_continuous(trans = "reverse",breaks=seq(3,21,3))
  
 
p

library(transformr)
library(av)

p <- p + transition_states(AppID, transition_length = 15, state_length = 15) +
  ggtitle(label = "Day and Time of Activity in the App",
          subtitle= 'Now showing App ID {closest_state}')

 
p <- p + theme(plot.subtitle=element_text(size=18, hjust=0, face="italic", color="dark blue")) +
  theme(plot.title=element_text(size=18, hjust=0.5, colour="black", vjust=-1))



final_animation<-animate(p,100,fps = 20,duration = 30, width = 950, height = 750,
                         renderer = av_renderer())


anim_save("./data_viz.mp4",animation=final_animation)

Back to blog

Example 2. Dashboard/Multiplot: LineUp

The rmd file can be found here.

Back to blog

Example 3. Visualization app

The code can be found here.

Back to blog

Citation

For attribution, please cite this work as

Gakava (2021, April 14). VIS-SIG Blog: Wonderful Wednesdays April 2021. Retrieved from https://graphicsprinciples.github.io/posts/2021-04-13-wonderful-wednesdays-april-2021/

BibTeX citation

@misc{gakava2021wonderful,
  author = {Gakava, Lovemore},
  title = {VIS-SIG Blog: Wonderful Wednesdays April 2021},
  url = {https://graphicsprinciples.github.io/posts/2021-04-13-wonderful-wednesdays-april-2021/},
  year = {2021}
}