[R] reading simulations

garciap garciap at usal.es
Sat Feb 19 16:35:06 CET 2011


Hi to all the people (again),

I'm doing some simulations with the memisc package of an own function, but
I've the problem that I didn't know how to read the result of such
simulations. My function is:

> Torre<-function(a1,N1,a2,N2)
+ {Etorre<-(a1*N1)/(1+a1*N1)
+ Efuera<-(a2*N2)/(1+a2*N2)
+ if(Etorre>Efuera)Subir=TRUE
+ if (Etorre<Efuera)Subir=FALSE
+ result<-list(Subir)
+ return(result)
+ }

> Torre<-Simulate(Torre(a1,N1,a2,N2),expand.grid(a1=3,N1=0.5,a2=c(0.01,0.02,0.05,0.1),N2=0.1),nsim=1000,seed=10000,trace=50,keep.data=TRUE)

---------------------------------------------------
  a1  N1   a2  N2
1  3 0.5 0.01 0.1
Replication  50 
Replication  100 
Replication  150 
Replication  200 
Replication  250 
Replication  300 
Replication  350 
Replication  400 
Replication  450 
Replication  500 
Replication  550 
Replication  600 
Replication  650 
Replication  700 
Replication  750 
Replication  800 
Replication  850 
Replication  900 
Replication  950 
Replication  1000 

---------------------------------------------------
  a1  N1   a2  N2
2  3 0.5 0.02 0.1
Replication  50 
Replication  100 
Replication  150 
Replication  200 
Replication  250 
Replication  300 
Replication  350 
Replication  400 
Replication  450 
Replication  500 
Replication  550 
Replication  600 
Replication  650 
Replication  700 
Replication  750 
Replication  800 
Replication  850 
Replication  900 
Replication  950 
Replication  1000 

---------------------------------------------------
  a1  N1   a2  N2
3  3 0.5 0.05 0.1
Replication  50 
Replication  100 
Replication  150 
Replication  200 
Replication  250 
Replication  300 
Replication  350 
Replication  400 
Replication  450 
Replication  500 
Replication  550 
Replication  600 
Replication  650 
Replication  700 
Replication  750 
Replication  800 
Replication  850 
Replication  900 
Replication  950 
Replication  1000 

---------------------------------------------------
  a1  N1  a2  N2
4  3 0.5 0.1 0.1
Replication  50 
Replication  100 
Replication  150 
Replication  200 
Replication  250 
Replication  300 
Replication  350 
Replication  400 
Replication  450 
Replication  500 
Replication  550 
Replication  600 
Replication  650 
Replication  700 
Replication  750 
Replication  800 
Replication  850 
Replication  900 
Replication  950 
Replication  1000 
> print(Torre)
A 'default_bucket' object with 5 variables and 4000 observations

When I try print the results I obtain this, but how can I read it? It will
seem stupid to people, but I can't! even though function summary(Torre):

> summary(Torre)
Error in object[[i]] : wrong arguments for subsetting an environment
> 


Best regards (again) and many thanks for your help

Pablo
-- 
View this message in context: http://r.789695.n4.nabble.com/reading-simulations-tp3314281p3314281.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list