mixed models in r using the lme4 package part 4 inference
play

Mixed models in R using the lme4 package Part 4: Inference based on - PowerPoint PPT Presentation

Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Mixed models in R using the lme4 package Part 4: Inference based on profiled deviance Douglas Bates University of Wisconsin - Madison and R Development Core Team


  1. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Mixed models in R using the lme4 package Part 4: Inference based on profiled deviance Douglas Bates University of Wisconsin - Madison and R Development Core Team <Douglas.Bates@R-project.org> UseR!2010, Gaithersburg, MD, USA July 20, 2010

  2. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  3. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  4. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  5. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  6. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  7. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Likelihood ratio tests and deviance • In section 2 we described the use of likelihood ratio tests (LRTs) to compare a reduced model (say, one that omits a random-effects term) to the full model. • The test statistic in an LRT is the change in the deviance, which is negative twice the log-likelihood. • We always use maximum likelihood fits (i.e. REML=FALSE ) to evaluate the deviance. • In general we calculate p-values for a LRT from a χ 2 distribution with degrees of freedom equal to the difference in the number of parameters in the models. • The important thing to note is that a likelihood ratio test is based on fitting the model under each set of conditions.

  8. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Profiling the deviance versus one parameter • There is a close relationship between confidence intervals and hypothesis tests on a single parameter. When, e.g. H 0 : β 1 = β 1 , 0 versus H a : β 1 � = β 1 , 0 is not rejected at level α then β 1 , 0 is in a 1 − α confidence interval on the parameter β 1 . • For linear fixed-effects models it is possible to determine the change in the deviance from fitting the full model only. For mixed-effects models we need to fit the full model and all the reduced models to perform the LRTs. • In practice we fit some of them and use interpolation. The profile function evaluates such a “profile” of the change in the deviance versus each of the parameters in the model.

  9. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Transforming the LRT statistic • The LRT statistic for a test of a fixed value of a single parameter would have a χ 2 1 distribution, which is the square of a standard normal. • If a symmetric confidence interval were appropriate for the parameter, the LRT statistic would be quadratic with respect to the parameter. • We plot the square root of the LRT statistic because it is easier to assess whether the plot looks like a straight line than it is to assess if it looks like a quadratic. • To accentuate the straight line behavior we use the signed square root transformation which returns the negative square root to the left of the estimate and the positive square root to the right. • This quantity can be compared to a standard normal. We write it as ζ

  10. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  11. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Evaluating and plotting the profile > pr1 <- profile(fm1M <- lmer(Yield ~ 1 + (1 | Batch), + Dyestuff, REML = FALSE)) > xyplot(pr1, aspect = 1.3) .sig01 .lsig (Intercept) 2 1 ζ 0 −1 −2 0 20 40 60 80 100 3.6 3.8 4.0 4.2 1500 1550 • The parameters are σ b , log( σ ) ( σ is the residual standard deviation) and µ . The vertical lines delimit 50%, 80%, 90%, 95% and 99% confidence intervals.

  12. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Alternative profile plot > xyplot(pr1, aspect = 0.7, absVal = TRUE) 2.5 2.0 (Intercept) .sig01 1.5 .lsig | ζ | 1.0 0.5 0.0 0 20 40 60 80 100 3.6 3.8 4.0 4.2 1500 1550 > confint(pr1) 2.5 % 97.5 % .sig01 12.201753 84.06289 .lsig 3.643622 4.21446 (Intercept) 1486.451500 1568.54849 > confint(pr1, level = 0.99) 0.5 % 99.5 % .sig01 NA 113.692643 .lsig 3.571293 4.326347 (Intercept) 1465.874011 1589.126022

  13. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Interpreting the univariate plots • A univariate profile ζ plot is read like a normal probability plot • a sigmoidal (elongated “S”-shaped) pattern like that for the (Intercept) parameter indicates overdispersion relative to the normal distribution. • a bending pattern, usually flattening to the right of the estimate, indicates skewness of the estimator and warns us that the confidence intervals will be asymmetric • a straight line indicates that the confidence intervals based on the quantiles of the standard normal distribution are suitable • Note that the only parameter providing a more-or-less straight line is σ and this plot is on the scale of log( σ ) not σ or, even worse, σ 2 . • We should expect confidence intervals on σ 2 to be asymmetric. In the simplest case of a variance estimate from an i.i.d. normal sample the confidence interval is derived from quantiles of a χ 2 distribution which is quite asymmetric. • Yet many software packages provide standard errors of variance component estimates as if they were meaningful.

  14. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Profile ζ plots for log( σ ) , σ and σ 2 log ( σ ) σ σ 2 2 1 ζ 0 −1 −2 3.6 3.8 4.0 4.2 40 50 60 70 2000 3000 4000 5000 • We can see moderate asymmetry on the scale of σ and stronger asymmetry on the scale of σ 2 . • The issue of which of the ML or REML estimates of σ 2 are closer to being unbiased is a red herring. σ 2 is not a sensible scale on which to evaluate the expected value of an estimator.

  15. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Profile ζ plots for log( σ 1 ) , σ 1 and σ 2 1 log ( σ 1 ) σ 1 σ 1 2 2 1 0 ζ −1 −2 2 3 4 0 20 40 60 80 100 0 5000 10000 • For σ 1 the situation is more complicated because 0 is within the range of reasonable values. The profile flattens as σ → 0 which means that intervals on log( σ ) are unbounded. • Obviously the estimator of σ 2 1 is terribly skewed yet most software ignores this and provides standard errors on variance component estimates.

  16. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

  17. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Profile pairs plots • The information from the profile can be used to produce pairwise projections of likelihood contours. These correspond to pairwise joint confidence regions. • Such a plot (next slide) can be somewhat confusing at first glance. • Concentrate initially on the panels above the diagonal where the axes are the parameters in the scale shown in the diagonal panels. The contours correspond to 50%, 80%, 90%, 95% and 99% pairwise confidence regions. • The two lines in each panel are “profile traces”, which are the conditional estimate of one parameter given a value of the other. • The actual interpolation of the contours is performed on the ζ scale which is shown in the panels below the diagonal.

  18. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Profile pairs for model fm1 > splom(pr1) 1600 1550 (Intercept) 1500 0 1 2 3 1450 4.4 4.0 4.2 4.4 4.2 4.0 .lsig 3.8 3.6 0 1 2 3 0 50 100 150 .sig01 0 −1 −2 −3 Scatter Plot Matrix

  19. Profiling the deviance Plotting the profiled deviance Profile pairs Covariates Outline Profiling the deviance Plotting the profiled deviance Profile pairs Profiling models with fixed-effects for covariates

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend