I'm using if then statements to represent a decision making process to determine the most appropriate two sample test (i.e. independent t, mann-whitney etc.) depending on preliminary tests.
In my monte-carlo simulation I vary the sample sizes of the two samples I randomly generate. My if then statements for the first combination of sample size correctly finds the appropriate test based on the preliminary tests across the 10 000 iterations. But as soon as the loop changes to the second combination of sample sizes it performs multiple tests but it should just be one.
Initial I just had,
if (LMean.p[i] >= .05 && Skew[i] < 2) {
IndepT[i]