SlideShare a Scribd company logo
1 of 32
Download to read offline
Nomograms for visualising relationships
      between three variables

      Jonathan Rougier1            Kate Milner2

            1 Dept   Mathematics, Univ. Bristol
    2 Crossroads   Veterinary Centre, Buckinghamshire


     UseR! 2011, August 2011, Warwick
Background




  A donkey drawn by my
  housemate Caroline (in
  the pub).
Background




  A donkey drawn by my
  housemate Caroline (in
  the pub).
                           This donkey is
                           not enjoying being
                           weighed.
Background




  A donkey drawn by my
  housemate Caroline (in
  the pub).
                           This donkey is
                           not enjoying being
                           weighed.
                                                A happy baby donkey
                                                being measured.
Usual practice
   The standard practice is to fit a relationship

        log(Weight) = a + b log(HeartGirth) + c log(Height)

   to adult donkeys in good condition, and possibly other
   relationships for juveniles and donkeys in poor condition. What
   value can we statisticians add?
Usual practice
   The standard practice is to fit a relationship

        log(Weight) = a + b log(HeartGirth) + c log(Height)

   to adult donkeys in good condition, and possibly other
   relationships for juveniles and donkeys in poor condition. What
   value can we statisticians add?

    1. Explicit inclusion of factors for Age, Gender, and BCS (Body
       Condition Score);
Usual practice
   The standard practice is to fit a relationship

        log(Weight) = a + b log(HeartGirth) + c log(Height)

   to adult donkeys in good condition, and possibly other
   relationships for juveniles and donkeys in poor condition. What
   value can we statisticians add?

    1. Explicit inclusion of factors for Age, Gender, and BCS (Body
       Condition Score);

    2. Box-Cox assessment of the appropriate transformation of the
       lefthand side (boxcox in the MASS package);
Usual practice
   The standard practice is to fit a relationship

        log(Weight) = a + b log(HeartGirth) + c log(Height)

   to adult donkeys in good condition, and possibly other
   relationships for juveniles and donkeys in poor condition. What
   value can we statisticians add?

    1. Explicit inclusion of factors for Age, Gender, and BCS (Body
       Condition Score);

    2. Box-Cox assessment of the appropriate transformation of the
       lefthand side (boxcox in the MASS package);

    3. Initial model to include interactions, then stepwise reduction
       to maximise AIC (stepAIC in the MASS package).
Building the statistical model
   Box-Cox plot for transformations of the response favours square
   root
Building the statistical model

   Backwards stepwise deletion removes all interaction terms :) and
   Gender completely
   Stepwise Model Path
   Analysis of Deviance Table

   Initial Model:
   sqrt(Weight) ~ BCSis + Gender + Age + log(HeartGirth) + log(Height) +
       log(HeartGirth):log(Height) + BCSis:log(HeartGirth) + Gender:log(HeartGirth) +
       Age:log(HeartGirth) + BCSis:log(Height) + Gender:log(Height) +
       Age:log(Height)

   Final Model:
   sqrt(Weight) ~ BCSis + Age + log(HeartGirth) + log(Height)


                              Step Df  Deviance Resid. Df Resid. Dev        AIC
   1                                                  504   78.14041 -972.7873
   2         - Age:log(HeartGirth) 5 0.37630656       509   78.51672 -980.1883
   3       - BCSis:log(HeartGirth) 4 0.49082973       513   79.00755 -984.8168
   4           - BCSis:log(Height) 4 0.41453445       517   79.42208 -989.9858
   5             - Age:log(Height) 5 0.91895494       522   80.34104 -993.7620
   6          - Gender:log(Height) 2 0.13986420       524   80.48090 -996.8210
   7 - log(HeartGirth):log(Height) 1 0.00927524       525   80.49018 -998.7587
   8      - Gender:log(HeartGirth) 2 0.31844543       527   80.80862 -1000.6226
   9                      - Gender 2 0.06633122       529   80.87496 -1004.1787
