Lab: Confidence intervals and t-tests using S-Plus

Purpose and summary of procedures

The purposes of today's lab are

Description of the data

This dataset contains information about the salaries, education, and experience for a sample of 93 bank employees, who began their time at the bank in skilled, entry-level clerical positions. (The bank was sued for alleged gender discrimination in salaries, and this sort of data came under intense scrutiny.) The data was released in the report "Harris Trust and Savings Bank: An Analysis of Employee Compensation", Report 7946, Center for Mathematical Studies in Business and Economics, University of Chicago Graduate School of Business, 1979. We have the following variables in the data set (in this order):

Obtaining the data

You can obtain this data by clicking here. Use the Netscape menus (File, then Save As)to save the data to a file on your desktop (say "bankdata.txt").

Starting S-Plus and getting the data

To start S-Plus, click Start, then Programs, then Statistics & Mathematics, then S-PLUS 2000. To read the data into S-Plus, choose from the S-Plus menus File, then Import Data, then From file. Choose the file that you have just saved. You should have a spreadsheet open with data in four columns. Note: By default, S-Plus will name the dataset according to the name of the file from which the data was imported.

Using S-Plus for t-tests

1.Let's say we're interested in conducting a t-test to know whether the mean salary in 1977("sal1977") differed significantly from $10250. We'd like to test at significance level 5%. To obtain this, go to Statistics, Compare samples, One sample, and finally t Test. (S-Plus can still use a t-test for sample sizes over 30 since it can give better numerical approximations of the quantiles of t distribution than we have available in the book's t table.)

2.Let's say that we want to know beta, the probability of type II error, for the test above (with alpha=0.10), if the mean salary is really $10500. We use the fact that power=1-beta, and use the menu Statistics, Power and sample size, Normal mean. We want to find "power" (rather than sample size or minimum difference), so we have to make sure to choose the right button. We also have to make sure that we have the right information listed in the other fields, such as the alpha value, the fact that this is a one sample test (only one mean involved), and the sample standard deviation of our data. (You can find this using the summary statistics option that we've used in several other labs.)