11 Mean Inference

In this section, we describe how you can use Rguroo to construct confidence intervals and conduct tests of hypotheses for a single population mean and the difference of two population mean. You can perform these analyses using both summary statistics and raw data. Rguroo has many methods, including theory-based and simulation-based methods. In this guide, we will show examples of basic methods. By default, tests of hypotheses are performed using p-values. However, you can see output based on the critical region method by clicking on the Details button buttons.

11.1 Confidence Interval for a Single Population Mean

Instructional video icon

11.1.1 Using summary statistics

Instructions for obtaining confidence interval for single population mean with summary data

  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One Population . The One Population Mean Inference dialog will open (see Figure 11.1).

  2. In the Data section, Enter Sample Mean, one or both of Sample Standard Deviation or Population Standard Deviation, and the Sample Size.

  3. In the textbox labeled \(\bf\mu\) = Mean of, enter a variable label.

  4. In the Confidence Interval tab, set the confidence level, and select one or both of t-statistic or r des(“z-statistic”)`.

  5. Click the Preview icon preview icon to view the result.

    One population mean inference R guroo dialog

    Figure 11.1: One population mean inference dialog.

11.1.2 Using raw data

Instructions for obtaining confidence interval for single population mean with raw data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One Population (see Figure 11.2).

  2. Select a Dataset and a Variable. The summary statistics will automatically populate.

  3. In the Confidence Interval tab, set the confidence level, and select one or more of the methods.

  4. Click the Preview icon preview icon to view the result.

Figure 11.2: One population mean inference dialog.

11.2 Confidence Interval for Difference of Two Population Means (Independent Samples)

Instructional video icon

11.2.1 Using summary statistics

  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.3).

  2. Under the Summary tab enter the following information for Populations 1 and 2: Label, Sample Mean, Sample Size, and one or both of Sample S.d. and Pop S.d..

  3. Click the Population 1-2 tab, and in the Confidence Interval tab enter the Confidence level, and select one or both of the methods t-statistic or z-statistic, as appropriate.

  4. Click the Preview icon preview icon to view the result.

Figure 11.3: Two population mean inference dialog.

11.2.2 Using raw data

Instructions for obtaining confidence interval for difference of two population means with raw data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.4).

  2. Select a Dataset.

  3. There are two methods for data input in the Data section:

  1. If the data for the two populations are in two numerical columns, select the columns from the Variable 1 and Variable 2 dropdowns. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. If one variable includes numerical values and there is a corresponding factor (categorical) variable that includes indicators for Population 1 and 2, select the numerical variable from the Variable dropdown and the factor (categorical) variable from the By Factor dropdown. In this example, we use this method where we compare Miles Per Gallon (MPG) for Domestic and Imported cars.

  1. (This step is required if you used Method 4b). In the Summary tab from the Level dropdowns, select the indicators for Population 1 and Population 2. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. Click the Population 1-2 tab, and in the Confidence Interval tab enter the Confidence level and select one or more of the methods as appropriate.

  3. (Optional) In the Assumptions section select appropriate assumptions.

  4. Click the Preview icon preview icon to view the result.

Dialog for two population mean inference

Figure 11.4: Two population mean inference dialog.

11.3 Confidence Interval for Difference of Two Population Means (Paired Data)

Instructions for obtaining confidence interval for difference of two population means with paired data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the freshman_weight dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Freshmen weight dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.5).

  2. Select a Dataset.

  3. There are two methods for data input in the Data section:

  1. If the data for the two populations are in two numerical columns, select the columns from the Variable 1 and Variable 2 dropdowns. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. If one variable includes numerical values and there is a corresponding factor (categorical) variable that includes indicators for Population 1 and 2, select the numerical variable from the Variable dropdown and the factor (categorical) variable from the By Factor dropdown. In this example, we use this method where we compare Miles Per Gallon (MPG) for Domestic and Imported cars.

  1. (This step is required if you used Method 4b). In the Summary tab from the Level dropdowns, select the indicators for Population 1 and Population 2. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. After you are done with steps 4 and 5, select the checkbox Paired Data. The summary statistics for the Paired Differences auto-fill.

  3. Click the Population 1-2 tab, and in the Confidence Interval tab enter the Confidence level and select one or more of the methods as appropriate.

  4. Click the Preview icon preview icon to view the result.

Dialog for two population mean inference paired data

Figure 11.5: Two population mean inference dialog.

11.4 Test of Hypothesis for a Single population mean

Instructional video icon

11.4.1 Using summary statistics

Instructions for testing hypothesis for a single population mean with summary data

  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One Population . The One Population Mean Inference dialog will open (see Figure @ref(fig:onePop_Summary_ht)).

  2. In the Data section, Enter Sample Mean, one or both of Sample Standard Deviation or Population Standard Deviation, and the Sample Size.

  3. In the textbox labeled \(\bf\mu\) = Mean of, enter a variable label.

  4. In the Test of hypothesis tab, set the confidence level, and select one or both of t-statistic or r des(“z-statistic”)`.

  5. Click the Preview icon preview icon to view the result.

