data <- data.frame(income = c(50000, 60000, 80000, 85000, 65000),
age = c(25, 32, 47, 51, 36),
education = c(16, 18, 20, 20, 16),
savings = c(20000, 25000, 30000, 35000, 40000))
equations <- list(as.formula("income ~ age + education"),
as.formula("savings ~ age + education"))
matrix_data <- ldt:::eqList2Matrix(equations, data, addIntercept = TRUE)
print(matrix_data)
Run the code above in your browser using DataLab