## data need to be on long format
pictureLong <- reshape(picture, direction = "long", varying = list(3:4), idvar = "case",
timevar = c("pictype"), times = c("couple", "alone"))
colnames(pictureLong)[4] <- "friend_requests"
tsplit(friend_requests ~ relationship_status*pictype, random = ~1|case/pictype, data = pictureLong)
Run the code above in your browser using DataLab