11.07.2015 Views

Preface to First Edition - lib

Preface to First Edition - lib

Preface to First Edition - lib

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ANALYSIS USING R 259The function glht (for generalised linear hypothesis) from package multcomp(Hothorn et al., 2009a, 2008a) takes the fitted aov object and a descriptionof the matrix K. Here, we use the mcp function <strong>to</strong> set up the matrix of allpairwise differences for the model parameters associated with fac<strong>to</strong>r alength:R> <strong>lib</strong>rary("multcomp")R> amod amod_glht amod_glht$linfct(Intercept) alengthintr alengthlongintr - shrt 0 1 0long - shrt 0 0 1long - intr 0 -1 1attr(,"type")[1] "Tukey"The amod_glht object now contains information about the estimated linearfunction ˆϑ and their covariance matrix which can be inspected via the coefand vcov methods:R> coef(amod_glht)intr - shrt long - shrt long - intr0.4341523 1.1887500 0.7545977R> vcov(amod_glht)intr - shrt long - shrt long - intrintr - shrt 0.14717604 0.1041001 -0.04307591long - shrt 0.10410012 0.2706603 0.16656020long - intr -0.04307591 0.1665602 0.20963611The summary and confint methods can be used <strong>to</strong> compute a summary statisticincluding adjusted p-values and simultaneous confidence intervals, respectively:R> confint(amod_glht)Simultaneous Confidence IntervalsMultiple Comparisons of Means: Tukey ContrastsFit: aov(formula = elevel ~ alength, data = alpha)Estimated Quantile = 2.371895% family-wise confidence levelLinear Hypotheses:Estimate lwr uprintr - shrt == 0 0.43415 -0.47574 1.34405© 2010 by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!