deepsense.aideepsense.ai logo
  • Careers
    • Job offers
    • Summer internship
  • Clients’ stories
  • Services
    • AI software
    • Team augmentation
    • AI advisory
    • Train your team
  • Industries
    • Retail
    • Manufacturing
    • Financial & Insurance
    • IT operations
    • TMT & Other
    • Medical & Beauty
  • Knowledge base
    • Blog
    • R&D hub
  • About us
    • Our story
    • Management
    • Advisory board
    • Press center
  • Contact
  • Menu Menu
HE plots

HE plots

February 19, 2015/in Data science /by Przemyslaw Biecek

GPS helps the drivers to avoid traffic jams, yet in more advanced uses it allows for fleet management or remote drone strikes. It is just the same with visualization. Bars and dots can be used to present a set of several means but there are also more advanced uses such as presentation of differences in the covariance structures. And it’s today’s topic. But first things first.

I have recently faced the following problem (field of science: anthropology). We have skulls, both female and male, found in different places. Each skull is described by five numbers specifying distances between particular elements of the skull. What question do we want to answer? We want to test whether and to what extent the parameters are different for female and male skulls and for the skulls found in various locations.
If parameters of the skulls were expressed by one number instead of five we could solve the puzzle using a classic two-way analysis of variance.HE plotsHaving five parameters describing the skulls, we can approach each of them individually and solve the problem by performing five separate analysis of variances.
However, our parameters are interdependent and in this case we will get much better results if we employ models allowing for simultaneous modeling of multidimensional variables.
We face the problem of simultaneous modeling of multidimensional measurements quite often, especially when the variables we try to present are interdependent. This is the case for example during simultaneous modeling of skills (e.g. in education, measured in few subdomains like math, reading, science), financial products (prepossession vs. risk) or in industry like modeling of the amount of milk, protein and fat in the milk yield.
Is there scope for interesting plots? Let us see.
We will start from taking a quick look at the one-dimensional problem.
The standard linear model with one-dimensional response is usually as follows:
Screen Shot 2015-02-15 at 22.06.50
The null hypothesis in a general form can be written in the following way (L is a contrast matrix):
Screen Shot 2015-02-15 at 22.07.44
The test for such hypothesis is based on the quotient of two estimates. One of them is a estimate of the size of random noise
Screen Shot 2015-02-15 at 22.07.59
and the other one is the estimate of the size of effect
Screen Shot 2015-02-15 at 22.07.48
After scaling such quotient has distribution F. If the effect is considerably bigger than the distortion we consider this effect really significant. That’s it.
But how about multidimensional models?
Firstly, effect Y is multidimensional and as a result the effects are described by the coefficient matrix and the vector of random noise is also multidimensional.
Screen Shot 2015-02-15 at 22.06.58
The hypothesis is constructed in a very similar way. The only difference is that zero on the right side of the equation is a matrix.
Screen Shot 2015-02-15 at 22.08.09
Now we have reached the test phase. We proceed in the same way as in case of one-dimensional model. Firstly, we calculate the size of the effect (also sometimes called effect Hypothesis, whence H standing for hypothesis) and the scope of random noise (E for error). Now these values are symmetric matrices.
Screen Shot 2015-02-15 at 22.08.25
Screen Shot 2015-02-15 at 22.08.16
Once we have such a pair of matrices we have to face the following question: when is the matrix for effect considerably bigger than the matrix for random noise?
There are several approaches to this question but they usually come down to the analysis of the distance between the effect matrix times inverse of the error matrix and the unit matrix (in case of the null hypothesis the distance should be insignificant).
Screen Shot 2015-02-15 at 22.09.36
One can do this using characteristic values etc.
However, one can also visually compare these two matrices, e.g. on a plot! This is what HE plots are for.
In R program you will find tools for creation of HE plots in the heplots package. Let us see how to use them on an example.
Data on the skulls are not publicly available, so let us take as an example data from PISA study on levels of skills in three fields: mathematics, science and reading. We will check the influence of two factors, gender and numbers of books at home, on this three-dimensional vector.
Let’s go to R! We load the package and select only the data concerning Poland. Then we build a three-dimensional linear model and we draw a HE plots for it.

