10.4 Raw Change
The second approach involves computing a change score by subtracting the measure at time 1 from the measure at time 2 (e.g. \(y_{t}-y_{t-1}\))
This raw change score is then typically used as the dependent variable in a regression equation.
Here we are speaking in terms of difference scores and raw change. We can plot intraindividual change, by putting time along the x-axis. This requires reshaping the data from wide format to long format.
To recap, our wide data looks like this:
## id verb1 verb2 verb4 verb6 perfo1 perfo2 perfo4 perfo6 momed grad
## 1 1 24.42 26.98 39.61 55.64 19.84 22.97 43.90 44.19 9.5 0
## 2 2 12.44 14.38 21.92 37.81 5.90 13.44 18.29 40.38 5.5 0
## 3 3 32.43 33.51 34.30 50.18 27.64 45.02 46.99 77.72 14.0 1
## 4 4 22.69 28.39 42.16 44.72 33.16 29.68 45.97 61.66 14.0 1
## 5 5 28.23 37.81 41.06 70.95 27.64 44.42 65.48 64.22 11.5 0
## 6 6 16.06 20.12 38.02 39.94 8.45 15.78 26.99 39.08 14.0 1
We can reshape our data to a long format using the reshape()
function as follows
wiscsublong <- reshape(
data = wiscsub[c("id","verb1","verb6")],
varying = c("verb1","verb6"),
timevar = "grade",
idvar = "id",
direction = "long",
sep = ""
)
wiscsublong <- wiscsublong[order(wiscsublong$id,wiscsublong$grade),]
head(round(wiscsublong,2))
## id grade verb
## 1.1 1 1 24.42
## 1.6 1 6 55.64
## 2.1 2 1 12.44
## 2.6 2 6 37.81
## 3.1 3 1 32.43
## 3.6 3 6 50.18
Now, the long data is structured in a manner amenable to plotting.
Notice here that each line indicates how an individual’s Grade 6 score differs from their Grade 1 score: intraindividual change.
library("ggplot2")
ggplot(data = wiscsublong, aes(x = grade, y = verb, group = id)) +
geom_point() +
geom_line() +
xlab("Grade") +
ylab("WISC Verbal Score") + ylim(0,100) +
scale_x_continuous(breaks=seq(1,6,by=1)) +
theme_bw()