1 experimental design epp 245/298 statistical analysis of laboratory data

51
1 Experimental Design EPP 245/298 Statistical Analysis of Laboratory Data

Upload: blaze-ray

Post on 13-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

1

Experimental Design

EPP 245/298

Statistical Analysis of

Laboratory Data

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

2

Basic Principles of Experimental Investigation

• Sequential Experimentation• Comparison• Manipulation• Randomization• Blocking• Simultaneous variation of factors• Main effects and interactions• Sources of variability• Issues with two-color arrays

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

3

Sequential Experimentation

• No single experiment is definitive

• Each experimental result suggests other experiments

• Scientific investigation is iterative.

• “No experiment can do everything; every experiment should do something,” George Box.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

4

Plan Experiment

Perform Experiment

Analyze Data from

Experiment

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

5

Comparison

• Usually absolute data are meaningless, only comparative data are meaningful

• The level of mRNA in a sample of liver cells is not meaningful

• The comparison of the mRNA levels in samples from normal and diseased liver cells is meaningful

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

6

Internal vs. External Comparison

• Comparison of an experimental results with historical results is likely to mislead

• Many factors that can influence results other than the intended treatment

• Best to include controls or other comparisons in each experiment

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

7

Manipulation

• Different experimental conditions need to be imposed by the experimenters, not just observed, if at all possible

• The rate of complications in cardiac artery bypass graft surgery may depend on many factors which are not controlled and may be hard to measure

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

8

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

9

Randomization

• Randomization limits the difference between groups that are due to irrelevant factors

• Such differences will still exist, but can be quantified by analyzing the randomization

• This is a method of controlling for unknown confounding factors

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

10

• Suppose that 50% of a patient population is female

• A sample of 100 patients will not generally have exactly 50% females

• Numbers of females between 40 and 60 would not be surprising

• In two groups of 100, the disparity between the number of females in the two groups can be as big as 20% simply by chance

• This also holds for factors we don’t know about

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

11

• Randomization does not exactly balance against any specific factor

• To do that one should employ blocking

• Instead it provides a way of quantifying possible imbalance even of unknown factors

• Randomization even provides an automatic method of analysis that depends on the design and randomization technique.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

12

The Farmer from Whidbey Island

• Visited the University of Washington with a Whalebone water douser

• 10 Dixie cups, 5 with water, 5 empty, covered with plywood

• If he gets all 10 right, is chance a reasonable explanation?

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

13

• The randomness is produced by the process of randomly choosing which 5 of the 10 are to contain water

• There are no other assumptions

10252

5

1.004

252

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

14

• If the randomization had been to flip a coin for each of the 10 cups, then the probability of getting all 10 right by chance is different

• There are 210 = 1024 ways for the randomization to come out, only one of which is right, so the chance is 1/1024 = .001

• The method of randomization matters

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

15

Randomization Inference

• 20 tomato plants are divided 10 groups of 2 placed next to each other in the greenhouse

• In each group of 2, one is chosen to receive fertilizer A and one to receive fertilizer B

• The yield of each plant is measured

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

16

1 2 3 4 5 6 7 8 9 10

A 132 82 109 143 107 66 95 108 88 133

B 140 88 112 142 118 64 98 113 93 136

diff 8 6 3 -1 11 -2 3 5 5 3

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

17

• Average difference is 4.1

• Could this have happened by chance?

• Is it statistically significant?

• If A and B do not differ in their effects (null hypothesis is true), then the plants’ yields would have been the same either whether A or B is applied

• The difference would be the negative of what it was if the coin flip had come out the other way

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

18

• In pair 1, the yields were 132 and 140.

• The difference was 8, but it could have been -8

• With 10 coin flips, there are 210 = 1024 possible outcomes of + or – on the difference

• These outcomes are possible outcomes from our action of randomization, and carry no assumptions

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

19

• Of the 1024 possible outcomes that are all equally likely under the null hypothesis, only 3 had greater values of the average difference, and only four (including the one observed) had the same value of the average difference

• The likelihood of this happening by chance is [3+4/2]/1024 = .005