Building the statistical model
   Resulting model has additive adjustments for BCS and Age
   Call:
   lm(formula = sqrt(Weight) ~ BCSis + Ageis + log(HeartGirth) +
       log(Height), data = donk, subset = subset)

   Residuals:
         Min        1Q    Median         3Q        Max
   -1.016797 -0.275575 -0.005298   0.255089   1.519246

   Coefficients:
                    Estimate Std. Error t value   Pr(>|t|)
   (Intercept)     -58.89411    2.42162 -24.320    < 2e-16   ***
   BCSis1.5         -0.49820    0.17939 -2.777     0.00568   **
   BCSis2           -0.24978    0.08253 -3.026     0.00260   **
   BCSis3.5          0.37485    0.05833   6.426   2.91e-10   ***
   BCSis4            0.57031    0.11024   5.173   3.27e-07   ***
   Ageis<2yo        -0.35353    0.07676 -4.605    5.16e-06   ***
   Ageis5-10yo       0.19782    0.06255   3.162    0.00165   **
   Ageis>10yo        0.27681    0.05070   5.459   7.35e-08   ***
   log(HeartGirth) 10.22732     0.50604 20.211     < 2e-16   ***
   log(Height)       4.84926    0.60029   8.078   4.45e-15   ***
   ---
   Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 .    0.1    1

   Residual standard error: 0.392 on 531 degrees of freedom
   Multiple R-squared: 0.8724, Adjusted R-squared: 0.8703
   F-statistic: 403.5 on 9 and 531 DF, p-value: < 2.2e-16
Nomogram for our donkeys

  Our statistical estimate of Weight is
                                                                 2
    Weight =    − 58.9† + 10.2 log HeartGirth + 4.8 log Height

  where † indicates adjustments to be made for BCS and Age. How
  do we turn this into something that can be used in the field?
      Most statisticians would immediately think of a contour plot,
      which would work for any relationship of the form
      f (u, v ) = w . This requires two straight lines and an
      interpolation.
Nomogram for our donkeys

  Our statistical estimate of Weight is
                                                                 2
    Weight =    − 58.9† + 10.2 log HeartGirth + 4.8 log Height

  where † indicates adjustments to be made for BCS and Age. How
  do we turn this into something that can be used in the field?
      Most statisticians would immediately think of a contour plot,
      which would work for any relationship of the form
      f (u, v ) = w . This requires two straight lines and an
      interpolation.
      For a large subset of such relationships, though, we can
      construct a nomogram, which needs one straight line and no
      interpolation.
Nomogram for our donkeys


                           Additive corrections:

                           BCS: 1.5,     -11kg
                                2,        -6kg
                                3.5,     +10kg
                                4,       +16kg

                           Age: <2yo,   -7kg
                                5-10yo, +5kg
                                >10yo, +7kg
Nomogram for our donkeys


                           Additive corrections:

                           BCS: 1.5,     -11kg
                                2,        -6kg
                                3.5,     +10kg
                                4,       +16kg

                           Age: <2yo,   -7kg
                                5-10yo, +5kg
                                >10yo, +7kg


                           A healthy (BCS 2.5
                           or 3) 2-5yo donkey
                           with a HeartGirth
                           of 117cm and a
                           Height of 102cm has
                           a predicted weight of
                           about 150kg.
Digression on nomograms
   Nomograms are visual tools for representing the relationship
   between three or more variables, in such a way that the value of
   one variable can be inferred from the values of the others by
   drawing a straight line.

       f1 (u) + f2 (v ) = f3 (w ) gives a parallel scale-nomogram, like
       ours;

       We could also have used an N chart, used for
       f1 (u)/f2 (v ) = f3 (w );

       Proportional nomograms can handle more than three
       variables, e.g. in two stages using a pivot;

       An entire theory based around determinants allows the
       construction of nomograms for much more general
       relationships; typically these are curved scale nomograms.
Digression on nomograms




   All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
Digression on nomograms




   All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
Digression on nomograms




   All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
Digression on nomograms




   All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
Back to the donkeys!
                       What is the ef-
                       fect of replacing
                       sqrt(Weight)
                       with log(Weight),
                       which would be
                       the more usual
                       transformation?
Back to the donkeys!
                       What is the ef-
                       fect of replacing
                       sqrt(Weight)
                       with log(Weight),
                       which would be
                       the more usual
                       transformation?

                       Gives slightly
                       higher weights
                       (∼5kg) for small
                       and large don-
                       keys. This differ-
                       ence is smaller
                       than the residual
                       standard devi-
                       ation, which is
                       10kg.
Back to the donkeys!
                       What is the ef-
                       fect of replacing
                       sqrt(Weight)
                       with log(Weight),
                       which would be
                       the more usual
                       transformation?

                       Gives slightly
                       higher weights
                       (∼5kg) for small
                       and large don-
                       keys. This differ-
                       ence is smaller
                       than the residual
                       standard devi-
                       ation, which is
                       10kg.
