Thống kê sử dụng R

Bài giảng thống kê trong y học sử dụng ngôn ngữ R. Chuong 13. Phan tich su kien Chuong 14. Phan tich tong hop Chuong 15. Uoc tinh co mau Chuong 16. Lap trinh va ham Chuong 17. Mot so lenh R thong dung Chuong 18. Thuat ngu Chuong 19. Tai lieu tham khao va doc them _Muc luc Chuong …

Predicting Stock Market Returns

Predicting Stock Market Returns: R Code of Chapter 3 (right-click here to save the code in a local file) ################################################### ### The Available Data ################################################### library(DMwR) data(GSPC) ################################################### ### Handling time dependent data in R ################################################### library(xts) x1 <- xts(rnorm(100),seq(as.POSIXct(“2000-01-01″),len=100,by=”day”)) x1[1:5] x2 <- xts(rnorm(100),seq(as.POSIXct(“2000-01-01 13:00″),len=100,by=”min”)) x2[1:4] x3 <- xts(rnorm(3),as.Date(c(‘2005-01-01′,’2005-01-10′,’2005-01-12’))) x3 x1[as.POSIXct(“2000-01-04”)] x1[“2000-01-05”] x1[“20000105”] x1[“2000-04”] x1[“2000-03-27/”] x1[“2000-02-26/2000-03-03”] x1[“/20000103”] mts.vals <- matrix(round(rnorm(25),2),5,5) …