• This does not depend on any assumptions other than that the randomization was correctly done

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

20

1 2 3 4 5 6 7 8 9 10

A 132 82 109 143 107 66 95 108 88 133

B 140 88 112 142 118 64 98 113 93 136

diff 8 6 3 -1 11 -2 3 5 5 3

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

21

> tomato <- edit(data.frame())

> tomato A B1 132 1402 82 883 109 1124 143 1425 107 1186 66 647 95 988 108 1139 88 9310 133 136

> tomato[,2]-tomato[,1] [1] 8 6 3 -1 11 -2 3 5 5 3

> mean(tomato[,2]-tomato[,1])[1] 4.1

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

22

pmtest <- function(){ dvec <- tomato[,2] - tomato[,1] actual <- sum(dvec) nbigger <- 0 nsame <- 0 for (i in 1:10000) { svec <- rbinom(10,1,.5)*2-1 tmp <- sum(svec*dvec) if(tmp > actual) nbigger <- nbigger+1 if(tmp == actual) nsame <- nsame+1 } pvalue <- (nbigger+nsame/2)/10000 return(pvalue)}

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

23

> rbinom(10,1,.5)*2 - 1 [1] -1 1 -1 -1 -1 -1 -1 -1 -1 -1

> pmtest()[1] 0.0057> pmtest()[1] 0.00455> pmtest()[1] 0.0043

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

24

9

4.1

3.872

4.1 4.13.35

1.2243.872 / 10.0043 by t-test

.0049 by true randomization distribution

same range for simulation randomization distributions

The t-test can be thought of as an approximatio

d

d

s

t

p

p

n

to the randomization distribution.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

25

Randomization and in practice

• Whenever there is a choice, it should be made using a formal randomization procedure, such as Excel’s rand() function.

• This protects against unexpected sources of variability such as day, time of day, operator, reagent, etc.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

26

Pair Number First Sample Treatment

1 A or B?

2 A or B?

3 A or B?

4 A or B?

5 A or B?

6 A or B?

7 A or B?

8 A or B?

9 A or B?

10 A or B?

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

27

Pair Num

First Sample Treatment

random number

1 A or B? 0.871413

2 A or B? 0.786036

3 A or B? 0.889785

4 A or B? 0.081120

5 A or B? 0.297614

6 A or B? 0.540483

7 A or B? 0.824491

8 A or B? 0.624133

9 A or B? 0.913187

10 A or B? 0.001599

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

28

• =rand() in first cell

• Copy down the column

• Highlight entire column

• ^c (Edit/Copy)

• Edit/Paste Special/Values

• This fixes the random numbers so they do not recompute each time

• =IF(C3<0.5,"A","B") goes in cell C2, then copy down the column

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

29

Plant Pair

First Plant Treatment

random number

1 B 0.871413

2 B 0.786036

3 B 0.889785

4 A 0.081120

5 A 0.297614

6 B 0.540483

7 B 0.824491

8 B 0.624133

9 B 0.913187

10 A 0.001599

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

30

• To randomize run order, insert a column of random numbers, then sort on that column

• More complex randomizations require more care, but this is quite important and worth the trouble

• Randomization can be done in Excel, R, or anything that can generate random numbers

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

31

Blocking

• If some factor may interfere with the experimental results by introducing unwanted variability, one can block on that factor

• In agricultural field trials, soil and other location effects can be important, so plots of land are subdivided to test the different treatments. This is the origin of the idea

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

32

• If we are comparing treatments, the more alike the units are to which we apply the treatment, the more sensitive the comparison.

• Within blocks, treatments should be randomized

• Paired comparisons are a simple example of randomized blocks as in the tomato plant example

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

33

Simultaneous Variation of Factors

• The simplistic idea of “science” is to hold all things constant except for one experimental factor, and then vary that one thing

• This misses interactions and can be statistically inefficient

• Multi-factor designs are often preferable

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

34

Interactions

• Sometimes (often) the effect of one variable depends on the levels of another one

• This cannot be detected by one-factor-at-a-time experiments

• These interactions are often scientifically the most important

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

35