Back to the donkeys!
   Things are a lot less clear if we try to visualise this using a contour
   plot.
Different relationships on one plot


                                     Height and
                                     Length seem
                                     to be interchange-
                                     able; so could
                                     estimate Weight
                                     with either.
Different relationships on one plot


                                     Height and
                                     Length seem
                                     to be interchange-
                                     able; so could
                                     estimate Weight
                                     with either.

                                     Estimate using
                                     Length can be
                                     added to exist-
                                     ing nomogram,
                                     to give vets the
                                     choice of which
                                     measurement to
                                     make.
Different relationships on one plot


                                     Height and
                                     Length seem
                                     to be interchange-
                                     able; so could
                                     estimate Weight
                                     with either.

                                     Estimate using
                                     Length can be
                                     added to exist-
                                     ing nomogram,
                                     to give vets the
                                     choice of which
                                     measurement to
                                     make.
Different types of donkey


                           Different types
                           of donkey can be
                           displayed on the
                           same plot. Here
                           are our Kenyan
                           donkeys, shown
                           with a Length
                           covariate.
Different types of donkey


                           Different types
                           of donkey can be
                           displayed on the
                           same plot. Here
                           are our Kenyan
                           donkeys, shown
                           with a Length
                           covariate.

                           This is for Mo-
                           roccan donkeys.
                           They tend to be a
                           bit lighter for the
                           same size.
Different types of donkey


                           Different types
                           of donkey can be
                           displayed on the
                           same plot. Here
                           are our Kenyan
                           donkeys, shown
                           with a Length
                           covariate.

                           This is for Mo-
                           roccan donkeys.
                           They tend to be a
                           bit lighter for the
                           same size.
Summary

  Visualisation is an important part of both data analysis and
  statistical communication.
      For relating three variables, contour plots will always work,
      but where they are available, nomograms might be clearer and
      simpler to use.
      Our donkey nomogram will be used by practicing vets in
      Kenya, but it has also been a useful tool for us in model
      choice and model comparison.
      Nomograms are also available for some relationships between
      four or more variables.
      One catch: Contour plots can be overlaid on a field showing
      predictive uncertainties. Unfortunately it is not as easy to
      visualise predictive uncertainty with a nomogram.
Resources


   Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP
   Journal, 30(4), pp. 457-493.
   http://myreckonings.com/wordpress/wp-content/uploads/
   JournalArticle/The Lost Art of Nomography.pdf

   Ron Doerfler, Creating Nomograms with the PyNomo Software,
   Version 1.1 for PyNomo Release 0.2.2.
   http://www.myreckonings.com/pynomo/
   CreatingNomogramsWithPynomo.pdf

   Leif Roschier, 2009, http://www.pynomo.org/

More Related Content

Similar to useR2011 - Rougier

1-stata-introduction.ppt
1-stata-introduction.ppt1-stata-introduction.ppt
1-stata-introduction.pptMohammed35151
 
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docx
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docxSheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docx
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docxbagotjesusa
 
Hookes law. tpack at kibasila sec school
Hookes law. tpack at kibasila sec schoolHookes law. tpack at kibasila sec school
Hookes law. tpack at kibasila sec schoolAyoub Kafyulilo
 
AA Section 3-5
AA Section 3-5AA Section 3-5
AA Section 3-5Jimbo Lamb
 
Report for Experiment 4 Newton’s Second Law .docx
Report for Experiment 4 Newton’s Second Law  .docxReport for Experiment 4 Newton’s Second Law  .docx
Report for Experiment 4 Newton’s Second Law .docxsodhi3
 
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...John Blue
 

Similar to useR2011 - Rougier (7)

1-stata-introduction.ppt
1-stata-introduction.ppt1-stata-introduction.ppt
1-stata-introduction.ppt
 
Tables nhanes
Tables nhanesTables nhanes
Tables nhanes
 
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docx
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docxSheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docx
Sheet1470 Real1kTotal RCurrent470 R Voltage1k VoltageAmmeter Volta.docx
 
Hookes law. tpack at kibasila sec school
Hookes law. tpack at kibasila sec schoolHookes law. tpack at kibasila sec school
Hookes law. tpack at kibasila sec school
 
AA Section 3-5
AA Section 3-5AA Section 3-5
AA Section 3-5
 
Report for Experiment 4 Newton’s Second Law .docx
Report for Experiment 4 Newton’s Second Law  .docxReport for Experiment 4 Newton’s Second Law  .docx
Report for Experiment 4 Newton’s Second Law .docx
 
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...
Dr. Mike Brumm - Impact of heavy swine market weights on facility and equipme...
 

