Re: [R] Get 3 values not only 1

2021-01-27 Thread jim holtman
Is this what you are after? You need to store a vector in the list: > > # Data > PIB.hab<-c(12000,34000,25000,43000,12500,32400,76320,45890,76345,90565,76580,45670,23450,34560,65430,65435,56755,87655,90755,45675) > ISQ.2018<-c(564,587,489,421,478,499,521,510,532,476,421,467,5

Re: [R] Get 3 values not only 1

2021-01-27 Thread Jim Lemon
Hi varin, How about this: Mbv<-data.frame(MSE=rep(NA,1000), biais=rep(NA,1000),variance=rep(NA,1000)) for(i in 1 :1000) { n<-dim(Dataset)[1] p<-0.667 sam<-sample(1 :n,floor(p*n),replace=FALSE) Training <-Dataset [sam,] Testing <- Dataset [-sam,] fit2<-lm(PIB.hab~ISQ.2018) ypred<-predict(fit

[R] Get 3 values not only 1

2021-01-27 Thread varin sacha via R-help
Dear R-experts, Here below my R code working but I would like to get 3 values not only 1. The value I get is, according to my R code, the variance value. My goal is to get 3 values : the bias value, the variance value and the MSE value. How to solve my problem ? Many thanks. #