Abstract design matrix to separate function, update roxygen docs