LifeStats Tutorial

LifeStats is a software environment that accompanies Statistics: The Craft of Data Collection, Description, and Inverence, 3rd Edition. It consists of a series of modules for learning and doing statistics. The current modules are: Data, Correlation, Put Points, Box Model, Five-step Method, and Poker. All components are written in the Java programming language.

Data

The Data module is the name of a Java application for performing statistical analyses on real or simulated data. You start by opening a dataset or creating a new one.

The File Menu

A Dataset is tabular representation of an XML file. Observations are represented by rows and variables are represented by columns. Datasets can be created, manipulated, opened, and saved.

Opening a dataset

Click on the Data menu item under any Chapter menu in the left panel (that supports data analyses) to reveal the Data module in the right panel. A data table can be opened from the client hard drive (your computer) by selecting Open... from the File menu or from the LifeStats server by clicking Open remote... from the File menu. An Open dialog will appear. If you are opening a dataset from your file system, you may need to navigate to the directory containing the file of interest. If yoy are opening a file from the LifeStats server, you will automatically be in the correct directory. Select datasetOfInterest.xml from the Open dialog and then click the Open button. Alternately, you can double click on datasetOfInterest.xml to open the dataset. The dataset will appear in the right panel (perhaps after a short delay).

Creating a new dataset

Select New from the File menu to create a new dataset. A dataset is displayed with 10 rows (observations) and one column (variable). New observations and variables can be added by standard operations (see the Rows and Columns menus below).

Saving a dataset

You can open a dataset from the LifeStats server or create a new dataset and then save it to your local drive. You can also open a dataset from your local drive and save it back, perpaps with a different name. You cannot save a file (new or modified) to the server.

Assuming you have a dataset open in the Data panel, select Save from the File menu. If you have opened it from your local drive, it will be saved with the changes you have made. Once the Save dialog is open, you may need to navigate to a new directory before clicking the Save button. If you want to change the name of the dataset, you should choose Save as... from the File menu. If you opened it from the LifeStats server or if you created a new dataset, the Save dialog will be opened just as if you selected the Save as... menu item, i.e., you will need to name the file with the extension xml.

The Rows Menu

A dataset has one row for each observation. Rows (Observations) can be added or deleted.

Adding a row

Select Add rows... from the Row menu to add rows to a dataset. Enter the number of rows you want to add (after the last row of the dataset) in the resulting Input dialog. Rows are added to the dataset with default values depending on whether the columns represent categorical or numerical variables. If a column represents a categorical variable, the values of the new observations for the variable are missing (blank) by default. If a column represents a numerical variable, the values of the new observations for the variable are NaN (Not a Number) by default.

Deleting rows

You can delete a single selected row or any contiguous range of selected rows. Select a single row by clicking the Obs number. The row will be hilighted. If you click another row with the Shift key held down, all rows from the original selection to the newly selected row will be hilighted. Then select Delete rows from the Rows menu. The rows will be deleted and the computations and graphs linked to the dataset will be updated to reflect the new rows.

The Columns Menu

A dataset consists of a sequence of variables. Each column of the dataset represents a variable. Variables have certain attributes, but before discussing how to modify these attributes, the peocedures for adding, deleting and transforming columns (variables) will be presented.

Adding columns
Deleting columns
Transforming columns