Lecture 4

We discussed the robustness of t-statistics against departures in the underlying normality assumptions.

Running t-tests in Minitab is simple. The menus are under Stat > Basic Statistics.
Tests of equal variances in two locations, Stat > Basic Statistics > 2 Variances
Stat > ANOVA > Test for Equal Variances.
Tests for normality are under Stat > Basic Statistics > Normality Test

To simulate data to explore the robustness of a 2-sample t-test formed without pooling variances, we write an ASCII text file called loop.MAC with code such as what follows. In this code,

k1 = s.d.(column 1)
k2 = s.d.(column 2)
k3 = d.f. calculated from the formula given in class when you do not assume equal variances
k4 = the t-cut off for having 97.5% of the distribution to the left when the degrees of freedom are given by k3
k5 = t-statistic to test whether or not the means of column 1 and column 2 are the same or not without assuming the variances are equal.
k6 = looping variable.

Commands in a file called simulations.MAC.

Do k6 = 1:100
Random 30 c1;
Normal 0.0 1.0.
Random 30 c2;
Normal 0.0 4.0.
let k1= stdev(c1)
let k2 = stdev(c2)
let k3 = (k1**2/30 + k2**2/30)**2/( (1/29)*(k1**2/30)**2 + (1/29)*(k2**2/30)**2 )
InvCDF .975 k4;
T k3.
let k5 = (mean(c1) - mean(c2))/sqrt(k1**2/30 + k2**2/30)
if abs(k5) > k4
let c3(k6) = 0
let c3(k6) = 1

In the Minitab session window, type %simulations to run this code.

What is the sample size from each population in the code above? Which numbers need to be changed if you wanted to compare samples of size 10 from each population? Samples of size 10 from the first population to samples of size 20 from the second population? If you wanted to run 1,000 or 10,000 trials instead of only 100? If you wanted to compare populations where the standard deviation of the second is only twice that of the first?