Skip to content
Prev 383979 / 398502 Next

[External] Get a result but an error message as well ?

Hi Rui,

If I don't transpose t() the output of the replicate (my R code here below) I still get an error message !!

########################################
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 = replicate( 500, my.experiment() )
colnames(my.data) <- c("MSE_OLS")
mean(my.data)
########################################






Le mardi 19 mai 2020 ? 23:14:21 UTC+2, Rui Barradas <ruipbarradas at sapo.pt> a ?crit : 





Hello,

Inline.

?s 21:38 de 19/05/20, varin sacha via R-help escreveu:
Just don't transpose the output of replicate?

Hope this helps,

Rui Barradas