More from rusersla

LA R meetup - Nov 2013 - Eric Klusman
LA R meetup - Nov 2013 - Eric KlusmanLA R meetup - Nov 2013 - Eric Klusman
LA R meetup - Nov 2013 - Eric Klusmanrusersla
 
useR2011 - Whitcher
useR2011 - WhitcheruseR2011 - Whitcher
useR2011 - Whitcherrusersla
 
useR2011 - Huber
useR2011 - HuberuseR2011 - Huber
useR2011 - Huberrusersla
 
useR2011 - Gromping
useR2011 - Gromping useR2011 - Gromping
useR2011 - Gromping rusersla
 
Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1rusersla
 
Los Angeles R users group - July 12 2011 - Part 2
Los Angeles R users group - July 12 2011 - Part 2Los Angeles R users group - July 12 2011 - Part 2
Los Angeles R users group - July 12 2011 - Part 2rusersla
 
Los Angeles R users group - Nov 17 2010 - Part 2
Los Angeles R users group - Nov 17 2010 - Part 2Los Angeles R users group - Nov 17 2010 - Part 2
Los Angeles R users group - Nov 17 2010 - Part 2rusersla
 
Los Angeles R users group - Dec 14 2010 - Part 1
Los Angeles R users group - Dec 14 2010 - Part 1Los Angeles R users group - Dec 14 2010 - Part 1
Los Angeles R users group - Dec 14 2010 - Part 1rusersla
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2rusersla
 

More from rusersla (9)

LA R meetup - Nov 2013 - Eric Klusman
LA R meetup - Nov 2013 - Eric KlusmanLA R meetup - Nov 2013 - Eric Klusman
LA R meetup - Nov 2013 - Eric Klusman
 
useR2011 - Whitcher
useR2011 - WhitcheruseR2011 - Whitcher
useR2011 - Whitcher
 
useR2011 - Huber
useR2011 - HuberuseR2011 - Huber
useR2011 - Huber
 
useR2011 - Gromping
useR2011 - Gromping useR2011 - Gromping
useR2011 - Gromping
 
Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1
 
Los Angeles R users group - July 12 2011 - Part 2
Los Angeles R users group - July 12 2011 - Part 2Los Angeles R users group - July 12 2011 - Part 2
Los Angeles R users group - July 12 2011 - Part 2
 
Los Angeles R users group - Nov 17 2010 - Part 2
Los Angeles R users group - Nov 17 2010 - Part 2Los Angeles R users group - Nov 17 2010 - Part 2
Los Angeles R users group - Nov 17 2010 - Part 2
 
Los Angeles R users group - Dec 14 2010 - Part 1
Los Angeles R users group - Dec 14 2010 - Part 1Los Angeles R users group - Dec 14 2010 - Part 1
Los Angeles R users group - Dec 14 2010 - Part 1
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2
 

Recently uploaded

Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menzaictsugar
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCRashishs7044
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdfKhaled Al Awadi
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...ssuserf63bd7
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...ictsugar
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaoncallgirls2057
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchirictsugar
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyotictsugar
 
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadIslamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadAyesha Khan
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionMintel Group
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...ShrutiBose4
 

Recently uploaded (20)

Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchir
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
 
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadIslamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted Version
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
 

