Liwaiwai Liwaiwai
  • /
  • Artificial Intelligence
  • Machine Learning
  • Robotics
  • Engineering
    • Architecture
    • Design
    • Software
    • Hybrid Cloud
    • Data
  • About
Liwaiwai Liwaiwai
  • /
  • Artificial Intelligence
  • Machine Learning
  • Robotics
  • Engineering
    • Architecture
    • Design
    • Software
    • Hybrid Cloud
    • Data
  • About
  • Data

A Short Primer On Generalized Linear Models (GLM)

  • December 11, 2019
  • admin

Generalized Linear Models (GLM) refers to a large class of models which include the familiar ordinary linear regression — ordinary least squares (OLS) regression — and the analysis of variance (ANOVA) models.

A bag loaded with tricks (models, rather)

Both OLS regression and ANOVA deal with continuous response variables. However, there are times that we need to predict a categorical response variable, for example, yes/no responses and count data.

For this purpose, other models like logit, log-linear, and probit model, just to name some, will be appropriate.

Yes, there’s a lot of models in the GLM domain. It is easy to get confused on what type of statistical model is suitable for the data you have on hand.

Here, we will dispel this confusion by getting to know GLMs a bit more.

What makes up a GLM?

There are three ingredients that make up a GLM:

  1. Random component
  2. Linear predictor
  3. Link function

By knowing these three components, we can be guided on what type of model we should be using for our data.

Let’s look at them one by one.

Component 1: Random component

The random component pertains to the response variable we are trying to model. Let’s call this variable Y.

This variable Y is assumed to follow a particular probability distribution. Here are some examples.

Response Variable (Y)  (Usually assumed) Distribution
Number of successes in
a given number of trials
Binomial
Counts Poisson, Negative Binomial
Continuous observation (e.g., weight) Normal, Gamma

Categorical data have a nominal or ordinal scale of measurement. Interval and ratio data are both continuous.

If you are having trouble recognizing whether a variable is categorical or continuous, this explainer on the levels of measurement might help.

Read More  Statistics For Dummies: Indexing and Subsetting In R [Part 1 of 2] : Vectors And Matrices

Component 2: Linear predictor

The linear predictor in a GLM will specify the explanatory variables, also known as predictors. It follows the form:

α + β1x1 + β2x2 + … + βpxp

The x’s in the equation are the values of the predictors that you have specified.

For example, you might be interested in predicting the tendency of a person to vote or not to vote for a presidential candidate.

The response variable is then a yes/no variable, depending on whether a person will vote or not.

What can be potential predators? It could be their party of choice, their economic status, their level of education, just to name a few.

Note that the equation above is a linear equation. This is the “linear” in “generalized linear models”. It pertains to how the predictors enter the model in a linear fashion.

Component 3: Link function

Now note that whenever we predict the response variable, we are predicting its mean or average value.

The link function is simply some function involving the mean response. Let’s denote this as ?.

Here are some common functions of ? used as link functions along with their names:

Function Link Type
? Identity link
log(?) Log link
log[?/(1-?)] , also known as logit (?) Logistic or logit link

To complete the GLM, we equate the link function to the linear predictor.

For instance, a GLM using the log link with two predictor variables will look like this:

log(?) = α + β1x1 + β2x2

The GLM above is an example of a log-linear model.

Which is which?

To wrap things up, here is a quick summary of what model you should use depending on the nature of the three components we have discussed:

Read More  Statistics For Dummies: Introduction To R Objects
Random Component Predictors Link Function Model to use
Normal Continuous Identity Linear Regression
Normal Categorical Identity ANOVA
Normal Mixed Identity Analysis of Covariance (ANCOVA)
Binomial Mixed Logit Logistic
Poisson Mixed Log Log-linear

Of course, this is only a selected few in the large selection of models that belong to the class of GLMs. They are among the typically used in practice, which is why they were chosen to be shown here.

Welcome to the world of GLMs. This primer is just the beginning — there is a long way ahead towards mastery. You are off to a good start.

admin

Related Topics
  • Generalized Linear Models
  • Modelling
  • Statistics
You May Also Like
View Post
  • Big Data
  • Data
  • Design

From Raw Data To Actionable Insights: The Power Of Data Aggregation

  • March 30, 2023
View Post
  • Data
  • Design
  • Engineering

Effective Strategies To Closing The Data-Value Gap

  • March 30, 2023
View Post
  • Artificial Intelligence
  • Data
  • Data Science
  • Machine Learning
  • Technology

Google Data Cloud & AI Summit : In Less Than 12 Hours From Now

  • March 29, 2023
View Post
  • Data
  • Machine Learning
  • Platforms

Coop Reduces Food Waste By Forecasting With Google’s AI And Data Cloud

  • March 23, 2023
View Post
  • Data
  • Engineering

BigQuery Under The Hood: Behind The Serverless Storage And Query Optimizations That Supercharge Performance

  • March 22, 2023
View Post
  • Data
  • Design
  • Engineering
  • Tools

Sumitovant More Than Doubles Its Research Output In Its Quest To Save Lives

  • March 21, 2023
View Post
  • Data
  • Platforms
  • Technology

How Osmo Is Digitizing Smell With Google Cloud AI Technology

  • March 20, 2023
View Post
  • Data
  • Engineering
  • Tools

Built With BigQuery: How Sift Delivers Fraud Detection Workflow Backtesting At Scale

  • March 20, 2023

Leave a Reply

Your email address will not be published. Required fields are marked *

Stay Connected!
LATEST
  • 1
    DBS Singapore: The Best Boasting To Be The Best For So Long, Humbled By Hubris
    • March 31, 2023
  • 2
    Bard And ChatGPT — A Head To Head Comparison
    • March 31, 2023
  • 3
    Modernize Your Apps And Accelerate Business Growth With AI
    • March 31, 2023
  • 4
    Why Your Open Source Project Needs A Content Strategy
    • March 31, 2023
  • 5
    From Raw Data To Actionable Insights: The Power Of Data Aggregation
    • March 30, 2023
  • 6
    Effective Strategies To Closing The Data-Value Gap
    • March 30, 2023
  • 7
    Unlocking The Secrets Of ChatGPT: Tips And Tricks For Optimizing Your AI Prompts
    • March 29, 2023
  • 8
    Try Bard And Share Your Feedback
    • March 29, 2023
  • 9
    Google Data Cloud & AI Summit : In Less Than 12 Hours From Now
    • March 29, 2023
  • 10
    Talking Cars: The Role Of Conversational AI In Shaping The Future Of Automobiles
    • March 28, 2023

about
About
Hello World!

We are liwaiwai.com. Created by programmers for programmers.

Our site aims to provide materials, guides, programming how-tos, and resources relating to artificial intelligence, machine learning and the likes.

We would like to hear from you.

If you have any questions, enquiries or would like to sponsor content, kindly reach out to us at:

[email protected]

Live long & prosper!
Most Popular
  • 1
    Introducing GPT-4 in Azure OpenAI Service
    • March 21, 2023
  • 2
    Document AI Introduces Powerful New Custom Document Classifier To Automate Document Processing
    • March 28, 2023
  • 3
    How AI Can Improve Digital Security
    • March 27, 2023
  • 4
    ChatGPT 4.0 Finally Gets A Joke
    • March 27, 2023
  • 5
    Mr. Cooper Is Improving The Home-buyer Experience With AI And ML
    • March 24, 2023
  • /
  • Artificial Intelligence
  • Machine Learning
  • Robotics
  • Engineering
  • About

Input your search keywords and press Enter.