HLTH2110 Clinical Epidemiology and Biostatistics for Health Sciences - Practical Exercises

Assistance on Hypothesis Testing for a Population Proportion

Introduction

Please use the answer sheet to submit your solution

The topics to be covered in this session are:

  • z test of proportion Ho: p = p≠, use theses symbols for Question 1
  • χ2 test of independence Ho; There is not association between the variables
  • odds
  1. Hypothesis Testing for a Population Proportion

Required datafiles:   Pulse.xls, skiing.xls

Open the Pulse data file in Minitab. You will use the variable:

Column Name Description
C3 Ran 2 = did not run, 1 = ran on the spot

A coin was tossed to determine which subjects in the study would run on the spot. If the coin was fair, you would expect that the number of subjects who ran on the spot would be the same as the number of subjects who didn’t run.

We shall test to determine whether the coin produces heads 50% of the time or equivalently that the proportion of 1s in column C is 0.50. Why is the value of 0.5 chosen?

What is the null hypothesis?

Check the assumptions. Are they satisfied?

Select Stat→Basic Statistics→1 sample Proportion

We’ll write customized paper for you.
Get Upto 30% OFF on your Order!

Select Ran as the sample and 0.5 for the hypothesis test, as shown in the dialog box below.

Write a conclusion including a p-value, the estimated proportion that the coin will show heads with a 95% confidence interval.

Given the confidence interval, is the p value expected? Explain.

  1. Test of Independence

We shall look at the c2 test, which is a test of association between two categorical variables. Consider the following example:

A sporty statistician, of doubtful snow-skiing ability (a beginner), reassures her family about the good chances of her returning from a skiing weekend injury-free. She tells them that "the chances of being injured are no different whether you are a beginner, an intermediate or an advanced skier". She decides to test this proposition by obtaining data on the number of injuries on a particular day in the snowfields.

Table 1

You do not need to enter the data in Excel.

We shall use Minitab to perform a c2 test of independence on these data to determine whether the statistician's reassurances to her family were justified.

Before performing the chi-squared test, let's look at the data and get some feel for the results we might expect. Firstly, calculate and compare the percentages (1dp) of injured skiers in each group using Table 1:

We would naturally expect some variation between groups by chance, even if the factors were independent.

We can now perform a statistical analysis. There is more than one way to perform a c2 test of independence in Excel, depending on the form of the data. The first method is used when the

data are given as frequencies, as in Table 1. We shall rearrange the table so that every possible outcome is considered, as in Table 2.

Table 2

In Excel, the data need to be stored in three columns as displayed below. The data are contained in the file skiing.xls. Open the Excel file in Minitab.

Instructions:   Performing a test of independence (frequency data)

  1. In Minitab - Select Stat→Tables→Cross Tabulation and Chi-square
  2. Fill in the dialog box as shown:

  1. Click on Chi-square and fill in the dialogbox:

  1. Click on OK in both dialogs.

The output will consist of a table giving the observed and expected cell counts. First we should check that the assumption that expected cell counts are greater than 5 holds.

Below this are the two test statistics. Only consider the Pearson Chi-Square.

 

3. Test of Independence and Odds Ratio

Now consider a test of independence for two categorical variables where the data are presented as individual values. Suppose we wish to test for an association between smoking status and sex.

  • Open xls in Minitab. The variables of interest are sex (1=male,2=female) and smoking (1=smokes regularly,2=does not smoke).

Write down the null hypothesis (Ho).

Since both variables are binary, you could also look at an odds ratio for the association between smoking status and sex, and obtain a confidence interval for the population odds ratio.

Instructions:   Test of independence for case-by-case data

  1. Select Stat→Tables→Cross Tabulation and Chi-square
  2. Fill in the dialog box as shown:

  1. Click on Chi-square and fill in the dialog box as for the previous
  2. Click on OK for both Remember to use only Pearon.

We can obtain the odds ratio using Stat→Regression→Binary Logistic Regression→Fit Binary Logistic Model

Enter Smokes as the Response and Sex as the Categorical Predictors, as in the following dialog. Note that you will need to set the Response Event to 2, this is that the event is when someone smokes.

This will produce a lot of output. We are interested in the section “Odds Ratios for Categorical Predictors”. From this obtain the odds ratio and 95% CI for Sex.

Now repeat the c 2 test (page 4) to see if there is an association between smoking (response) and level of activity (determinant), these are new variables.

How many cells are there with expected counts les5s than 5?

Since some of the expected counts are less than 5 it will be necessary to combine some of the activity levels. Activity levels (slight) and (moderate) will be re-coded as and activity level (a lot) will be re-coded as 2You should provide new labels for this recoded variable.

InstructionsRe-coding a column in Excel

  1. Click on cell I2 and type in the following formula: =if(H2<=2,1,2) This will code the new activity variable as if the original activity level was less than or equal to (ie. or 2) and will code the new activity variable to otherwise.
  1. Press Enter to get out of the
  2. Copy this formula into all the cells in column to create the new activity
  3. Click on cell I1 and type in a name for your new variable ReCodeACT.

Our Academic Assistance: service is all about doing research and being good at it. The more research one will do, the better the paper will turn out.

Expert's Answer

Your future, our responsibilty submit your task on time.

Order Now

Need Urgent Academic Assistance?

Get Professional Help at Low Prices!

*
*
*


*

TOP
Order Notification

[variable_1] from [variable_2] has just ordered [variable_3] Assignment [amount] minutes ago.