StatCrunch logo (home)

< StatCrunch Examples
Computing confidence intervals for the difference between two means with raw data
This tutorial covers the steps for computing confidence intervals for the difference between two means in StatCrunch. To begin, load the Asking prices for 4-bedroom homes in Bryan-College Station TX data set, which will be used throughout this tutorial. The data set was collected in order to compare four-bedroom homes listed for sale in the two adjoining cities of Bryan, Texas, and College Station, Texas. Using a real estate web site, fifteen homes were randomly selected from four-bedroom homes listed for sale in Bryan, Texas, and fifteen homes were randomly selected from four-bedroom homes listed for sale in College Station, Texas. The Sqft column contains the square footage for each home, and the Location column lists the city where the home is located. This tutorial will cover using two-sample T methods for this raw data set with individual measurements on each home. A very similar approach can be used for two-sample Z methods that are appropriate for situations with larger sample sizes and/or known standard deviations. To compute two-sample results using the sample mean, sample standard deviation and sample size for two samples, see Computing confidence intervals for the difference between two means with summary data.
Calculating a confidence interval for difference in means
StatCrunch can create a confidence interval for the difference in the average size of four-bedroom homes listed for sale in the two cities. For this example, choose the Stat > T Stats > Two Sample > With Data menu option. Under Sample 1, select the Sqft column for Values in. In the corresponding Where input field, enter Location=”Bryan, TX” to limit the homes in the first sample to houses in Bryan. Make sure to type this statement accurately as such expressions are case sensitive and spaces are important. This statement can also be created by clicking on the adjoining Build button, which will open a custom expression builder. Under Sample 2 select the Sqft column. In the corresponding Where input field, enter Location=”College Station, TX” to limit the homes in second sample to houses in College Station. Under Perform, choose Confidence interval for μ1 - μ2. By default, StatCrunch has a value of 0.95 for the Level input which will produce a 95% confidence interval for the difference between the two means. Enter 0.99 for this input to produce a 99% confidence interval instead and click Compute!. The results below show a 99% confidence interval for the difference in mean square footage of four-bedroom homes in the two cities with "L. Limit" representing the lower limit and "U. Limit" representing the upper limit of this confidence interval.
Adding results to data table
In certain situations, it is convenient to use other StatCrunch routines on the results from these two-sample procedures. Choose Options > Edit to reopen the two-sample T dialog window. Turn on the Store in data table option by checking the associated box under Output and click Compute!. The results table is then stored in new data columns that can be used for subsequent calculations. This option suppresses the original table output.

Always Learning