Hola Alexander Quizá esto te pueda ser útil reg<-function(a,b,sigma,x){ data<-a+b*x+rnorm(length(x),0,sigma) lm<-lm(data~x) c(lm$coefficients[1],lm$coefficients[2]) } zz<-replicate(1000,reg(1,2,0.5,100,c(1:100))) hist(zz[1,]) Paco