Skip to content

Commit

Permalink
plotly working
Browse files Browse the repository at this point in the history
dcr-eyethink committed Apr 24, 2024
1 parent e63c605 commit a08dcac
Showing 6 changed files with 78 additions and 41 deletions.
34 changes: 21 additions & 13 deletions analysis.Rmd
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ output: html_document

This is a notebook to analyse NNS data from 2014-2023, based on data from NSS wesbite.

# Preprocessing

If you don't have eyethinkdata tools, install from github

```{r, eval=FALSE}
@@ -20,6 +22,7 @@ Load in the package and the raw data. Note that this has been filtered to just p

```{r}
library(eyethinkdata)
library(plotly)
full_data <- fread("NSS_2014-23.csv")
qkey <- data.table(read.csv("qkey3.csv"))
```
@@ -63,20 +66,25 @@ ggplot(d,aes(x=r,colour=year,group=year))+geom_density()

So it broadly looks as though agreement in these statement overall peaks around the positive, "agree" response, but that over the years, responses have been slipping down for everyone.

Now let's plot UCL's last 10 years for each theme There are vertical gray bars here to denote when questionnaire changed, making comparisons difficult. I am going to exclude the themes for mental_health, personal, overall satisfaction and freedom as they only have single question each that were only asked in a handful of years.
# UCL results across the years

Now let's plot UCL's last 10 years for each theme There are vertical gray bars here to denote when questionnaire changed, making comparisons difficult. I am going to exclude the themes for mental_health, personal, overall satisfaction and freedom as they only have single question each that were only asked in a handful of years. This is an interactive plot, so you can hover over the dots to see the questions, or zoom into regions

```{r}
d[,tm:=ifelse(theme %in% c("mental_health", "personal", "freedom","overall"),FALSE,TRUE)]
# this is a plot element with the new questionnaires marked. We can reuse it
yp <- geom_vline(data=data.table(year=c(2016.5,2022.5)),alpha=0.1,linewidth=3,aes(xintercept=year))
pirateye(d[Institution=="University College London" & tm],x_condition = "year",
colour_condition = "theme",line = T,dv="r",violin = F,error_bars = F)+yp
yp <- geom_vline(data=data.table(year=c(2016.5,2022.5)),alpha=0.1,size=3,aes(xintercept=year))
p <- ggplot(d[Institution=="University College London" & tm],aes(x=year,y=r,colour=theme,text=paste(theme,q)))+yp+
geom_line(data=d[Institution=="University College London" & tm,.(r=mean(r)),by=.(year,theme)],
aes(x=year,colour=theme,y=r),inherit.aes = F,size=1.5,alpha=.4)+
geom_point(position = position_jitter(width = 0.3, height = 0.1),alpha=.6,size=2)+theme_bw()
ggplotly(p,tooltip = "text")
```


So people love our resources! The rankings seem pretty stable over time here. Rankings seem higher pre 2017 and there is a drop off in 2023, but as the grey lines show, these changes are confounded by a different set of questions (and responses). What does seem clear here is that our weak point is our assessments. These are ranked low and if anything have been getting worse.

# UCL vs all other psych depts

How do we match up with the average psych dept? Here's all rankings over the years, comparing UCL against all other psych depts.

```{r}
@@ -96,13 +104,13 @@ pirateye( d[ucl & tm],x_condition = "year",colour_condition = "theme",dodgewidt

So now the psychology sector average for each year is 0, shown by heavy black line. Benchmarked like this, it looks like we had a good period of growth from 2016 onwards, and in the pandemic years we were well above the mean in almost everything. But again, our assessments are ranked below the mean and perhaps trending down

Let's try an interactive plot of the same info:
Let's try an interactive plot of the same info - hoover on dots to see what individual questions are.

```{r}
library(plotly)
p <- ggplot(d[Institution=="University College London" & tm],aes(x=year,y=rzall,colour=theme))+
geom_line(data=d[Institution=="University College London" & tm,.(rzall=mean(rzall)),by=.(year,theme)])+ geom_point()
ggplotly(p)
p <- ggplot(d[Institution=="University College London" & tm],aes(x=year,y=rzall,colour=theme,text=q))+
yp+geom_hline(aes(yintercept=0))+
geom_line(data=d[Institution=="University College London" & tm,.(rzall=mean(rzall)),by=.(year,theme)],aes(x=year,colour=theme,y=rzall),inherit.aes = F,size=1.5,alpha=.4)+
geom_point(position = position_jitter(width = 0.3, height = 0.1),alpha=.6,size=2)+theme_bw()
ggplotly(p,tooltip = "text")
```


Binary file modified analysis/r theme-year.pdf
Binary file not shown.
Binary file modified analysis/r ucl_all-year.pdf
Binary file not shown.
Binary file modified analysis/rzall theme-year.pdf
Binary file not shown.
77 changes: 53 additions & 24 deletions docs/index.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions qkey3.csv
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@ Q19,The course has helped me present myself with confidence.,personal,confidence
Q20,My communication skills have improved.,personal,commskill,"I have been able to access course-specific resources (e.g. equipment, facilities, software, collections) when I needed to",resource,access,"How well have the library resources (e.g., books, online services and learning spaces) supported your learning?",resource,library
Q21,"As a result of the course, I feel confident in tackling unfamiliar problems.",personal,problemsolve,I feel part of a community of staff and students,community,staffstudent,"How easy is it to access subject specific resources (e.g., equipment, facilities, software) when you need them?",resource,access
Q22,"Overall, I am satisfied with the quality of the course.",overall,satisfied,I have had the right opportunities to work with other students as part of my course,community,studentwork,To what extent do you get the right opportunities to give feedback on your course?,voice,opportunity
Q23,,,,I have had the right opportunities to provide feedback on my course,voice,opportunity,To what extent are students' opinions about the course valued by staff?,voice,valued
Q24,I am satisfied with the Students' Union (Association or Guild) at my institution.,union,rep,Staff value students� views and opinions about the course,voice,valued,How clear is it that students' feedback on the course is acted on?,voice,acted_upon
Q25,,,,It is clear how students� feedback on the course has been acted on,voice,acted_upon,How well does the students' union (association or guild) represent students' academic interests?,union,rep
Q26,,,,The students� union (association or guild) effectively represents students� academic interests,union,rep,How well communicated was information about your university/college's mental wellbeing support services?,mental_health,comms
Q23,,,,I have had the right opportunities to provide feedback on my course,voice,opportunity,To what extent are students opinions about the course valued by staff?,voice,valued
Q24,I am satisfied with the Students Union (Association or Guild) at my institution.,union,rep,Staff value students� views and opinions about the course,voice,valued,How clear is it that students feedback on the course is acted on?,voice,acted_upon
Q25,,,,It is clear how students� feedback on the course has been acted on,voice,acted_upon,How well does the students union (association or guild) represent students academic interests?,union,rep
Q26,,,,The students� union (association or guild) effectively represents students� academic interests,union,rep,How well communicated was information about your university/colleges mental wellbeing support services?,mental_health,comms
Q27,,,,"Overall, I am satisfied with the quality of the course",overall,satisfied,"During your studies, how free did you feel to express your ideas, opinions, and beliefs?",freedom,expression

0 comments on commit a08dcac

Please sign in to comment.