Faculty of Health Sciences Categorical covariate, Quantitative outcome Regression models Categorical covariate, Quantitative outcome Lene Theil Skovgaard April 29, 2013 PKA & LTS, Sect. 3.2, 3.2.1 ANOVA k + 1 groups, j = 0, 1,..., k Omnibus test of identity Multiple comparisons One-way Analysis of Variance Model check Transformation Home pages: http://biostat.ku.dk/~pka/regrmodels13 E-mail: ltsk@sund.ku.dk 1 / 43 2 / 43 Examples of categorical covariates Group characteristics Treatment typically randomized studies, controllable Smoking habits not controllable differences may be due to... Body stature categorized quantitative variable, e.g. normal weight (18.5 < BMI < 25) slight overweight (25 BMI < 30) obese (BMI 30) Characteristic c j of the distribution in the jth group, e.g. mean value log(odds) of some event log(hazard rate) yet to be presented Linear predictor for the outcome y i : LP i = c 0, if subject i belongs to group 0 c 1, if subject i belongs to group 1...... c k, if subject i belongs to group k 3 / 43 4 / 43
Dummy variables The linear predictor k + 1 different groups, j = 0, 1,..., k Specify k + 1 dummy variables, as indicator variables for each group seperately: Using the dummy indicators, we write the linear predictor as a linear function: LP i = c 0 I (x i = 0) + c 1 I (x i = 1) + + c k I (x i = k) 1 if subject i belongs to group j I (x i = j) = 0 otherwise j = 0, 1,, k. or, using group 0 as a reference group LP i = c 0 + (c 1 c 0 )I (x i = 1) + + (c k c 0 )I (x i = k) 5 / 43 6 / 43 Traditional parametrization Omnibus test of equality of groups Define the new parameters as a = c 0, level in reference group b j = c j c 0, j = 1,..., k, discrepancy between group j and reference group Traditional research question: Do the groups differ? Then the linear predictor may be written: LP i = a + b 1 I (x i = 1) + + b k I (x i = k), or H 0 : c 0 = c 1 = = c k (= a) H 0 : b 1 = b 2 = = b k = 0 actually as a multiple regression model 7 / 43 8 / 43
The Likelihood function Likelihood ratio test The probability (or probability density) of observing these particular data, as a function of the unknown parameters The Likelihood principle for estimation: Maximize this function, i.e. Find the values of the unknown parameters that maximize the probability of observing precisely what we actually did observe. We believe the parameters to have values that make the observed data the most plausible. Compare initial model with model under H 0 When Q is small, we reject H 0 Q = max. Likelihood under H 0 max. Likelihood under model. Often, we use 2 log Q as a test statistic, because 2 log Q χ 2 (k) 9 / 43 10 / 43 Illustration of test statistics Comparisons between groups Automatically, we get comparisons between the reference group and all others, i.e. k comparisons (b j -parameters) If the omnibus test of equality is rejected, we may want to perform all pairwise comparisons between the k + 1 groups, i.e. a total of K = k(k + 1)/2 comparisons. Q Likelihood ratio test W Walds test S Score test This may well create problems in connection to type I error (will increase dramatically) Confidence intervals (with be too narrow) 11 / 43 12 / 43
Mass significance Type I error in multiple comparisons Suppose all groups are truely identical Every pairwise comparison has a type I error rate of α (0.05), i.e. a probability of 1 α for a correct decision K such independent comparisons yield a probability of (1 α) K for getting them all correct i.e. a probability of 1 (1 α) K for getting at least one false significance, i.e. the type I error rate for the total procedure x All comparisons o Comparisons to reference group only 13 / 43 14 / 43 Correction for inflated type I error Adjusted P-values K group comparisons, K group comparisons, Increase the P-value to P K, e.g. Control the experimentwise error rate by lowering the level of significance to α K, e.g. Bonferroni : α K α K Sidak : α K = 1 (1 α) 1/K Others : may exist in specific contexts Bonferroni : Multiply by K, i.e., P K = K P may become greater than 1! Sidak : P K = 1 (1 P) K never larger than 1 Others : may exist in specific contexts Consequence: A reduction in power (increase of type II error rate) Differences become harder to detect 15 / 43 16 / 43
Confidence limits But If each single confidence interval is constructed to have an (approximate) coverage of 95%, then the simultaneous coverage rate (for all parameters) will be less than 95%, and it will be appreciably less if many intervals are involved. Adjustment: Use alternative quantiles for the construction, e.g. the (1 α K /2) quantile, where α K is the adjusted significance level (according to some rule). Pairwise tests are not independent! If two groups look alike, they both resemble a third group equally much. Therefore, Bonferroni and Sidak are conservative Significance level α K is unneccessary low We get unneccessarily low power, i.e. Differences are too hard to detect 17 / 43 18 / 43 Recommendation Quantitative outcome Design your investigation to be as simple as possible Avoid considering too many groups simultaneously, focus Write a protocol, describing your opinion, beliefs and intentions Nature of Dichotomous/Binary General categorical outcome Two levels Three or more levels Quantitative T-tests Anova Binary 2*2 tables (k+1)*2 tables Survival time log-rank test (k+1)-sample log-rank test 19 / 43 20 / 43
Example: Fatty acids absorption Scatter plot Lymphatic absorption of fatty acids was studied (Fruekilde and Høy, 2004), by feeding 40 rats with different dairy products. The rats were subdivided into five diet groups: 1. cream cheese 2. sour cream 3. cream 4. mixed butter 5. butter Do we see an effect of diet on total accumulation of fatty acids? The absorption for products 4 and 5 seem to be at a lower level than the other three diets 21 / 43 22 / 43 Summary statistics The covariate: Dairy product Product j n j Average ( m j ) SD (ŝ j ) Cream cheese 0 8 153.02 41.905 Sour cream 1 6 210.40 28.212 Cream 2 12 193.04 36.275 Mixed butter 3 6 106.38 17.200 Butter 4 8 111.13 12.034 Let x i denote the dairy product for the ith rat, defined as x i = 0, if rat i was fed with cream cheese, I 1, if rat i was fed with sour cream, II 2, if rat i was fed with cream, III 3, if rat i was fed with mixed butter, IV 4, if rat i was fed with butter, V 23 / 43 24 / 43
Model Technicalities Let y i denote the outcome (fatty acid absorption) for the ith rat We assume all the y i s to be independent, with mean values given by E(y i ) = m 0 m 1 m 2 m 3 m 4 and identical standard deviations. if x i = 0 (cream cheese) if x i = 1 (sour cream) if x i = 2 (cream) if x i = 3 (mixed butter) if x i = 4 (butter) Estimate of common standard deviation The pooled estimate of standard deviation is given by 4j=0 ŝ = (n j 1)ŝj 2 4j=0 (n j 1) = 30.817, where the denominator 4 j=0 (n j 1) = n 5 = 35 denotes the degrees of freedom in the estimation of the common standard deviation, and n denotes the total number of observations. 25 / 43 26 / 43 Traditional model formulation Hypothesis testing Linear predictor: with the parameters E(y i ) = a + b 1 I (x i = 1) + + b k I (x i = k). a = m 0, b j = m j m 0, j = 1,..., k, and with dummy variables I (x i = j) defined as indicator variables for each group (here, k = 4). Traditional research question: Do the distributions differ among the groups? More specifically, in this situation: Are the mean values equal? or Likelihood ratio test H 0 : m 0 = m 1 = = m k (= a) H 0 : b 1 = b 2 = = b k = 0. 2 log Q χ 2 (k) 27 / 43 28 / 43
Technicalities Test results for fatty acids Specifically for Normally distributed outcome, the likelihood ratio test statistic is often transformed to an F-test statistics ( ) n k 1 1 Q 2/n F = = MS B F(k, n k 1), k MS W Q 2/n The F-test is a ratio of two variances, hence the name Analysis of Variance One-way because we have only one categorical covariate Analysis of variance table Variation SS df MS Total 39 Within group 33239.12 35 949.69 Between groups 64960.46 4 16240.12 2 log Q = 43.33 χ 2 (4), P <0.0001 F = 17.10 F(4, 35), P < 0.0001 29 / 43 30 / 43 Estimation Confidence intervals Maximum likelihood method yields: â = ȳ 0 b j = ȳ j ȳ 0 the most interesting parameters E( b j ) = E(ȳ j ȳ 0 ) = m j m 0 = b j 1 SD( b j ) = SD(ȳ j ȳ 0 ) = ŝ + 1. n 0 n j For large samples, b j = ȳ j ȳ 0 will have an approximate Normal distribution. An approximate 95% confidence interval for b j is therefore b j ± 1.96 SD( b j ) = ȳ j ȳ 0 ± 1.96 SD(ȳ j ȳ 0 ), 31 / 43 32 / 43
Estimates for fatty acids Using t-quantile Product Parameter Estimate SD 95% CI Cream cheese a = m 0 153.02 10.90 (130.91, 175.14) Sour cream b 1 = m 1 m 0 57.37 16.64 (23.58, 91.16) Cream b 2 = m 2 m 0 40.01 14.07 (11.46, 68.57) Mixed butter b 3 = m 3 m 0-46.64 16.64 (-80.43, -12.86) Butter b 4 = m 4 m 0-41.90 15.41 (-73.18, -10.61) For small to moderate samples, we use instead the appropriate t-quantile, here with 35 degrees of freedom i.e. 2.030 instead of 1.96 ȳ j ȳ 0 ± 2.030 ŝ 1 n 0 + 1 n j. 33 / 43 34 / 43 Walds test Multiple comparisons The simple ratio: t = b j SD( b j ) = ȳj ȳ 0 SD(ȳ j ȳ 0 ). For large samples, this quantity will have an approximate N (0, 1) distribution, For smaller samples, we should instead use the appropriate t-distribution, here t(35). Cream vs. Butter vs. Method Cream Cheese Cream Cheese Individual comparisons Normal approx. (12.44, 67.58) ( 72.10, 11.70) t approx. (11.46, 68.57) ( 73.18, 10.61) Comparisons to reference Bonferroni/Sidak (2.97, 77.05) ( 82.47, 1.32) Dunnett (3.99, 76.03) ( 81.36, 2.44) 35 / 43 36 / 43
Multiple comparisons, cont d Model check Cream vs. Butter vs. Method Cream Cheese Cream Cheese A single comparison t approx. (11.46, 68.57) ( 73.18, 10.61) All pairwise comparisons Bonferroni/Sidak ( 2.13, 82.15) ( 88.06, 4.27) Tukey-Kramer ( 0.43, 80.45) ( 86.20, 2.40) Residuals: r i = y i ŷ i = y i m j(i) Graphics: Variance homogeneity Residuals vs. dairy product Residuals vs. predicted Normality Quantile plot of residuals Histogram of residuals 37 / 43 38 / 43 Need for transformation? Quantile plot is hammock -shaped Distribution skewed to the right Take logarithms, e.g. base 10: y i = log 10 (y i ) Hardly any changes in model fit 39 / 43 40 / 43
Product Parameter Estimate SD 95% CI Cream cheese a = m 0 2.172 0.0270 (2.117, 2.227) Sour cream b 1 = m 1 m 0 0.148 0.0413 (0.064, 0.232) Cream b 2 = m 2 m 0 0.107 0.0349 (0.036, 0.178) Mixed butter b 3 = m 3 m 0 0.150 0.0413 ( 0.233, 0.066) Butter b 4 = m 4 m 0 0.128 0.0382 ( 0.206, 0.051) 41 / 43 42 / 43 Product Estimated Ratio 95% CI Sour cream 1.41 (1.16, 1.71) Cream 1.28 (1.09, 1.51) Mixed butter 0.71 (0.58, 0.86) Butter 0.74 (0.62, 0.89) 43 / 43