useR2011 - Rougier

  • 1. Nomograms for visualising relationships between three variables Jonathan Rougier1 Kate Milner2 1 Dept Mathematics, Univ. Bristol 2 Crossroads Veterinary Centre, Buckinghamshire UseR! 2011, August 2011, Warwick
  • 2. Background A donkey drawn by my housemate Caroline (in the pub).
  • 3. Background A donkey drawn by my housemate Caroline (in the pub). This donkey is not enjoying being weighed.
  • 4. Background A donkey drawn by my housemate Caroline (in the pub). This donkey is not enjoying being weighed. A happy baby donkey being measured.
  • 5. Usual practice The standard practice is to fit a relationship log(Weight) = a + b log(HeartGirth) + c log(Height) to adult donkeys in good condition, and possibly other relationships for juveniles and donkeys in poor condition. What value can we statisticians add?
  • 6. Usual practice The standard practice is to fit a relationship log(Weight) = a + b log(HeartGirth) + c log(Height) to adult donkeys in good condition, and possibly other relationships for juveniles and donkeys in poor condition. What value can we statisticians add? 1. Explicit inclusion of factors for Age, Gender, and BCS (Body Condition Score);
  • 7. Usual practice The standard practice is to fit a relationship log(Weight) = a + b log(HeartGirth) + c log(Height) to adult donkeys in good condition, and possibly other relationships for juveniles and donkeys in poor condition. What value can we statisticians add? 1. Explicit inclusion of factors for Age, Gender, and BCS (Body Condition Score); 2. Box-Cox assessment of the appropriate transformation of the lefthand side (boxcox in the MASS package);
  • 8. Usual practice The standard practice is to fit a relationship log(Weight) = a + b log(HeartGirth) + c log(Height) to adult donkeys in good condition, and possibly other relationships for juveniles and donkeys in poor condition. What value can we statisticians add? 1. Explicit inclusion of factors for Age, Gender, and BCS (Body Condition Score); 2. Box-Cox assessment of the appropriate transformation of the lefthand side (boxcox in the MASS package); 3. Initial model to include interactions, then stepwise reduction to maximise AIC (stepAIC in the MASS package).
  • 9. Building the statistical model Box-Cox plot for transformations of the response favours square root
  • 10. Building the statistical model Backwards stepwise deletion removes all interaction terms :) and Gender completely Stepwise Model Path Analysis of Deviance Table Initial Model: sqrt(Weight) ~ BCSis + Gender + Age + log(HeartGirth) + log(Height) + log(HeartGirth):log(Height) + BCSis:log(HeartGirth) + Gender:log(HeartGirth) + Age:log(HeartGirth) + BCSis:log(Height) + Gender:log(Height) + Age:log(Height) Final Model: sqrt(Weight) ~ BCSis + Age + log(HeartGirth) + log(Height) Step Df Deviance Resid. Df Resid. Dev AIC 1 504 78.14041 -972.7873 2 - Age:log(HeartGirth) 5 0.37630656 509 78.51672 -980.1883 3 - BCSis:log(HeartGirth) 4 0.49082973 513 79.00755 -984.8168 4 - BCSis:log(Height) 4 0.41453445 517 79.42208 -989.9858 5 - Age:log(Height) 5 0.91895494 522 80.34104 -993.7620 6 - Gender:log(Height) 2 0.13986420 524 80.48090 -996.8210 7 - log(HeartGirth):log(Height) 1 0.00927524 525 80.49018 -998.7587 8 - Gender:log(HeartGirth) 2 0.31844543 527 80.80862 -1000.6226 9 - Gender 2 0.06633122 529 80.87496 -1004.1787
  • 11. Building the statistical model Resulting model has additive adjustments for BCS and Age Call: lm(formula = sqrt(Weight) ~ BCSis + Ageis + log(HeartGirth) + log(Height), data = donk, subset = subset) Residuals: Min 1Q Median 3Q Max -1.016797 -0.275575 -0.005298 0.255089 1.519246 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -58.89411 2.42162 -24.320 < 2e-16 *** BCSis1.5 -0.49820 0.17939 -2.777 0.00568 ** BCSis2 -0.24978 0.08253 -3.026 0.00260 ** BCSis3.5 0.37485 0.05833 6.426 2.91e-10 *** BCSis4 0.57031 0.11024 5.173 3.27e-07 *** Ageis<2yo -0.35353 0.07676 -4.605 5.16e-06 *** Ageis5-10yo 0.19782 0.06255 3.162 0.00165 ** Ageis>10yo 0.27681 0.05070 5.459 7.35e-08 *** log(HeartGirth) 10.22732 0.50604 20.211 < 2e-16 *** log(Height) 4.84926 0.60029 8.078 4.45e-15 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Residual standard error: 0.392 on 531 degrees of freedom Multiple R-squared: 0.8724, Adjusted R-squared: 0.8703 F-statistic: 403.5 on 9 and 531 DF, p-value: < 2.2e-16
  • 12. Nomogram for our donkeys Our statistical estimate of Weight is 2 Weight = − 58.9† + 10.2 log HeartGirth + 4.8 log Height where † indicates adjustments to be made for BCS and Age. How do we turn this into something that can be used in the field? Most statisticians would immediately think of a contour plot, which would work for any relationship of the form f (u, v ) = w . This requires two straight lines and an interpolation.
  • 13. Nomogram for our donkeys Our statistical estimate of Weight is 2 Weight = − 58.9† + 10.2 log HeartGirth + 4.8 log Height where † indicates adjustments to be made for BCS and Age. How do we turn this into something that can be used in the field? Most statisticians would immediately think of a contour plot, which would work for any relationship of the form f (u, v ) = w . This requires two straight lines and an interpolation. For a large subset of such relationships, though, we can construct a nomogram, which needs one straight line and no interpolation.
  • 14. Nomogram for our donkeys Additive corrections: BCS: 1.5, -11kg 2, -6kg 3.5, +10kg 4, +16kg Age: <2yo, -7kg 5-10yo, +5kg >10yo, +7kg
  • 15. Nomogram for our donkeys Additive corrections: BCS: 1.5, -11kg 2, -6kg 3.5, +10kg 4, +16kg Age: <2yo, -7kg 5-10yo, +5kg >10yo, +7kg A healthy (BCS 2.5 or 3) 2-5yo donkey with a HeartGirth of 117cm and a Height of 102cm has a predicted weight of about 150kg.
  • 16. Digression on nomograms Nomograms are visual tools for representing the relationship between three or more variables, in such a way that the value of one variable can be inferred from the values of the others by drawing a straight line. f1 (u) + f2 (v ) = f3 (w ) gives a parallel scale-nomogram, like ours; We could also have used an N chart, used for f1 (u)/f2 (v ) = f3 (w ); Proportional nomograms can handle more than three variables, e.g. in two stages using a pivot; An entire theory based around determinants allows the construction of nomograms for much more general relationships; typically these are curved scale nomograms.
  • 17. Digression on nomograms All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
  • 18. Digression on nomograms All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
  • 19. Digression on nomograms All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
  • 20. Digression on nomograms All figures from Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493.
  • 21. Back to the donkeys! What is the ef- fect of replacing sqrt(Weight) with log(Weight), which would be the more usual transformation?
  • 22. Back to the donkeys! What is the ef- fect of replacing sqrt(Weight) with log(Weight), which would be the more usual transformation? Gives slightly higher weights (∼5kg) for small and large don- keys. This differ- ence is smaller than the residual standard devi- ation, which is 10kg.
  • 23. Back to the donkeys! What is the ef- fect of replacing sqrt(Weight) with log(Weight), which would be the more usual transformation? Gives slightly higher weights (∼5kg) for small and large don- keys. This differ- ence is smaller than the residual standard devi- ation, which is 10kg.
  • 24. Back to the donkeys! Things are a lot less clear if we try to visualise this using a contour plot.
  • 25. Different relationships on one plot Height and Length seem to be interchange- able; so could estimate Weight with either.
  • 26. Different relationships on one plot Height and Length seem to be interchange- able; so could estimate Weight with either. Estimate using Length can be added to exist- ing nomogram, to give vets the choice of which measurement to make.
  • 27. Different relationships on one plot Height and Length seem to be interchange- able; so could estimate Weight with either. Estimate using Length can be added to exist- ing nomogram, to give vets the choice of which measurement to make.
  • 28. Different types of donkey Different types of donkey can be displayed on the same plot. Here are our Kenyan donkeys, shown with a Length covariate.
  • 29. Different types of donkey Different types of donkey can be displayed on the same plot. Here are our Kenyan donkeys, shown with a Length covariate. This is for Mo- roccan donkeys. They tend to be a bit lighter for the same size.
  • 30. Different types of donkey Different types of donkey can be displayed on the same plot. Here are our Kenyan donkeys, shown with a Length covariate. This is for Mo- roccan donkeys. They tend to be a bit lighter for the same size.
  • 31. Summary Visualisation is an important part of both data analysis and statistical communication. For relating three variables, contour plots will always work, but where they are available, nomograms might be clearer and simpler to use. Our donkey nomogram will be used by practicing vets in Kenya, but it has also been a useful tool for us in model choice and model comparison. Nomograms are also available for some relationships between four or more variables. One catch: Contour plots can be overlaid on a field showing predictive uncertainties. Unfortunately it is not as easy to visualise predictive uncertainty with a nomogram.
  • 32. Resources Ron Doerfler, 2009, The Lost Art of Nomography, The UMAP Journal, 30(4), pp. 457-493. http://myreckonings.com/wordpress/wp-content/uploads/ JournalArticle/The Lost Art of Nomography.pdf Ron Doerfler, Creating Nomograms with the PyNomo Software, Version 1.1 for PyNomo Release 0.2.2. http://www.myreckonings.com/pynomo/ CreatingNomogramsWithPynomo.pdf Leif Roschier, 2009, http://www.pynomo.org/