Guest User

Untitled

a guest
Sep 20th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. library(ISLR)
  2. library(boot)
  3. alpha.fn=function(data,index){
  4. X=data$X[index]
  5. Y=data$Y[index]
  6. return((var(Y)-cov(X,Y))/(var(X)+var(Y)-2*cov(X,Y)))}
  7. #"renaming my variables to fit the alpha function"
  8. Xy$X=Xy$X1;
  9. Xy$Y=Xy$y;
  10. set.seed(1)
  11. alpha.fn(Xy,sample(100,100,replace=T))
  12. boot(Xy,alpha.fn,R=1000)
Advertisement
Add Comment
Please, Sign In to add comment