library(purrr)
## Warning: package 'purrr' was built under R version 4.3.2
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.3.2
## Warning: package 'ggplot2' was built under R version 4.3.2
## Warning: package 'tidyr' was built under R version 4.3.2
## Warning: package 'readr' was built under R version 4.3.2
## Warning: package 'dplyr' was built under R version 4.3.2
## Warning: package 'forcats' was built under R version 4.3.2
## Warning: package 'lubridate' was built under R version 4.3.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ── 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

Introduction

The data I will be using primarily for these data dives are survey responses from students taking undergraduate physics courses here at IUPUI.

There are a number of important questions that can be answered by this data, but primarily, I am interested in when students gain the most in computational skills and when students become most “expert-like” in their opinions of computational methods in physics. For the scope of this class, the questions can be summarised as:

  1. When do students become most “expert-like” for the first five Likert scale survey items?
  2. When do students report the highest “gains” for the seven specific skills in the survey (i.e., the “Intial5” and “Present5” columns through the “Intial11” and “Present11” columns)?
  3. What skills show the highest relative gains throughout the undergraduate physics program at IUPUI?
  4. What is the mean response for a single survey item per semester?

Data Column Summaries

First, setting a variable, “data” in this case, as the Excel spreadsheet (this could also be done if the data was a CSV file).I want to exclude any NA values as those are simply cases where a student did not answer a question. The ‘view’ command is just there for me to make sure that the data has imported correctly.

library(readxl)
data0 <- read_excel("~/IUPUI/Research/Computational_Data/Comp_Data/F18-F23_Survey_Data.xlsx")
na.pass(data0)
View(data0)

The instructions for this data dive require numerical summaries for two columns. The dataset is sorted in chronological order of the semester during which the survey was completed. Because of this, it would be more beneficial to pull the average response for a couple columns based on the semester surveyed as opposed to simply averaging over entire columns. To do this, I’ll borrow the same method we had in class. For the first numerical summary, let’s just look at the average numerical response to the first Likert scale question (i.e., column 5 in the data set) for the first semester surveyed (Fall 2018).

data0 |>
  filter(Semester == "F18") |>
  pluck("Comp1") |>
  mean()
## [1] 3.88

Next, let’s find the standard deviation of this column as well.

data0 |>
  filter(Semester == "F18") |>
  pluck("Comp1") |>
  sd()
## [1] 0.8326664

This can be done for multiple columns of data as well, so moving on to the second Likert scale item (i.e, column 6).

data0 |>
  filter(Semester == "F18") |>
  pluck("Comp2") |>
  mean()
## [1] 3.68
data0 |>
  filter(Semester == "F18") |>
  pluck("Comp2") |>
  sd()
## [1] 0.9451631

I would also like the total number of responses, which can be done by:

data0 |>
  filter(Semester == "F18") |>
  pluck("Comp2") |>
  length()
## [1] 25

The above gives summaries for the average, standard deviation, and number of responses for the first two survey items for the fall of 2018. An important consideration for the future could be to make a new data set of just the averages, count, standard deviation, and standard error.

Lastly, let’s aggregate the two means to help address the fourth research question. To do so, we can do something like:

data0 |>
  group_by(Semester) |>
  summarise(mean_comp1 = mean(Comp1))

Data Visualization

For this data, it makes sense to use boxplots as they will show where most of the data is located, the range of the data, the average, and will show outliers. Because I am a novice with r, I will make two separate plots, one for Comp1 and one for Comp2.

For the first plot of Comp1:

plot1 <-
  ggplot(data = data0, mapping = aes(x = Semester, y = Comp1))+
  geom_boxplot()
  
plot1
## Warning: Removed 25 rows containing non-finite values (`stat_boxplot()`).

For the second plot of Comp2:

plot2 <-
  ggplot(data = data0, mapping = aes(x = Semester, y = Comp2))+
  geom_boxplot()
  
plot2
## Warning: Removed 25 rows containing non-finite values (`stat_boxplot()`).

It is interesting that the data in both cases seems to be fairly clustered, with most responses being in the 4-5 range. This is particularly interesting because it seems to imply that most students who took the survey are quite “expert-like” because in a Likert scale survey, the closer the students go to “completely agree,” the more they are considered to be “expert-like,” at least in this case.