Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #code for my discriminant analysis
  2. hab.lda <- lda(grp ~ ., data=hab_std)
  3.  
  4. hab.lda.values <- predict(hab.lda, hab_std)
  5. hab.class <- predict(hab.lda)$class
  6.  
  7. #create a histogram of the discriminant function values
  8. ldahist(data = hab.lda.values$x[,1], g=grp)
  9.  
  10. #create a scatterplot of the discriminant function values
  11. plot(hab.lda.values$x[,1], type="n", xlim=c(0,30), ylab=c("LDA Axis 1"))
  12. text(hab.lda.values$x[,1], row.names(hab_std), col=c(as.numeric(hab.class)+10))
  13. abline(v=0, lty="dotted")
  14. abline(h=0, lty="dotted")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement