[R] Get a result but an error message as well ?
varin sacha
v@r|n@@ch@ @end|ng |rom y@hoo@|r
Tue May 19 21:51:14 CEST 2020
Dear R-experts,
Here is my R code, I get a result but I also get an error message so I doubt I can trust the result I get.
What is going wrong ? Many thanks.
########################################
a<-c(2,4,3,4,6,5,3,1,2,3,4,3,4,5,65)
b<-c(23,45,32,12,23,43,56,44,33,11,12,54,23,34,54)
d<-c(9,4,5,3,2,1,3,4,5,6,4,9,10,11,18)
my.experiment <- function( ) {
OLS <- lm( a ~ b+d )
MSE_OLS<-mean(OLS$residuals^2)
return( c(MSE_OLS) )
}
my.data = t(replicate( 500, my.experiment() ))
colnames(my.data) <- c("MSE_OLS")
mean(my.data)
########################################
More information about the R-help
mailing list