Spider Mites Example, Binary Versus Continuous Outcomes | STAT 371, Study notes of Statistics

Material Type: Notes; Class: Introductory Applied Statistics for the Life Sciences; Subject: STATISTICS; University: University of Wisconsin - Madison; Term: Spring 2006;

Typology: Study notes

Pre 2010

Uploaded on 09/02/2009

koofers-user-msz
koofers-user-msz 🇺🇸

10 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Spider mites example
Dose of DDT No. survived No. dead
0.0 18 7
0.5 19 6
1.0 12 13
1.5 5 20
2.0 6 19
2.5 2 23
3.0 1 24
1
Binary vs. continuous outcomes
Continuous: ANOVA Regression
Binary: k×2 table ?
Goals:
Relationship between dose and Pr(dead).
Dose at which Pr(dead) = 1/2.
2
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Spider Mites Example, Binary Versus Continuous Outcomes | STAT 371 and more Study notes Statistics in PDF only on Docsity!

Spider mites example

Dose of DDT No. survived No. dead 0.0 18 7 0.5 19 6 1.0 12 13 1.5 5 20 2.0 6 19 2.5 2 23 3.0 1 24

1

Binary vs. continuous outcomes

Continuous: ANOVA ←→ Regression

Binary: k × 2 table ←→?

Goals:

  • Relationship between dose and Pr(dead).
  • Dose at which Pr(dead) = 1/2.

A plot of the data

l l

l

l l

l l

0.0 0.5 1.0 1.5 2.0 2.5 3.

dose

proportion dead

3

Linear regression

Model:

y = β 0 + β 1 x 1 + β 2 x 2 + · · · + βkxk + ,  ∼ iid Normal( 0 , σ^2 )

This implies:

E(y | x 1 ,... , xk) = β 0 + β 1 xk + · · · + βkxk

βi = increase in mean of Y associated with a unit change in xi

Logistic regression

ln

( (^) p d 1 − pd

= β 0 + β 1 d

Try least squares, regressing ln

( (^) pˆ d 1 − pˆd

on the dose, d?

Problems:

  • What if pˆd = 0 or 1?
  • SD(pˆd) is not constant with d.

7

Maximum likelihood

Assume yd ∼ Binomial(nd, pd), yd independent

with logit(pd) = ln( (^1) −pdpd ) = β 0 + β 1 d

Note: pd = e

β 0 +β 1 d 1 + eβ^0 +β^1 d

Likelihood:

L(β 0 , β 1 | y) =

d

py dd ( 1 − pd)(nd−yd)

Logistic regression in R

Logistic regression is a special case of a “generalized linear model”.

Function in R: glm()

glm.out <- glm(n.dead/n ~ dose, weights=n, data=spiders, family=binomial(link=logit)) summary(glm.out)$coef Est SE t-val P-val (Intercept) -1.33 0.33 -4.06 <0. dose 1.44 0.23 6.29 <0.

9

Fitted curve

l l

l

l l

l l

0.0 0.5 1.0 1.5 2.0 2.5 3.

dose

proportion dead

Estimating LD50 in R

glm.out <- glm(n.dead/n ~ dose, weights=n, data=spiders, family=binomial(link=logit)) glm.sum <- summary(glm.out)

co <- glm.out$coef ld50 <- -co[1]/co[2] se.co <- glm.sum$coef[,2] cov.co <- glm.sum$cov.scaled[1,2] se.ld50 <- abs(ld50) * sqrt( (se.co[1]/co[1])^2 + (se.co[2]/co[2])^2 - 2cov.co/(co[1]co[2]) )

ld

se.ld

ld50 + c(-1,1) * qnorm(0.975) * se.ld 0.65 1. 13

LD

l l

l

l l

l l

0.0 0.5 1.0 1.5 2.0 2.5 3.

dose

proportion dead

Another example

Tobacco budworm, Heliothis virescens

Batches of 20 male and 20 female worms were given a 3-day dose of pyrethroid trans-cypermethrin The no. dead or “knocked down” in each batch was noted.

Dose Sex 1 2 4 8 16 32 Male 1 4 9 13 18 20 Female 0 2 6 10 12 16

15

A plot of the data

l

l

l

l

l

l

l

l

l

l

l

l

0 5 10 15 20 25 30

dose

proportion dead

l l^ MaleFemale

Fitted curves

l

l

l

l

l

l

l

l

l

l

l

l

0 5 10 15 20 25 30

dose

proportion dead

Common interceptSeparate intercepts Same curve

19

Plot using log 2 dose

l

l

l

l

l

l

l

l

l

l

l

l

0 1 2 3 4 5

log 2 dose

proportion dead

l l^ MaleFemale

Use log 2 of the dose

Assume no sex difference

glm.out <- glm(n.dead/n ~ dose, weights=n, data=worms, family=binomial(link=logit)) summary(glm.out)$coef Est SE t-val P-val (Intercept) -2.77 0.37 -7.6 <0. dose 1.01 0.12 8.1 <0.

Assume sexes completely different

glm.outB <- glm(n.dead/n ~ sex*dose, weights=n, data=worms, family=binomial(link=logit)) summary(glm.outB)$coef Est SE t-val P-val (Intercept) -2.99 0.55 -5.4 <0. sexmale 0.17 0.78 -0.2 0. dose 0.91 0.17 5.4 <0.

sexmale:dose 0.35 0.27 1.3 0. 21

Use log 2 of the dose (continued)

Different slopes but common “intercept”

glm.outC <- glm(n.dead/n ~ dose + sex:dose, weights=n, data=worms, family=binomial(link=logit)) summary(glm.out)$coef Est SE t-val P-val (Intercept) -2.91 0.39 -7.5 <0. dose 0.88 0.13 6.9 <0. dose:sexmale 0.41 0.12 3.3 0.