Name Laboratory #10 The Generalized Linear Model

advertisement

Laboratory #10

Name ________________________

The Generalized Linear Model - Logistic Regression

The purpose of this lab is to develop the capacity to execute the analysis of binomial data in a model based format. With a model-based approach (the Generalized Linear Model) all of the structural models you have learned (regression, single factor ANOVA, multiple regression, multiple factor ANOVA, ANCOVA) can be applied to binomial data. In this lab you will calculate proportions, odds, odds ratios from observed data. Then calculate the expected (model based) odds, odds ratios, and proportions for comparison to observed values.

Once you have completed the lab write-up, you should have

-ability to relate proportions to odds, and to relate odds to odds ratios

- ability to place binomial data in a structure suitable for model based analysis

- ability to use a statistical package to execute any model you write

- ability to interpret results of analysis of binomial data within the framework of the generalized linear model

Here is data for this lab.

N Ntmr Dose

18 0 0

22 2 1

22 1 5

21 4 15

25 20 50

28 28 100

N = number of experimental animals fed aflatoxin B_1, a suspected carcinogen.

Ntmr = number developing liver tumours

Dose = amount fed to animals (ppb)

Data from D.W. Gaylor (1987) Linear non-parametric upper limits for low dose extrapolation.

American Statistical Association: Proceedings of the Biopharmaceutical Section 63-66.

____________________________________________________________________________

Most of the calculations in this lab will be done in a spreadsheet so that you can understand the flow of computations. A statistical package will be used to estimate the parameters of logistic regression; these estimates will be used to calculate expected odds, odds ratios, and proportions within a spreadsheet.

Begin by pasting the data shown above into a spread sheet, and labeling it as below.

Then using the numbers pasted into the spreadsheet (shown in boldface type), calculate proportions and odds using spreadsheet formulas, at a dose of 1 ppb.

Next, past the formula for Odds at 1 ppb into the cell for Odds at 5 ppb. Your value should match that in Table 10.1. If not, check your work.

Next, compute the odds ratio. The odds ratio is taken relative to a reference value. In the example below the reference value is the odds at a dose of 1 ppb (because the observed odds at a dose of 0 ppb cannot be calculated). The example computation below shows the increase in odds of a tumor from a dose of 1 to 15 ppb (OR = 0.235 / 0.1 = 2.353) .

In words, the odds of developing a tumor are 2.35 times higher at a dose of 15 ppb than at a dose of 1 ppb.

Now paste the formula for the odds ratio (at 15 ppb) into the cell for 5 ppb. Your value should match that in Table 10.1. If not, check your work.

Once you have checked your work, paste the formula for OR (at 15 ppb) into the cell for 50 ppb.

Table 10.1

Dose (ppb) Cases

Cases w/ tumours

Proportion w/tumours Odds Odds Ratio

0 18

N

1 22

5 22

15 21

50 25

100 28

Ntmr p = Ntmr/N p/(1-p)

0 0

2 0.091 0.1

0.045 0.047 1

4

20

28

0.190

0.800

1

0.235

4

0.476

2.35

Next we use logistic regression to calculate the expected (fitted) value of the odds and odds ratios. To do this, bring the data from Gaylor into a statistical package. For packages with a graphics interface (Minitab, SPlus, etc ), this can be done by pasting the Gaylor data (3 columns) into the package spreadsheet. Then carry out logistic regression within the spreadsheet to obtain the parameter estimates. Lectures 18.1 and 18.2 provide example command lines for R, Minitab, and SAS.

Here are the parameter estimates from logistic regression via SPlus. Other packages and routines will produce slightly different estimates.

  dose

-3.037 0.091

Next we use the parameter estimates to calculate the expected (fitted) values of the odds and odds ratios. Complete the spreadsheet below, using spreadsheet formulas. Set up the sheet so that the entire sheet is computed from the dose and the two parameter estimates shown in bold face type.

Table 10.2

-3.07

Dose (ppb) 

0

-3.07

1

-3.07

5

-3.07

15

-3.07

50

-3.07

100

-3.07

0.091

E(Odds) E(Odds Ratio)

 dose*Dose

+

 dose exp(

+

 dose)

0.000 -3.07 0.046

0.091 -2.98 0.051

1.10

0.455

1.365

4.550

9.100

-2.62

-1.71

1.48

6.03

0.073

0.182

4.39

415.7

1.58

After setting up the spreadsheet, calculate the expected Odds ratio E(OR) at 1 ppb relative to the

Odds at a dose of 0 ppb. Then copy the formula used to calculate the expected OR at 1 ppb into the other cells, to calculate the missing values of E(OR). The value at 5 ppb is shown so you can check your work.

The expected odds ratio can be calculated directly from the change in dose, as below.

Table 10.3

1

1

0.091

Dose (ppb) Δdose (

 dose Δdose ) exp(

 dose Δdose ) E(Odds)/(1+E(Odds))

0

0.044

0.09

E(OR) =

1.095

E(p) =

0.048

5

5 0.46 1.439

15

15 1.37 2.484

50

50 4.55 24.17

100

100 9.10 94.63

Next we compute the expected values of the proportion of rats with tumors, given the expected values of the odds. The formula is E(p) = E(Odds) / (1 + E(Odds). You will need to use the expected odds E(OR) in Table 10.2 to do the calculations.

Once you have created the spreadsheet, increase values for Ntmr from 0 to 1 at a dose of 0 ppb.

Then recompute the parameter estimates, using the software of your choice.

Paste in the parameter estimates to obtain the expected odds for the data you created.

Before leaving the lab, make sure you know how to copy a spreadsheet and place it into a printable document.

____________________________________________________________________

Write-up for this lab.

1. Using the spread sheet that you set up, calculate the expected odds, expected odds ratio, and expected proportion at 40 ppb, using parameter estimates from the unaltered data.

2. Present Tables 10.1, 10.2, and 10.3 for the altered data.

Your spreadsheets should be as clearly labeled as the example above.

3. Given the change to the number of tumors (Ntmr = 1) at Dose = 0, what happens to the expected proportions at Dose = 0 and 1?

Given the change in expected proportions what happens to the odds?

Comment on the direction of change in the odds ratio for the altered data (Ntmr = 1 at Dose = 0).

Was it higher or lower than the odds ratio for the increase in dose from 0 to 1 ppb?

_________________________________________________________________

Download