survived <- c(3,2,1,1) # short data for demo (too short to build a real model)
died <- c(0,1,2,2)
dose <- c(10,10,20,20)
sex <- factor(c("male", "female", "male", "female"))
short.data <- data.frame(survived, died, dose, sex)
expand.bpairs(survived + died ~ ., short.data) # returns long form of the data
# expand.bpairs(data=short.data, y=cbind(survived, died)) # equivalent
# expand.bpairs(short.data, c(1,2)) # equivalent
# expand.bpairs(short.data, c("survived", "died")) # equivalent
# For example models, see the earth vignette
# section "Short versus long binomial data".
Run the code above in your browser using DataLab