• Experiment 1. I compare the room before and after I drop a liter of gasoline on the desk. Result: we all leave because of the odor.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

36

• Experiment 1. I compare the room before and after I drop a liter of gasoline on the desk. Result: we all leave because of the odor.

• Experiment 2. I compare the room before and after I drop a lighted match on the desk. Result: no effect other than a small scorch mark.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

37

• Experiment 1. I compare the room before and after I drop a liter of gasoline on the desk. Result: we all leave because of the odor.

• Experiment 2. I compare the room before and after I drop a lighted match on the desk. Result: no effect other than a small scorch mark.

• Experiment 3. I compare all four of ±gasoline and ±match. Result: we are all killed.

• Large Interaction effect

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

38

Statistical Efficiency

• Suppose I compare the expression of a gene in a cell culture of either keratinocytes or fibroblasts, confluent and nonconfluent, with or without a possibly stimulating hormone, with 2 cultures in each condition, requiring 16 cultures

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

39

• I can compare the cell types as an average of 8 cultures vs. 8 cultures

• I can do the same with the other two factors

• This is more efficient than 3 separate experiments with the same controls, using 48 cultures

• Can also see if cell types react differently to hormone application (interaction)

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

40

Fractional Factorial Designs

• When it is not known which of many factors may be important, fractional factorial designs can be helpful

• With 7 factors each at 2 levels, ordinarily this would require 27 = 128 experiments

• This can be done in 8 experiments instead

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

41

F1 F2 F3 F4 F5 F6 F7

1 H H H H H H H

2 H H L H L L L

3 H L H L H L L

4 H L L L L H H

5 L H H L L H L

6 L H L L H L H

7 L L H H L L H

8 L L L H H H L

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

42

F1 F2 F3 F4 F5 F6 F7

1 H H H H H H H

2 H H L H L L L

3 H L H L H L L

4 H L L L L H H

5 L H H L L H L

6 L H L L H L H

7 L L H H L L H

8 L L L H H H L

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

43

F1 F2 F3 F4 F5 F6 F7

1 H H H H H H H

2 H H L H L L L

3 H L H L H L L

4 H L L L L H H

5 L H H L L H L

6 L H L L H L H

7 L L H H L L H

8 L L L H H H L

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

44

F1 F2 F3 F4 F5 F6 F7

1 H H H H H H H

2 H H L H L L L

3 H L H L H L L

4 H L L L L H H

5 L H H L L H L

6 L H L L H L H

7 L L H H L L H

8 L L L H H H L

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

45

Main Effects and Interactions

• Factors Cell Type (C), State (S), Hormone (H)

• Response is expression of a gene

• The main effect C of cell type is the difference in average gene expression level between cell types

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

46

• For the interaction between cell type and state, compute the difference in average gene expression between cell types separately for confluent and nonconfluent cultures. The difference of these differences is the interaction.

• The three-way interaction CSH is the difference in the two way interactions with and without the hormone stimulant.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

47

Sources of Variability in Laboratory Analysis

• Intentional sources of variability are treatments and blocks

• There are many other sources of variability• Biological variability between organisms or

within an organism• Technical variability of procedures like

RNA extraction, labeling, hybridization, chips, etc.

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

48

Replication

• Almost always, biological variability is larger than technical variability, so most replicates should be biologically different, not just replicate analyses of the same samples (technical replicates)

• However, this can depend on the cost of the experiment vs. the cost of the sample

• 2D gels are so variable replication is required

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

49

Quality Control

• It is usually a good idea to identify factors that contribute to unwanted variability

• A study can be done in a given lab that examines the effects of day, time of day, operator, reagents, etc.

• This is almost always useful in starting with a new technology or in a new lab

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

50

Possible QC Design

• Possible factors: day, time of day, operator, reagent batch

• At two levels each, this is 16 experiments to be done over two days, with 4 each in morning and afternoon, with two operators and two reagent batches

• Analysis determines contributions to overall variability from each factor

October 6, 2004 EPP 245 Statistical Analysis of Laboratory Data

51

References

• Statistics for Experimenters, Box, Hunter, and Hunter, John Wiley