Skip to main content
Statistics LibreTexts

3.9: Try It!

  • Page ID
    33442
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Exercise \(\PageIndex{1}\): Diet Study

    The weight gain due to 4 different diets given to 24 calves is shown below.

    diet1 diet2 diet3 diet4
    12 18 10 19
    10 19 12 20
    13 18 13 18
    11 18 16 19
    12 19 14 18
    09 19 13 19

    a) Write the appropriate null and alternative hypotheses to test if the weight gain differs significantly among the 4 diets.

    Solution

    \(H_{0}: \ \mu_{1} = \mu_{2} = \mu_{3} = \mu_{4}\) vs. \(H_{a}: \ \mu_{i} \neq \mu_{j} for some \(i, j = 1,2,3,4\) OR "Not all means are equal"

    Note: Here, \(\mu_{i}, \ i=1,2,3,4\) are the actual mean weight gains due to diet1, diet2, diet3, and diet4, respectively.

    b) Analyze the data and write your conclusion.

    Solution

    Using SAS...

    data Lesson3_ex1;
    input diet $ wt_gain;
    datalines;
    diet1 12
    diet1 10
    diet1 13
    diet1 11
    diet1 12
    diet1 09
    diet2 18
    diet2 19
    diet2 18
    diet2 18
    diet2 19
    diet2 19
    diet3 10
    diet3 12
    diet3 13
    diet3 16
    diet3 14
    diet3 13
    diet4 19
    diet4 20
    diet4 18
    diet4 19
    diet4 18
    diet4 19
    ;
    ods graphics on;
    proc mixed data= Lesson3_ex1 plots=all; class diet;
    model wt_gain = diet;
    contrast 'Compare diet1 with diets 2,3,4 combined ' diet 3 -1 -1 -1;
    store result1;
    title 'ANOVA of Weight Gain Data';
    run;
    ods html style=statistical sge=on;
    proc plm restore=result1;
    lsmeans diet/ adjust=tukey plot=meanplot cl lines;
    run;
    

    The ANOVA results shown below indicate that the diet effect is significant with an \(F\)-value of 51.27 (\(p\)-value <.0001). This means that not all diets provide the same mean weight gain. The diffogram below indicates the significant different pairs of diets identified by solid blue lines. The estimated mean weight gains from diets 1, 3, 2, and 4 are 11, 13, 18.1, and 19 units respectively. The diet pairs that have significantly different mean weight gains are (1,2), (1,4), (3,2), and (3,4).

    Partial Output:

    Type 3 Tests of Fixed Effects
    Effect Num DF Den DF F Value Pr > F
    diet 3 20 51.27 <.0001
    diet Least Squares Means
    diet Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper
    diet1 11.1667 0.5413 20 20.63 <.0001 0.05 10.0374 12.2959
    diet2 18.5000 0.5413 20 34.17 <.0001 0.05 17.3708 19.6292
    diet3 13.0000 0.5413 20 24.01 <.0001 0.05 11.8708 14.1292
    diet4 18.8333 0.5413 20 34.79 <.0001 0.05 17.7041 19.9626
    Differences of diet Least Squares Means
    Adjustment for Multiple Comparisons: Tukey
    diet _diet Estimate Standard Error DF t Value Pr > |t| Adj P Alpha Lower Upper Adj Lower Adj Upper
    diet1 diet2 -7.3333 0.7656 20 -9.58 <.0001 <.0001 0.05 -8.9303 -5.7364 -9.4761 -5.1906
    diet1 diet3 -1.8333 0.7656 20 -2.39 0.0265 0.1105 0.05 -3.4303 -0.2364 -3.9761 0.3094
    diet1 diet4 -7.6667 0.7656 20 -10.01 <.0001 <.0001 0.05 -9.2636 -6.0697 -9.8094 -5.5239
    diet2 diet3 5.5000 0.7656 20 7.18 <.0001 <.0001 0.05 3.9030 7.0970 3.3572 7.6428
    diet2 diet4 -0.3333 0.7656 20 -0.44 0.6679 0.9716 0.05 -1.9303 1.2636 -2.4761 1.8094
    diet3 diet4 -5.8333 0.7656 20 -7.62 <.0001 <.0001 0.05 -7.4303 -4.2364 -7.9761 -3.6906
    SAS-generated diffogram for weight gain comparisons by diet.
    Figure \(\PageIndex{a1}\): SAS-generated diffogram for weight gain comparisons by diet.
    SAS-generated weight gain Tukey groupings for LS-means of the diets. Diet 4 and diet 2 are both covered by a blue bar, and diet 3 and diet 1 are both covered by a red bar.
    Figure \(\PageIndex{a2}\): SAS-generated Tukey grouping of weight gains for diet LS-means.
    Exercise \(\PageIndex{2}\): Commuter Times
    Diffogram of commute time comparisons by region.
    Figure \(\PageIndex{b1}\): Commute time comparisons in hours by region.

    Above is a diffogram depicting the differences in daily commuter time (in hours) among regions of a metropolitan city. Answer the following.

    a) Name the regions included in the study.

    Solution

    SOUT, MIDW, NORT, and WEST

    b) How many red or blue lines are to be expected?

    Solution

    4 choose 2 = 6 red or blue lines

    c) Which pairs of regions have significantly different average commuter times?

    Solution

    (SOUT and NORT), (SOUT and WEST), (MIDW and NORT), and (MIDW and WEST) have significantly different mean commuter times.

    d) Write down the estimated mean daily commuter time for each region.

    Solution
    Region SOUT MIDW NORT WEST
    Estimated mean commuter time in hours 8.7 10.5 16 16.2

    This page titled 3.9: Try It! is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Penn State's Department of Statistics.

    • Was this article helpful?