One population mean inference R guroo dialog

11.4.2 Using raw data

Instructions for testing hypothesis for a single population mean with raw data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.


  1. Select a Dataset and a Variable. The summary statistics will automatically populate.

  2. In the Test of Hypothesis tab, set the confidence level, and select one or more of the methods t-statistic, z-statistic, Bootstrap t-statistic, and Bootstrap Unscaled.

  3. Click the Preview icon preview icon to view the result.

11.5 Test of Hypothesis for Difference of Two Population Means (Independent Samples)

Instructional video icon

11.5.1 Using summary statistics

Instructions for testing hypothesis for difference of two population means with summary data

  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.6).

  2. Under the Summary tab, enter the following information for Populations 1 and 2: Label, Sample Mean, Sample Size, and one or both of Sample S.d. and Pop S.d..

  3. Click the Population 1-2 tab, and in the Test of Hypothesis tab, enter the Significance level, and Alternative Hypothesis for the difference \(\mu_1-\mu_2\).

  4. Select one or both of the methods t-statistic or z-statistic.

  5. (Optional) In the Assumptions section, select Unequal Variances or Equal Variances.

  6. Click the Preview icon preview icon to view the result.

Entering data for two population mean

Figure 11.6: Two population mean inference dialog.

Entering data for two population mean

11.5.2 Using raw data

Instructions for testing hypothesis for difference of two population means with raw data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Cardata dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.7).

  2. Select a Dataset.

  3. There are two methods for data input in the Data section:

  1. If the data for the two populations are in two numerical columns, select the columns from the Variable 1 and Variable 2 dropdowns. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. If one variable includes numerical values and there is a corresponding factor (categorical) variable that includes indicators for Population 1 and 2, select the numerical variable from the Variable dropdown and the factor (categorical) variable from the By Factor dropdown. In this example, we use this method where we compare Miles Per Gallon (MPG) for Domestic and Imported cars.

  1. (This step is required if you used Method 4b). In the Summary tab from the Level dropdowns, select the indicators for Population 1 and Population 2. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. Click the Population 1-2 tab, and in the Test of Hypothesis tab, enter the Significance level, and Alternative Hypothesis for the difference \(\mu_1-\mu_2\).

  3. Select one or more of the methods t-statistic or z-statistic, Bootstrap t-statistic , Bootstrap Unscaled, Permutation t-statistic , Permutation Unscaled.

  4. (Optional) In the Assumptions section, select Unequal Variances or Equal Variances.

  5. Click the Preview icon preview icon to view the result.

Dialog for two population mean inference inputing data

Figure 11.7: Two population mean inference dialog.

Dialog for two population mean inference test of hypothesis input

11.6 Test of Hypothesis for Difference of Two Population Means (Paired Data)

Instructions for testing hypothesis for difference of two population means with paired data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the freshman_weight dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Freshmen weight dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Mean Inference —> One & Two Population. The Two Population Mean Inference dialog will open (see Figure 11.8).

  2. Select a Dataset.

  3. There are two methods for data input in the Data section:

  1. If the data for the two populations are in two numerical columns, select the columns from the Variable 1 and Variable 2 dropdowns. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. If one variable includes numerical values and there is a corresponding factor (categorical) variable that includes indicators for Population 1 and 2, select the numerical variable from the Variable dropdown and the factor (categorical) variable from the By Factor dropdown. In this example, we use this method where we compare Miles Per Gallon (MPG) for Domestic and Imported cars.

  1. (This step is required if you used Method 4b). In the Summary tab from the Level dropdowns, select the indicators for Population 1 and Population 2. The summary statistics for Populations 1 and 2 automatically populate under the Summary tab.

  2. After you are done with steps 4 and 5, select the checkbox Paired Data. The summary statistics for the Paired Differences auto-fills.

  3. Click the Population 1-2 tab click the Hypothesis Test tab and select Paired Data in the Assumptions section on the left.

  4. Enter the Significance level, and state the Alternative Hypothesis for \(\mu_d\), the mean of differences.

  5. Select one or more of the methods t-statistic or z-statistic, Bootstrap t-statistic , Bootstrap Unscaled, Permutation t-statistic , Permutation Unscaled.

  6. Click the Preview icon preview icon to view the result.

Dialog for two population mean inference paired data

Figure 11.8: Two population mean inference dialog.

Dialog for two population mean inference paired data