Advertisement
ProzacR

R usefull for qsar

Dec 7th, 2011
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.65 KB | None | 0 0
  1. library(pls)
  2. qsar<-data.frame(K<-c(K1, K2, ...))
  3. qsar$x<-as.matrix(read.table("~/qsar.csv", sep=","))
  4. qsarm<-plsr(K~x, 2, data=qsar)
  5. summary(qsarm)
  6. plot(qsarm$loadings)
  7.  
  8.  
  9. qsar<-data.frame(K<-c(0.2, 235, 1.6, 3.9, 660, 314, 2, 91, 3.9))
  10. qsar$x<-as.matrix(read.table("C:/qsar3_small.csv", sep=","))
  11. library(rgl)
  12. library(scatterplot3d)
  13. s3d <- scatterplot3d(K, qsar$x[,2], qsar$x[,3])
  14. s3d$plane3d(fit)
  15.  
  16. library(MASS)
  17. step <- stepAIC(fitl, direction="both")
  18. #isprastina nereikalingus xsus is fito
  19.  
  20.  
  21. #dar geriau...
  22. library(leaps)
  23. leaps<-regsubsets(K~qsar$x, data=qsar)
  24. plot(leaps, scale="r2")
  25. #rodo juodais laukeliais ka imant kiek R^2 liks dar
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement