Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 1 Data analysis project Proposal must be approved.

Similar presentations


Presentation on theme: "University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 1 Data analysis project Proposal must be approved."— Presentation transcript:

1 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 1 Data analysis project Proposal must be approved Strong suggestion to submit a draft before Dec. 2 nd Description of question, H, prediction, protocol, data (1-2 pages) Show the data (1-5 graphs) Report analyses results, justify choices, hypotheses tested (1-5 pages) statistical, and biological interpretation (1-2 pages) Total: less than 10 pages.

2 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 2 Grading scheme Question, protocol, data, data copy (20%) Data examination, analysis, stat interpretation (60%) Biological conclusion (10%) Style (10%)

3 University of Ottawa - Bio 4158 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 3 Simple linear regression What regression analysis does The simple regression model Hypothesis testing in regression Residual analysis Inverse prediction, replicated regression and weighted regression Regression caveats Power considerations in simple linear regression

4 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 4 What regression does Fits a straight line through a cloud of data. Tests and quantifies the effect of an independent variable X on a dependent variable Y. Intensity of the effect is given by the slope (b) of the regression. The importance of the effect is given by the coefficient of determination (r 2 ). X Y XX YY b =  Y  X

5 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 5 Regression and correlation coefficients The slope b is estimated as: The correlation r is: So, b = r if X and Y have the same variance… and if b = 0, r = 0 and vice versa.

6 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 6 How it does it by the method of least squares, which involves minimizing the sum of squared deviations between the observations and the regression line, i.e. minimizing the residuals Squared deviation of an observation given by: X Y ii Residual:

7 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 7 Regression or correlation? Correlation: degree of association between two variables X and Y; no causal relationship assumed! Regression: to predict the value of the dependent variable if the independent variable were changed; causal relationship assumed!

8 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 8 When do we use regression? Don’t use it to determine the strength of association between to variables. Do use it if you want to predict the value of Y given X. X Y Regression X1X1 X2X2 Correlation

9 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 9 The simple regression model The regression model is: So, all simple regression models are described by 2 parameters, the intercept (  ) and slope (b). b =  Y  X (slope) X XX YY  (intercept) ii XiXi YiYi Observed Expected

10 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 10 Assumptions Residuals are independent and normally distributed. The variance of the residuals is equal for all X (homoscedasticity). The relationship between Y and X is linear. There is no measurement error on X (Model I regression).

11 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 11 Measurement error Assumption of no error on X can be examined beforehand, and is almost invariably violated. Only of concern when measurement error is large relative to magnitude of X (say, > 10%). If assumption is invalid, then Model II regression is required.

12 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 12 Residual analysis I: independence Plot residuals against estimates, look for patterns. Estimate Residual

13 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 13 Residual analysis II: Normality Plot residuals against estimates; look for patterns. Do normal probability plot. Check with Lilliefors test. NEDs Residual Normal Non-normal Residual Estimate

14 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 14 Residual analysis III: Homoscedasticity Plot residuals against estimates; look for patterns. Check with Levene’s test by grouping Y’s into several classes. Estimate Residual Group 1 Group 2 Group 3 Residual Estimate

15 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 15 Residual analysis IV: Linearity Plot residuals against estimates; look for patterns. Residual X Y Estimate

16 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 16 Robustness of regression with respect to violation of assumptions

17 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 17 What to do when assumptions aren’t met Try transforming the data, but remember: (1) for some data, no transformation will work; (2) finding an appropriate transformation may not be easy. Use non-linear regression.

18 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 18 Transformations in regression

19 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 19 oCoC Transformations in regression 10 20 50 100 150 Chirps/min oCoC 10 20 40 80 120 160 Chirps/min (log scale) Chirp rate as a function of temperature in males of the cricket Oecanthus fultoni. Chirp rate as a function of temperature in males of the cricket Oecanthus fultoni.

20 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 20 Transformations in regression 70125102050 Relative brightness (times) in log scale 0 1 2 3 4 5 6 7 Millivolts 010203040506070 Relative brightness (times) 0 1 2 3 4 5 6 7 Millivolts Electrical resistance as a function of illumination in cephalopod eyes.

21 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 21 Age and size of, guess what?

22 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 22

