Hi listers,
I've been looking for a procedure, but I am not succeding...
I have a function that give multiple results...
Then, I would like to simulate this function n times, so I need to save/keep
the n multiple results, in order to calculate my desired statistics...
I have already tried with the RETURN and LIST FUNCTION, but I am not getting
it right...
An example of what I am looking for sounds like this...

boot<-function(a,b,c){
media<-(a+b+c)/3
var_app<-var(a)
list(media=media,var_app=var_app)
}
boot(2,4,10)

simul<-function(S){
results<-rep(0,S)
for(i in 1:S){
results[i]<-boot(2,4,10)
}
var<-var(media)
mean_var<-mean(var_app)
var_var<-var(var_app)
list(var=var,mean_var=mean_var,var_var=var_var)
}
simul(5)

-- 
View this message in context: 
http://www.nabble.com/Simulation-function-tp25027993p25027993.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to