# Calculating res_order using column-wise ordering should refer to data argument
# rather than X matrix formed by, e.g., lm().
define_data_for_res_order <- function(test_mean, data, ordering){
  if(identical(ordering, "natural") || is.list(ordering)){
    data_for_ordering <- data
    data_for_ordering[[get_response(test_mean)]] <- NULL
    data_for_ordering[["(weights)"]] <- NULL
  } else {
    data_for_ordering <- get_X(m = test_mean)
  }
  return(data_for_ordering)
}