23 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 23 *** Linear Model *** Call: lm(formula = log10(FKLNGTH) ~ log10(AGE), data = Reg1dat, na.action = na.exclude) Residuals: Min 1Q Median 3Q Max -0.08432 -0.01578 0.0006757 0.02111 0.0701 Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 1.1991 0.0256 46.8737 0.0000 log10(AGE) 0.3343 0.0204 16.4124 0.0000 Residual standard error: 0.02832 on 73 degrees of freedom Multiple R-Squared: 0.7868 F-statistic: 269.4 on 1 and 73 degrees of freedom, the p-value is 0 5 observations deleted due to missing values

24 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 24 Hypothesis testing I: partitioning the total sums of squares Total SSModel (Explained) SSUnexplained (Error) SS = + Y

25 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 25 Hypothesis testing I: partitioning the total sums of squares So, MS regression = s 2 Y and MS error = 0 if observed = expected. Calculate F = MS R /MS e and compare with F distribution with 1 and N - 2 df. H 0 : F = 0

26 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 26 Standard error of the slope The standard error s b and 100(1-  ) CIs of the slope are: So, for fixed N, can decrease s b by expanding range of X values sampled. Y X s b smaller Y s b larger

27 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 27 Standard error of the intercept The standard error s  of the intercept  is: So, for fixed N, we can decrease s  by expanding range of X values sampled. X s  smaller Y  Y s  larger 

28 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 28 Hypothesis testing II: testing model parameters Test each hypothesis by a t-test: Note: these are 2-tailed hypotheses! X Y  H 02 : b = 0 X Y  Y  Y H 01 :  = 0 Y = 0 Observed Expected

29 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 29 Hypothesis testing III: one-tailed hypotheses Biological theory predicts that Y should increase with X. So, H 0 : b  0 (one-tailed) Calculate: Reject if t b > 0 and p (one- tailed) <  YY H 0 accepted H 0 rejected Y X Y

30 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 30 Confidence intervals in regression 100 (1-  ) CI for estimated values 100 (1-  ) CI for observations

31 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 31 Confidence intervals in regression CI for observations is larger than CI for estimated values. CIs for both estimated values and observations increase with increasing distance between X value and mean of sample. X Y Observations Y Estimates

32 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 32 Outliers points that appear to lie well off the fitted line Issue 1: are “apparent” outliers really outliers? Issue 2: do they significantly affect the statistical conclusions? X Y Outlier?

33 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 33 Outlier analysis I: Studentized residuals Plot Studentized residuals against estimated values. “Large” residuals are those with value > 3.0. Such cases make large contributions to residual mean square of the regression.

34 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 34 Outlier analysis II: Leverage Leverage measures the potential influence of the case on the regression line. Determined by X value only, so that points far from the mean have higher leverage. “Large” = anything greater than 4/N. Small leverage Large leverage X Y

35 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 35 Outlier analysis III: Cook’s distance Cook’s distance: measures both leverage and contribution to residual mean square, i.e. actual influence of a point. “Large” = anything greater than 1. Smaller Cook’s Larger Cook’s X Y

36 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 36 Resolving outlier problems Do they have a significant effect on regression results? To determine, delete them, rerun analyses and compare results. Are slope and intercept estimates significantly affected, i.e. still lie within 95% CI’s of original estimates? Outliers in Outliers out Y No significant effect X Y Significant effect

37 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 37 The effects of outlier deletion Reduces sample size (N), thereby reducing power. Decreases MS e, so s b decreases, and power increases. If N is small, the former effect will probably outweigh the latter unless outliers are very aberrant. Power (1 -  )  N smaller N larger s b larger s b smaller s b fixed N fixed 0 0 1

38 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 38 Inverse prediction Regression of Y on X, but want to predict X, given Y. Regression of X on Y not possible due to error in Y. e.g. calibration curves: want to predict concentration from reading, based on regression of reading on known solute concentrations. Reading Concentration Reading Concentration Error in “X”

39 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 39 Inverse prediction Regress Y on X. Generate predicted value of X given Y. Calculate 95% confidence limits for “X” estimate based on 95% confidence limits for “Y” estimate from standard regression. Y Predicted “X” Lower 95% limit Upper 95% limit

40 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 40 Regression with replication When several Y’s are measured for each X. In this case, we can test the linearity assumption directly by testing the MS due to deviations from linearity over MS within groups. Regression SS Within-group SS SS due to nonlinearity Group SS Error SS

41 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 41 Weighted regression Used when our confidence in the values of individual observations varies, e.g. different measurement error, precision. In replicated designs, variance of Y for given X may vary among X’s, as may sample size (N). So, weight by N or inverse of sample variance. X Y

