Last active
March 14, 2019 16:02
-
-
Save cdriveraus/fb4bb77ab57fad8934caaaa036745adc to your computer and use it in GitHub Desktop.
Correlation and standardised regression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=100 | |
a<-rnorm(n) | |
b<-a*.5 + rnorm(n) | |
bs <- scale(b) | |
as<-scale(a) | |
summary(lm(b~a)) | |
summary(lm(a~b)) | |
summary(lm(bs~as)) | |
summary(lm(as~bs)) | |
cor(cbind(as,bs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment