10 Proportion Inference

In this section, we describe how you can use Rguroo to construct confidence intervals and conduct tests of hypotheses for a single population proportion and the difference of two population proportions. 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. You can see all available methods by clicking on the Details button buttons.

10.1 Confidence Interval for a Single Population Proportoion

Users guide icon

10.1.1 With summary statistics

Instructional video icon

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

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

  2. In the box labeled Factor, type a label for the categorical variable. For this example, we typed \(\color{darkred}{\texttt{Health Status}}\).

  3. In the box labeled Success, type a label for success. For this example, we typed \(\color{darkred}{\texttt{Healthy}}\).

  4. (Optional) Fill in the box labeled Failure Label. Note that this is a box next to the Frequency dropdown. For this example, we typed \(\color{darkred}{\texttt{Sick}}\).

  5. Fill in the Sample Size and # of Successes .

  6. In the section Confidence Interval, type in the confidence level and choose a method.

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

Screenshot of Proportion Inference dilog.

Figure 10.1: Proportion Inference dialog.

10.1.2 With raw data

Instructional video icon

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

  1. Use a dataset in your Rguroo account or recreate the example below by importing the Cowles dataset from the Rguroo dataset repository called car 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 the Proportion Inference —> One Population. The Proportion Inference dialog will open (see Figure 10.2).

  2. Select a Dataset, Factor variable and Success level. The summary statistics will be automatically populated.

  3. Under the Confidence Interval section, set the Confidence Level and select one or more of the methods Binomial (Exact), Bootstrap, or Large Sample z.

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

Screenshot of Proportion Inference dilog.

Figure 10.2: Proportion Inference dialog.

10.2 Confidence Interval for Difference of Two Population Proportions

Users guide icon

10.2.1 With summary statistics

Instructional video icon

Instructions for obtaining confidence interval for difference of two population proportions with summary data

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

  2. In the Response Label textbox, type a label for the response variable. For our example, we typed \(\color{darkred}{\texttt{Feeling Better}}\).

  3. In the Success Label textbox, type a label for the success. For our example, we typed \(\color{darkred}{\texttt{yes}}\).

  4. (Optional) In the Failure textbox, type a label for the failure. For our example, we typed \(\color{darkred}{\texttt{no}}\).

  5. In the Population section, type a Population Label. For our example, we typed \(\color{darkred}{\texttt{Patients}}\).

  6. In the Population 1 section in the Summary tab, type in a Label, Sample Size, and # of Successes for population 1. For our example, we typed \(\color{darkred}{\texttt{Treatment, 30, 21}}\), respectively.

  7. In the Population 2 section in the Summary tab, type in a Label, Sample Size, and # of Successes for population 2. For our example, we typed \(\color{darkred}{\texttt{Control, 50, 30}}\), respectively.

  8. Click on the Confidence Interval tab, type in a value for the Confidence Level, and select one or more of the methods Large Sample z, Bootstrap (Percentile) or Wilson Score.

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

Screenshot of Two Population Proportion Inference dilog.

Figure 10.3: Two Population Proportion Inference dialog.

10.2.2 With raw data

Instructional video icon

Instructions for obtaining confidence interval for difference of two population proportions 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. Click on the Analysis dropdown menu and select Proportion Inference —> Two Populations.

  2. Select a Dataset. Under the Response/Success section, select a Response variable and a level corresponding to Success. In our example, we selected CLASS as a response variable and Sport as the level indicating success.

  3. From the Population dropdown in the Population section, select a variable that indicates population. In our example, we selected Type.

  4. (Optional) If data are in the form of a frequency table, select the Frequency variable.

  5. In the Population 1 and Population 2 sections in the Data Summary tab, select the levels representing the populations from their respective Level dropdowns. In our example, we selected Domestic cars for population 1 and Import for population 2. The summary statistics will be automatically populated.

  6. Open the Confidence Interval tab. Set a Confidence Level and select one or more of the methods Large Sample z, Bootstrap (Percentile) or Wilson Score.

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

Screenshot of Two Population Proportion Inference dilog.

Figure 10.4: Two Population Proportion Inference dialog.

10.3 Test of Hypothesis for a Single Population Proportion

Users guide icon

10.3.1 Using summary statistics

Instructional video icon

Instructions for conducting a test of hypothesis for a single population proportion with summary data

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

  2. Type in a Factor Label and Success Label. Enter the Sample Size and # of Successes.

  3. Under the Test of Hypothesis section, specify your Alternative hypothesis, select a method by checking one or more of the checkboxes Binomial, Simulation Method, or Large Sample z (p = p0). Also, set a Significance Level.

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

Screenshot of one Population Proportion Inference dilog.

Figure 10.5: One Population Proportion Inference dialog.

10.3.2 Using raw data

Instructions for conducting a test of hypothesis for a single population proportion with raw data

  1. Use a dataset in your Rguroo account or recreate the example below by importing the Cowles dataset from the Rguroo dataset repository called car 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 the Proportion Inference —> One Population. The Proportion Inference dialog will open (see Figure 10.6).

  2. Select a Dataset, a Factor variable, and the Success level. The summary statistics will be automatically populated.

  3. Under the Test of Hypothesis section, specify your Alternative hypothesis, select a method by checking one or more of the checkboxes Binomial, Simulation Method, or Large Sample z (p = p0). Also, set a Significance Level.

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

One Population Proportion GUI.

Figure 10.6: One Population Proportion Inference dialog.

10.4 Test of Hypothesis about Difference of Two Population Proportions

Users guide icon

10.4.1 Using summary statistics

Instructional video icon

Instructions for conducting a test of hypothesis for the difference of two population proportions with summary data

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

  2. In the Response/Success section, type in a Response Label, Success Label, and optionally Failure Label.

  3. In the Population section, type in a Population Label.

  4. In the Data Summary tab, enter the following for each of Populations 1 and 2: Label, Sample Size, and # of Successes. The proportion of successes auto-fills.

  5. Click the Test of Hypothesis tab. Specify your Alternative Hypothesis for the difference of proportions \(p_1 - p_2\), type in a Significance Level, and in the Methods section, select one or more of the methods Large Sample z, Permutation Test, or Fisher Exact Test.

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

Two Population Proportion GUI.

Figure 10.7: Two Population Proportion Inference dialog.

10.4.2 Using raw data

Instructions for conducting a test of hypothesis for the difference of two population proportions 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 Proportion Inference —> Two Populations. The Two Population Proportion Inference dialog will open (see Figure 10.8).

  2. Select a Dataset.

  3. In the Response/Success section, select a Response variable, and the Success level.

  4. In the Population section, select your Population variable. If data are in tabular form so that the number of observations is given in a frequency variable, then select the variable containing the frequencies from the Frequency dropdown.

  5. In the Data Summary tab, use the Level dropdowns to select the levels that indicate Population 1 and Population 2. In our example, ‘Domestic’ and ‘Import’ are selected as Population 1 and Population 2, respectively. By clicking on the refresh buttons, the summary statistics for each population will show.

  6. Click the Test of Hypothesis tab. Specify your Alternative Hypothesis for the difference of proportions \(p_1 - p_2\), type in a Significance Level, and in the Methods section, select one or more of the methods Large Sample z, Permutation Test, or Fisher Exact Test.

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

Two population proportion inference dialog

Figure 10.8: Two Population Proportion Inference dialog.