Skip to content

Instantly share code, notes, and snippets.

@erykml
Created June 3, 2019 19:17
Show Gist options
  • Select an option

  • Save erykml/aded18a36b2f8fa047aecbc5a3cd48bb to your computer and use it in GitHub Desktop.

Select an option

Save erykml/aded18a36b2f8fa047aecbc5a3cd48bb to your computer and use it in GitHub Desktop.
%%R
for (i in 1:(dim(X)[2])){
cor_test <- cor.test(X[, i], lin_reg$residuals) #
print(paste('Variable:', colnames(X)[i],
'--- correlation:', as.character(cor_test$estimate),
', p-value:', as.character(cor_test$p.value), sep = " ", collapse = NULL))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment