Tech Tutorial: Explore

Tech Tutorial — Explore. A Tech Tutorial shows you how to carry out the techniques from this unit in the software your section uses. Pick one tool and follow its tab; the question, the data, and the statistical reasoning are identical across all three.

  • StatLens — nothing to install; runs in your browser. The fundamentals path.
  • Jamovi — a free, menu-driven statistics program.
  • R — code-based; reproducible and what the wider community uses.

Your choice of tool persists across every tabset in the book, so you only pick once.

The data

We use a small, synthetic first-day class survey — 50 students, with two categorical variables and three numerical ones. (It stands in for a real survey; no actual student records are involved.)

Variable Type Meaning
year categorical First-year, Sophomore, Junior, Senior
housing categorical On-campus or Off-campus
study_hours numerical hours spent studying in a typical week
sleep_hours numerical typical nightly sleep
commute_min numerical one-way commute, in minutes

Get the file: class_survey.csv. The Jamovi and StatLens steps below load this exact file.

What you’ll do

Five core Explore skills, each in your chosen tool:

  1. Get to know the data and classify variables
  2. Summarize one categorical variable
  3. Summarize one numerical variable
  4. Compare a numerical variable across groups
  5. Explore the relationship between two numerical variables

1. Get to know the data

Before any chart, look at the data and decide each variable’s type — categorical (labels) or numerical (measured amounts). This is a thinking step, not a calculation: no tool decides it for you.

  1. Open the Descriptive Statistics explorer — the class survey loads automatically.
  2. Use the variable dropdown to see every column. Numerical variables (study_hours, sleep_hours, commute_min) can be charted here; the categorical ones (year, housing) you’ll explore in steps 2 and 4.
  1. Download class_survey.csv (link above) and open it: ☰ → Open → This PC.
  2. In the Data tab, click each variable and check its Measure type — set year and housing to Nominal, and the three counts to Continuous.

(Jamovi screenshots to be added.)

library(readr)
library(dplyr)
library(ggplot2)

survey <- read_csv("../datasets/class_survey.csv") |>
  mutate(year = factor(year,
           levels = c("First-year", "Sophomore", "Junior", "Senior")))

glimpse(survey)
Rows: 50
Columns: 5
$ year        <fct> Sophomore, First-year, Junior, First-year, Senior, Sophomo…
$ housing     <chr> "On-campus", "On-campus", "On-campus", "Off-campus", "Off-…
$ study_hours <dbl> 12.0, 7.8, 15.0, 10.1, 5.1, 7.5, 12.1, 11.8, 7.9, 12.5, 6.…
$ sleep_hours <dbl> 7.6, 7.0, 9.0, 6.5, 6.0, 6.7, 7.2, 9.0, 7.3, 6.8, 6.5, 6.6…
$ commute_min <dbl> 1, 3, 3, 32, 21, 97, 11, 33, 16, 5, 40, 8, 16, 7, 11, 8, 1…

2. Summarize one categorical variable

For a categorical variable we report a frequency table (counts and proportions) and a bar chart. We’ll use year.

  1. Open the One Categorical Variable explorer.
  2. Choose year. Read the frequency table and the bar chart: which class year is most common?
  1. Exploration → Descriptives. Put year in Variables.
  2. Tick Frequency tables. Under Plots, turn on Bar plot.

(Jamovi screenshots to be added.)

# Frequency table: counts and proportions
survey |>
  count(year) |>
  mutate(proportion = round(n / sum(n), 2))
# A tibble: 4 × 3
  year           n proportion
  <fct>      <int>      <dbl>
1 First-year    18       0.36
2 Sophomore     14       0.28
3 Junior        10       0.2 
4 Senior         8       0.16
ggplot(survey, aes(x = year)) +
  geom_bar(fill = "#3E5496") +
  labs(x = "Class year", y = "Count") +
  theme_minimal(base_size = 12)

Bar chart of class year showing first-years most common, then sophomores, juniors, and seniors.

Class year of the 50 surveyed students.

3. Summarize one numerical variable

