Sub topic 1
How psychologists study behavior scientifically
Prerequisites
This chapter assumes you have taken an introductory psychology course, can read a simple table or bar graph, and understand what a mean (average) is. The code examples use Python 3.
The scientific method in psychology
Psychologists study behavior and mental processes by asking a question, turning it into a testable prediction, collecting data, and checking whether the data support the prediction. This cycle is the scientific method. Each step limits how much a researcher can read into the results.
From question to testable hypothesis
A hypothesis is a specific, testable prediction. "Does sleep affect memory?" is a question. "Students who sleep eight hours score higher on a next-day recall test than students who sleep five hours" is a hypothesis.
Variables and operational definitions
A variable is anything that can take different values. The independent variable is the factor the researcher changes or observes. The dependent variable is the outcome measured. An operational definition states exactly how a variable is measured or manipulated, such as "the number of words recalled from a list of 20."
Measuring well: reliability and validity
Reliability means a measure gives consistent results across repeated uses. Validity means it measures what it claims to measure. A memory test can be reliable but invalid if it actually measures reading speed.
A map of research designs
Research designs differ in how much the researcher controls. In an experiment, the researcher assigns the independent variable. In a correlational study, the researcher measures two variables without changing either. Case studies examine one person or group in depth.
Experiments and random assignment
An experiment manipulates the independent variable and compares outcomes across groups. Random assignment places each participant in a group by chance, so the groups differ only in the treatment on average.
Random assignment
import random
participants = [f"P{i}" for i in range(1, 21)]
random.seed(42) # fixed seed so the assignment can be reproduced
random.shuffle(participants)
treatment = participants[:10]
control = participants[10:]
print("Treatment:", treatment)
print("Control:", control)Exercise
A researcher randomly assigns 20 participants to two groups, then finds the treatment group scored higher. Why can the researcher more confidently claim the treatment caused the difference than in a correlational study?
Show answer
Random assignment makes the groups similar on average before the treatment, so the treatment is the most likely cause of the score difference. A correlational study measures existing differences and cannot rule out other causes.