StatCrunch logo (home)

< StatCrunch Examples
Conducting hypothesis tests for the difference between two means with raw data
This tutorial covers the steps for conducting hypothesis tests 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 Conducting hypothesis tests for the difference between two means with summary data.
Performing a two-sample hypothesis test
Is there a significant difference in the average size of four-bedroom homes listed for sale in the two cities? This can be tested by conducting a hypothesis test for the difference between the mean square footage of four-bedroom homes listed for sale in each location. To compute the appropriate two-sample T hypothesis test results, 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, the Hypothesis test for μ1 - μ2 is selected by default. Leave the null value at 0 to directly compare the two means. The alternative hypothesis can be changed to > or < , but for this scenario leave the alternative hypothesis at since the goal is to detect any type of difference. Click Compute! to view the hypothesis test results. The output table below provides various statistics from this test including the test statistic and the P-value.

Always Learning