For a numerical variable we describe shape, center, and spread, and watch for outliers. We’ll use study_hours. Because the distribution is right-skewed with a high outlier, the median and IQR are more trustworthy than the mean and SD.

  1. Open the Descriptive Statistics explorer.
  2. Choose study_hours. Read the histogram (note the right skew and the lone high value), then switch the chart to a box plot.
  3. Read the mean, median, SD, and IQR from the summary panel.
  1. Exploration → Descriptives. Put study_hours in Variables.
  2. Request Mean, Median, Std. deviation, IQR.
  3. Under Plots, turn on Histogram and Box plot.

(Jamovi screenshots to be added.)

library(patchwork)

# Mean/SD vs. median/IQR — note the mean sits above the median (skew)
survey |>
  summarize(mean = mean(study_hours), median = median(study_hours),
            sd = sd(study_hours), IQR = IQR(study_hours))
# A tibble: 1 × 4
   mean median    sd   IQR
  <dbl>  <dbl> <dbl> <dbl>
1  13.9   12.8  6.64  6.67
p1 <- ggplot(survey, aes(study_hours)) +
  geom_histogram(binwidth = 4, fill = "#3E5496", color = "white") +
  labs(x = "Study hours / week", y = "Count") +
  theme_minimal(base_size = 12)

p2 <- ggplot(survey, aes(y = study_hours)) +
  geom_boxplot(fill = "#3E5496") +
  labs(y = "Study hours / week") +
  theme_minimal(base_size = 12) +
  theme(axis.text.x = element_blank())

p1 + p2

A right-skewed histogram of weekly study hours centered near 13 with one value near 39; a box plot flags that high value as an outlier.

Weekly study hours: histogram (left) and box plot (right). The distribution is right-skewed with one high outlier.

4. Compare a numerical variable across groups

To see whether a numerical variable differs between groups, use side-by-side box plots and a grouped summary. We’ll compare commute_min for On-campus vs. Off-campus students.

  1. Open the Grouped Statistics explorer.
  2. Set the response to commute_min and the grouping variable to housing. Compare the two box plots and the group medians.
  1. Exploration → Descriptives. Put commute_min in Variables and housing in Split by.
  2. Request Median and IQR; under Plots, turn on Box plot.

(Jamovi screenshots to be added.)

survey |>
  group_by(housing) |>
  summarize(median = median(commute_min), IQR = IQR(commute_min), n = n())
# A tibble: 2 × 4
  housing    median   IQR     n
  <chr>       <dbl> <dbl> <int>
1 Off-campus     16  23.2    28
2 On-campus       6   3      22
ggplot(survey, aes(x = housing, y = commute_min, fill = housing)) +
  geom_boxplot(show.legend = FALSE) +
  labs(x = "Housing", y = "Commute (min, one-way)") +
  theme_minimal(base_size = 12)

Side-by-side boxplots showing off-campus students have a higher and more variable commute than on-campus students.

One-way commute time for on-campus vs. off-campus students.

5. Explore a relationship between two numerical variables

For two numerical variables, use a scatterplot and the correlation r. We’ll look at study_hours vs. sleep_hours. Not every pair is related — part of the skill is reading a weak relationship honestly.

  1. Open the Regression / Scatterplot explorer.
  2. Read the scatterplot and the reported correlation r. Is there a clear trend, or only a weak one?
  1. Regression → Correlation Matrix. Add study_hours and sleep_hours.
  2. Read Pearson’s r. For the plot, use Exploration → Scatterplot.

(Jamovi screenshots to be added.)

# Correlation coefficient
survey |> summarize(r = round(cor(study_hours, sleep_hours), 2))
# A tibble: 1 × 1
      r
  <dbl>
1 -0.05
ggplot(survey, aes(x = study_hours, y = sleep_hours)) +
  geom_point(color = "#3E5496", size = 2) +
  labs(x = "Study hours / week", y = "Sleep (hours / night)") +
  theme_minimal(base_size = 12)

A scatterplot of study hours against nightly sleep with no clear trend; correlation is near zero.

Study hours vs. nightly sleep. The cloud of points shows little association.

If you chose the R path and want guided, hands-on practice, the OpenIntro IMS interactive tutorials cover this unit in depth (free, runs in your browser):

They use the same tidyverse style as the R tab above.

Check yourself

You can now, in your chosen tool:

These are exactly the moves you’ll need for the Explore project that follows.