library(PISA2012lite)
pol = student2012[student2012$CNT == "Poland",]
model = lm(cbind(PV1MATH, PV1READ, PV1SCIE)~ST28Q01+ST04Q01, pol)
heplot(model, size="effect.size", las=1, term.labels=F)

HE plots 1
Interestingly, the moment we look at this diagram we come to at least three conclusions:
(i) results in mathematics and reading comprehension are correlated in the residuals,
(ii) effect produced by books is rather strong and it is correlated both with the results in mathematics and reading,
(iii) effect produced by gender is also strong but its nature is different; females’ results in reading comprehension are on average much better while their average results in mathematics are a little worse.
All the relationships presented on one plot.
This is a diagram presenting matrices H and E for the pair of variables. We can display all the pairs using the pairs() function.
HE plots 2
But what should we do when the variables are very numerous? Instead of generating dozens of diagrams we would like to present the most important information on one diagram which would sum up all the variables. In such case we might use canonical discriminant analyses which will be a topic of the next week’s post.
More information about HE plots is available:
Visual Hypothesis Tests in Multivariate Linear Models: The heplots Package for R
John Fox Michael Friendly Georges Monette
HE Plots for Multivariate Linear Models
Michael Friendly
HE Plots for Repeated Measures Designs
Michael Friendly

Przemyslaw Biecek

Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://deepsense.ai/wp-content/uploads/2019/02/HE-plots.jpg 337 1140 Przemyslaw Biecek https://deepsense.ai/wp-content/uploads/2019/04/DS_logo_color.svg Przemyslaw Biecek2015-02-19 06:30:022021-01-05 16:54:36HE plots

Start your search here

NEWSLETTER SUBSCRIPTION

    You can modify your privacy settings and unsubscribe from our lists at any time (see our privacy policy).

    This site is protected by reCAPTCHA and the Google privacy policy and terms of service apply.

    THE NEWEST AI MONTHLY DIGEST

    • AI Monthly Digest 20 - TL;DRAI Monthly Digest 20 – TL;DRMay 12, 2020

    CATEGORIES

    • Elasticsearch
    • Computer vision
    • Artificial Intelligence
    • AIOps
    • Big data & Spark
    • Data science
    • Deep learning
    • Machine learning
    • Neptune
    • Reinforcement learning
    • Seahorse
    • Job offer
    • Popular posts
    • AI Monthly Digest
    • Press release

    POPULAR POSTS

    • AI trends for 2021AI trends for 2021January 7, 2021
    • A comprehensive guide to demand forecastingA comprehensive guide to demand forecastingMay 28, 2019
    • What is reinforcement learning? The complete guideWhat is reinforcement learning? deepsense.ai’s complete guideJuly 5, 2018

    Would you like
    to learn more?

    Contact us!
    • deepsense.ai logo white
    • Services
    • Customized AI software
    • Team augmentation
    • AI advisory
    • Knowledge base
    • Blog
    • R&D hub
    • deepsense.ai
    • Careers
    • Summer internship
    • Our story
    • Management
    • Advisory board
    • Press center
    • Support
    • Terms of service
    • Privacy policy
    • Code of ethics
    • Contact us
    • Join our community
    • facebook logo linkedin logo twitter logo
    • © deepsense.ai 2014-
    Scroll to top

    This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

    OKLearn more

    Cookie and Privacy Settings



    How we use cookies

    We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

    Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

    Essential Website Cookies

    These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

    Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

    We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

    We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

    Other external services

    We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

    Google Webfont Settings:

    Google Map Settings:

    Google reCaptcha Settings:

    Vimeo and Youtube video embeds:

    Privacy Policy

    You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

    Accept settingsHide notification only