Skip to content
Prev 359811 / 398503 Next

R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]

Okay, here is a more complete example:

sample_sizes<-
 matrix(c(10,10,10,25,25,25,25,50,25,100,50,25,50,100,100,25,100,100),
 nrow=2)
# see what it looks like
sample_sizes
ssds<-c(4,4.4,5,6,8)
nssds<-length(ssds)
results<-list()
# first loop steps through the sample
for(ss in 1:dim(sample_sizes)[2]) {
 # get the two sample sizes
 ss1<-sample_sizes[1,ss]
 ss2<-sample_sizes[2,ss]
 then step through your SDs:
 ssd_index<-1
 for(ssd in  ssds) {
  # generate the two samples with the SDs
  sample1<-rnorm(ss1,ssd)
  sample2<-rnorm(ss2,ssd)
  # here run your tests, recording the results that you want
  results[[(ss-1)*nssds+ssd_index]]<-<your_test>
  ssd_index<-ssd_index+1
 }
}

The list "results" should now contain the results of whatever test you
run. Be careful to get the order right.

Jim
On Tue, Apr 5, 2016 at 8:07 PM, tan sj <sj_style_1125 at outlook.com> wrote:
Message-ID: <CA+8X3fX2Muc5nVbcsEJ0+jhv=-_yrWcEt3bqvEzyBzUoRUSfew@mail.gmail.com>
In-Reply-To: <KL1PR01MB08878FE8EBB3022261E88148B59E0@KL1PR01MB0887.apcprd01.prod.exchangelabs.com>