42 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 42 Regression caveats I: causation A statistically significant regression of Y on X need not imply a causal relationship between the two. A non-significant linear regression need not imply the lack of a causal relationship if the causal relationship is non- linear. Z X Y X Y X Y Accept linear H 0

43 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 43 Regression caveats II: small samples Significant regressions can be obtained by chance, i.e. even when no (linear) causal relationship exists. This is especially true if sample sizes are small. So when doing multiple simple regressions, control  e. X Y True regression (H 0 accepted) Sample regression (H 0 rejected)

44 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 44 Regression caveats III: large samples When N is large, only very small regression coefficients are required to reject H 0 (power is large). So, be careful of “overinterpreting” the observed relationship if R 2 is small. True regression (H 0 rejected but R 2 small) X Y

45 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 45 Regression caveats IV: extrapolation and interpolation Be careful when (1) predictions lie outside range of sample; (2) when predictions are for values where data are sparse. X Y Estimated relation True relation X Y Predicted value True value Observations

46 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 46 The final word on extrapolation In the space of one hundred and seventy-six years the Lower Mississippi has shortened itself two hundred and forty-six miles. That is an average of a trifle over one mile and a third per year. Therefore, any calm person, who is not blind or idiotic, can see that in the Old Oölitic Silurian period, just a million years ago next November, the Lower Mississippi River was upwards of one million three hundred thousand miles long, and stuck over the Gulf of Mexico like a fishing rod. And by the same token, any person can see that seven hundred and forty-two years from now, the lower Mississippi will be only a mile and three-quarters long, and Cairo and New Orleans will have joined their streets together, and be plodding comfortably along under a single mayor and a mutual board of aldermen. Mark Twain, Life on the Mississippi

47 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 47 Power and sample size in simple linear regression Because the correlation coefficient r and the regression coefficient b are closely related, i.e. … we can transform b to r and evaluate power using r. X Y

48 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 48 Power and sample size regression If we test H 0 : b = 0 with sample size n, we can determine 1 -  by calculating the z-transformed values for the critical value of the corresponding r (at specified  ) (z  ) and the sample regression coefficient b (z r ), and the one-tailed probability of the normal deviate: X Y

49 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 49 Power and sample size in regression Once Z  (1) is determined, we can calculate the probability of obtaining a Z-value of this size or greater, i.e. . Power is then 1- . X Y Z  (1) p 

50 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 50 Power and sample size in regression: an example Changes in wing length with age in a sample of 13 birds So 1 -  = 1.00.

51 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 51 Minimal sample size in regression Given desired power 1 - , how large a sample is required to reject H 0 : b  = 0 if it is false and the true regression coefficient is at least b   To do so, first calculate regression coefficient  0 corresponding to b . X1X1 Y Reject H 0 ? Observed Expected under H 0 : b = 0 True regression (b 0 ) Y Reject H 0 ?

52 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 52 Minimal sample size in regression (cont’d) …then calculate: X1X1 Y Reject H 0 ? Observed Expected under H 0 : b = 0 True regression (b 0 ) Y Reject H 0 ?

53 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 53 Minimal sample size: an example We want to reject H 0 : b  = 0 99% of the time when b 0  > 0.2  and   (2) =.05  So  (1) =.01 and For b =.20, we have...

54 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 54 Minimal sample size (cont’d) So… …and So, a sample size of at least 8 should be used.

55 University of Ottawa - Bio 4158 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 55 CorrelationCorrelation The underlying principle of correlation analysis Measuring the strength of a correlation Assumptions Confidence intervals and hypothesis testing Comparing correlations Non-parametric correlations Power in correlation analysis

56 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 56 The underlying principle of correlation analysis Measures the extent to which two variables covary, in particular, the strength of the linear association between them. No implied causal relationship, therefore there is no distinction between dependent and independent variables. X1X1 X2X2

57 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 57 When do we use correlation? Do use it to determine the strength of association between to variables. Do not use it if you want to predict the value of X given Y, or vice versa. X1X1 X2X2 Correlation X Y Regression

58 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 58 Simple linear correlation versus simple linear regression Calculations are the same. In correlation analysis, one must sample randomly both X and Y. Correlation deals with association (importance). Regression deals with prediction (intensity).

59 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 59 Lab example: fork length and round weight of sturgeon Since the two variables are not causally related, use correlation to measure strength of association.

60 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 60 Regression: fork length and age of sturgeon The two variables are causally related. The relationship between the two provides an estimate of growth rates…...and we can use the relationship to predict the size of sturgeon of a given age.

61 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 61 Measuring the strength of a correlation Test statistic is the product-moment correlation coefficient r. X1X1 X2X2

