← Ders sayfası

STUDENT WORKBOOK / THREE 90-MINUTE LABS

Psychology R: First 3 Labs

Özgün özel ders çalışma kitabı. Resmî UCL içeriği değildir; gerçek öğrenci ve katılımcı verisi kullanılmaz.

Lab 01 · Research questions, scripts & vectors

Outcomes: Save and run a script; explain the outcome and explanatory variable; use vectors and graphs.

  1. 0–10: Predict 5+3*2 and length(c(4,8,12)).
  2. 10–25: Discuss “Does sleep cause faster reaction time?” Explain possible confounders.
  3. 25–45: Run Lab 01 script line by line.
  4. 45–65: Build sleep_hours <- c(6,8,7,5), find mean and values above six.
  5. 65–77: Plot a four-trial example and debug a wrong object name.
  6. 77–90: Write three lines independently and explain association vs causation.

Control questions

How does Console differ from a script? Why does marks[1] select the first item? Can our invented data prove causality?

Homework

Create five invented values and plot them; explain the graph in one sentence.

Lab 02 · CSV, factors & missingness

Outcomes: Import CSV, identify variables and types, inspect missing values responsibly.

  1. 0–10: Run source("scripts/check_setup.R") from the unpacked root.
  2. 10–25: Describe columns id, condition, rt_ms, memory_pre, memory_post, sleep_hours, response, gain.
  3. 25–45: Run Lab 02 script; inspect str, names and head.
  4. 45–65: Convert condition to factor, set one reaction time to NA in a copy.
  5. 65–77: Compare mean(x) and mean(x, na.rm=TRUE).
  6. 77–90: Explain why missing values are not measured zeroes.

Control questions

Why is id not a numeric measurement? Which column is a factor? Why use a copy before editing?

Homework

Create an eight-column data dictionary, including measurement units.

Lab 03 · Descriptive statistics

Outcomes: Compute mean, median, SD, IQR and SE; compare groups; explain outliers.

  1. 0–10: Revisit factor and NA.
  2. 10–25: Explain differences among mean, median, SD and SE.
  3. 25–45: Run Lab 03 script; report results in milliseconds.
  4. 45–65: Group means: Control, Training, Mindfulness.
  5. 65–77: In a copy replace first RT with 900; compare mean and median.
  6. 77–90: Draft three evidence-limited sentences describing the synthetic data.

Control questions

How is SD different from SE? Why can an outlier strongly affect the mean? What do these fabricated data not tell us?

Homework

Write a 100–150 word English descriptive note naming the artificial data source and limitations.