Table of Contents

1. Week 1 Lab

1.1. Starsign

Does your star sign have an effect on whether you believe astrology is scientific??

1.2. Measures of association

We have discussed the following measures of association, defined for 2*2 tables:

  • Difference in proportions
  • Relative rate or ratio of proportions
  • Odds ratio

Calculate each of these measures for the following table:

  No Yes Total
Type 1 380 120 500
Type 2 420 80 500
Total 800 200 1000

1.2.1. With a spreadsheet…

This spreadsheet will allow you to explore these measures a bit more. You can change the numbers in the "Type 1/Outcome Yes" and "Total/Outcome Yes" cells and the three measures are calculated for you. Use it to check what you have calculated by hand.

For "Total/Outcome Yes" values of 100, 200, 400, 800 and 900, do the following:

  • Find what values of "Type 1/Yes" give you a difference in

proportions of 0.2 for each of these totals

  • Find what values of "Type 1/Yes" give you a relative rate of 2.0

(or as close as possible) for each total

  • Find what values of "Type 1/Yes" give you odds ratio of 2.0

(or as close as possible) for each total

Keep a note of your numbers and compare their patterns. What do you notice?

1.3. Adding capabilities to Stata

Lots of people write additional procedures for Stata, and many of these are easily available. See help net and help ssc for an overview. We are going to use one such add-on, TAB_CHI, today. Do net search tab_chi first, just to see how to search. One place it is found is the Stata web site, and another is the Repec economics article archive. Either of the two following commands should install it:

net install tab_chi


ssc install tab_chi

The former looks on the Stata website, the latter on the Statistical Software Components archive.

Once it is installed, load the NLSW88 data and try the following:

sysuse nlsw88, clear

tabchi occupation union
tabchi occupation union, noe noo adj

Author: Brendan Halpin

Created: 2024-01-26 Fri 14:57