62 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 62 Measuring the strength of a correlation r always lies between -1 and 1. r 2 is the coefficient of determination, which measures the proportion of the variance in X 1 (or X 2 ) “explained” by variation in X 2 or X 1. X1X1 X2X2 X2X2 X2X2 r = 0.9 r = 0.5 r = 0 r = -0.5 r = -0.9

63 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 63 Assumptions of correlation analysis I: Bivariate normality For each value of X 1, X 2 values are normally distributed, and vice versa. r = 0.8 r = 0

64 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 64 Assumptions of correlation analysis II: Homoscedasticity The variance of X 1, given X 2, is independent, and vice versa. But the variances of X 1 and X 2 need not be equal. X2X2 X1X1 X2X2 Homoscedastic Heteroscedastic

65 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 65 Assumptions of correlation analysis III: Linearity The relationship between X 1 and X 2 is linear. X2X2 Linear X1X1 X2X2 Nonlinear

66 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 66 Violation of assumptions: fork length and age of sturgeon Relationship between fork length and age appears non-linear. Variance in fork length appears to increase with age.

67 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 67 If parametric correlation assumptions aren’t met... Try transforming the data (e.g. log transform). Try a non-parametric correlation analysis.

68 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 68 Confidence intervals for correlation coefficients  confidence limit for Z- transformed correlation given by: Convert back to untransformed CI by: X2X2 Smaller CI X2X2 X1X1 X2X2 Larger CI

69 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 69 Hypothesis testing I H 0 :  = 0 Standard error of correlation coefficient given by: Calculate … and compare to t-distribution with N - 2 df. X2X2 Reject H 0 X2X2 Accept H 0 X1X1 X2X2 Observed Expected

70 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 70 Hypothesis testing II H 0 : r =  Transform r and  to Calculate … and compare Z distribution with N - 3 df. X2X2 Reject H 0 X2X2 X1X1 X2X2 Accept H 0 Observed Expected

71 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 71 Comparing 2 correlations H 0 : r 1 = r  Transform r 1 and r  to: Calculate … and compare to Z distribution. X2X2 Reject H 0 X2X2 X1X1 X2X2 Accept H 0 r1r1 r2r2

72 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 72 Comparing multiple correlations H 0 : r i = r j = r k = … based on n i, n j, n k …observations Z transform all r i s to z i s and calculate … and compare to  2 distribution with df = k -1.

73 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 73 Computing common correlations If H 0 : r i = r j = r k = … is accepted, then each r i estimates the same (population) correlation . To calculate , first calculate weighted Z-score z w : Then back-transform to get  X2X2 X1X1 X2X2 Accept H 0 r1r1 r2r2 r3r3

74 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 74 Non-parametric correlations Use when one or more assumptions are not met. Essentially a parametric correlation of the ranks. Most common statistic is Spearman rank correlation. X2X2 X1X1 Rank X 1 Rank X 2

75 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 75 Power and sample size in correlation If we test H 0 :  = 0 with sample size n, we can determine 1 -  by using the Z-transformation for critical values (for given  ) of the true correlation  (z  ) and sample correlation r (z r ). X1X1 X2X2 Z Probability 

76 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 76 Power and sample size in correlation Once Z  (1) is determined, we can calculate the probability of obtaining a Z-value of this size or greater, i.e. . Power is then 1- . X1X1 X2X2 Z Probability 

77 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 77 Power and sample size in correlation: an example Correlation of wing length and tail length of a sample of 12 birds so 1 -  = 0.98

78 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 78 Minimal sample size Given desired power 1 - , how large a sample is required to reject H 0 :  = 0 if it is false with a specified    Calculate: X2X2 Reject H 0 ? X2X2 X1X1 X2X2 Observed Expected

79 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 79 Minimal sample size: an example We want to reject H 0 :  = 0 99% of the time when |    > 0.5 and   (2)  =.05  So  (1) =.01 and for r =.50, we have... Hence So, a sample size of at least 64 should be used.

80 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 80 Power and sample size in comparing 2 correlations Power of a test for difference between two correlation coefficients is 1- , where  is one-tailed probability of: X2X2 Reject H 0 X2X2 X1X1 X2X2 Accept H 0 r1r1 r2r2

81 University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 81 An example What is power to detect a difference? From table of normal deviates, So, power = 0.22


Download ppt "University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 18/08/2015 2:25 AM 1 Data analysis project Proposal must be approved."

Similar presentations


Ads by Google