We may earn an affiliate commission when you visit our partners.
Course image
Udemy logo

Linear Regression, GLMs and GAMs with R

Geoffrey Hubona, Ph.D.

Linear Regression, GLMs and GAMs with R demonstrates how to use R to extend the basic assumptions and constraints of linear regression to specify, model, and interpret the results of generalized linear (GLMs) and generalized additive (GAMs) models. The course demonstrates the estimation of GLMs and GAMs by working through a series of practical examples from the book Generalized Additive Models: An Introduction with R by Simon N. Wood (Chapman & Hall/CRC Texts in Statistical Science, 2006). Linear statistical models have a univariate response modeled as a linear function of predictor variables and a zero mean random error term. The assumption of linearity is a critical (and limiting) characteristic. Generalized linear models (GLMs) relax this assumption of linearity. They permit the expected value of the response variable to be a smoothed (e.g. non-linear) monotonic function of the linear predictors. GLMs also relax the assumption that the response variable is normally distributed by allowing for many distributions (e.g. normal, poisson, binomial, log-linear, etc.). Generalized additive models (GAMs) are extensions of GLMs. GAMs allow for the estimation of regression coefficients that take the form of non-parametric smoothers. Nonparametric smoothers like lowess (locally weighted scatterplot smoothing) fit a smooth curve to data using localized subsets of the data. This course provides an overview of modeling GLMs and GAMs using R. GLMs, and especially GAMs, have evolved into standard statistical methodologies of considerable flexibility. The course addresses recent approaches to modeling, estimating and interpreting GAMs. The focus of the course is on modeling and interpreting GLMs and especially GAMs with R. Use of the freely available R software illustrates the practicalities of linear, generalized linear, and generalized additive models.

Enroll now

What's inside

Learning objectives

  • Understand the assumptions of ordinary least squares (ols) linear regression.
  • Specify, estimate and interpret linear (regression) models using r.
  • Understand how the assumptions of ols regression are modified (relaxed) in order to specify, estimate and interpret generalized linear models (glms).
  • Specify, estimate and interpret glms using r.
  • Understand the mechanics and limitations of specifying, estimating and interpreting generalized additive models (gams).

Syllabus

Students are introduced to the topics and focus of the course and will understand the basis of linear regression.
Introduction to Course
Preliminaries: Installing R, RStudio, R Commander, Course Materials and Exercise
Read more
Beginning Agenda (slides)

The term "linear" refers to the fact that we are fitting a line. The term model refers to the equation that summarizes the line that we fit. The term "linear model" is often taken as synonymous with linear regression model.

Assumptions of Linear Models (regression):

  1. The residuals are independent
  2. The residuals are normally distributed
  3. The residuals have a mean of 0 at all values of X
  4. The residuals have constant variance
Desirable Properties of Beta-hat (slides, part 3)
Example: Estimate Age of Universe (slides)
Example: Estimate Age of Universe Live in R (part 1)
Example: Estimate Age of Universe Live in R (part 2)
Example: Estimating Age of the Universe (part 3)
Finish Example and More Notes on Linear Modeling
Linear Modeling Exercises
Students learn how GLMs relax the assumptions of linear regressions and will understand how to estimate GLMs using R software.

In statistics, the generalized linear model (GLM) is a flexible generalization of ordinary linear regression that allows for response variables that have error distribution models other than a normal distribution. The GLM generalizes linear regression by allowing the linear model to be related to the response variable via a link function and by allowing the magnitude of the variance of each measurement to be a function of its predicted value.

Introduction to GLMs (slides, part 2)
Introduction to GLMs (slides, part 3)
Introduction to GLMs (slides, part 4)

Proportion data has values that fall between zero and one. Naturally, it would be nice to have the predicted values also fall between zero and one. One way to accomplish this is to use a generalized linear model (glm) with a logit link and the binomial family.

Example: Binomial (Proportion) Model with Heart Disease (part 2)
Example: Binomial (Proportion) Model with Heart Disease (part 3)
Example: Binomial (Proportion) Model with Heart Disease (part 4)
GLM Exercises
Students learn additional GLM estimating capabilities including poisson and log-linear models. Students learn what is, and how to deal with, overdispersion.
Current Agenda
Linear Regression Exercise Solutions (part 1)
Linear Regression Exercise Solutions (part 2)
GLM Exercise Solutions (part 3)

In statistics, Poisson regression is a form of regression analysis used to model count data and contingency tables. Poisson regression assumes the response variable Y has a Poisson distribution, and assumes the logarithm of its expected value can be modeled by a linear combination of unknown parameters. A Poisson regression model is sometimes known as a log-linear model, especially when used to model contingency tables.

Poisson regression models are generalized linear models with the logarithm as the (canonical) link function, and the Poisson distribution function as the assumed probability distribution of the response.

Example: Poisson Model with Count Data (part 2)
Example: Binary Response Variable (part 1)
Example: Binary Response Variable (part 2)
Exercise: GLM to GAM

Log-linear analysis is a technique used in statistics to examine the relationship between more than two categorical variables.

More on Deviance and Overdispersion (slides)
Students learn the detailed bases of generalized additive models (GAMs) as extensions of linear regression models.

In statistics, a generalized additive model (GAM) is a generalized linear model in which the linear predictor depends linearly on unknown smooth functions of some predictor variables, and interest focuses on inference about these smooth functions. GAMs were originally developed by Trevor Hastie and Robert Tibshirani to blend properties of generalized linear models with additive models.

What are GAMs? (Crawley, slides, part 2)
Demonstrate GAM Ozone Data (part 1)
Demonstrate GAM Ozone Data (part 2)
General Approaches for Fitting GAMs (slides)
What are GAMs? (Wood, slides, part 1)
Univariate Polynomial GAMs (Wood, slides, part 2)
Univariate Polynomial GAMs (Wood, slides, part 3)
GAMs as 4th Order Polynomials (slides, part 1)
GAMs as 4th Order Polynomials (slides, part 2)
GAMs as Regression Splines (slides)
Cubic Splines (slides, part 1)
Cubic Splines (slides, part 2)
Function to Establish Basis for Spline (slides)
Build-a-GAM (slides, part 1)
Build-a-GAM (slides, part 2)
Build-a-GAM (slides, part 3)
Build-a-GAM Demonstration in R Script
Build-a-GAM Cross Validation
Bivariate GAMs with 2 Explanatory Independent Variables (slides, part 1)
Bivariate GAMs with 2 Explanatory Independent Variables (slides, part 2)
Exercises
Students learn how to estimate and interpret the results of various GAM examples using R software.
Current Agenda (slides)
Cherry Trees and Finer Control (slides, part 1)
Finer Control of GAM (slides, part 2)
Using Smoothers with More than One Predictor (slides)
More on Alternative Smoothing Bases (slides)
Parametric Model Terms (slides)
Example: Brain Imaging (part 1)
Example: Brain Imaging (part 2)
Example: Brain Imaging (part 3)
Example: Brain Imaging (part 4)
Example: Brain Imaging (part 5)
Example: Air Pollution in Chicago (part 1)
Example: Air Pollution in Chicago (part 2)
Air Pollution in Chicago (part 3)
More Exercises

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Teaches the modeling of linear regression, generalized linear models (GLMs), and generalized additive models (GAMs)
Core audience for this course appears to be data scientists and researchers who need to perform linear regression, GLMs, and GAMs in their work
Covers a range of topics, including the estimation of GLMs and GAMs, overdispersion, and the use of smoothers with more than one predictor
Taught by Geoffrey Hubona, Ph.D., who is recognized for his work in statistics
Utilizes the 'R' programming language
Provides practical examples and exercises to reinforce learning

Save this course

Save Linear Regression, GLMs and GAMs with R to your list so you can find it easily later:
Save

Activities

Coming soon We're preparing activities for Linear Regression, GLMs and GAMs with R. These are activities you can do either before, during, or after a course.

Career center

Learners who complete Linear Regression, GLMs and GAMs with R will develop knowledge and skills that may be useful to these careers:
Statistician
Statisticians collect, analyze, interpret, and present data to help businesses and organizations make informed decisions. This course provides a strong foundation in statistical modeling and analysis.
Data Analyst
Data analysts use data to solve business problems. They collect, clean, and analyze data to identify trends and patterns. This course provides the skills necessary to effectively analyze data and make informed decisions.
Actuary
Actuaries use mathematical and statistical models to assess risk and uncertainty. This course provides the skills necessary to build and analyze models that accurately predict future events.
Quantitative Analyst
Quantitative analysts are responsible for using mathematical and statistical models to identify investment opportunities and manage risk. This course provides the foundation in statistical modeling that is essential for success in this role.
Research Analyst
Research analysts conduct research and provide insights on companies, industries, and markets. This course provides the skills necessary to analyze data and draw informed conclusions.
Marketing Analyst
Marketing analysts use data to understand consumer behavior and develop marketing campaigns. This course provides the skills necessary to analyze data and make informed marketing decisions.
Risk Analyst
Risk analysts assess the risks facing businesses and organizations. This course provides the skills necessary to identify, analyze, and mitigate risks.
Financial Analyst
Financial analysts use financial data to make investment recommendations. This course provides the skills necessary to analyze financial data and make informed decisions.
Machine Learning Engineer
Machine learning engineers build and maintain machine learning models. This course provides the skills necessary to develop and deploy machine learning models that solve real-world problems.
Business Analyst
Business analysts use data to identify opportunities and solve problems for businesses. This course provides the skills necessary to analyze data and make informed recommendations.
Operations Research Analyst
Operations research analysts use mathematical and statistical models to improve the efficiency and effectiveness of organizations. This course provides the skills necessary to build and analyze models that optimize decision-making.
Data Scientist
Data scientists use data to solve complex business problems. This course provides the skills necessary to clean, analyze, and interpret data to make informed decisions.
Data Engineer
Data engineers build and maintain data pipelines. This course provides the skills necessary to build and maintain data pipelines that deliver data to data analysts and scientists.
Product Manager
Product managers are responsible for the development and launch of new products. This course provides the skills necessary to analyze market data and make informed decisions about product development.
Software Engineer
Software engineers design, develop, and maintain software applications. This course provides the skills necessary to build and maintain software applications that use statistical models.

Reading list

We've selected 12 books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Linear Regression, GLMs and GAMs with R.
Provides a comprehensive introduction to generalized linear models (GLMs), including both theory and practical examples using the R statistical software. It is an excellent reference for understanding the concepts and applications of GLMs.
Provides a comprehensive introduction to linear regression, including both theory and practical examples. It is an excellent reference for understanding the concepts and applications of linear regression.
Provides a broad overview of statistical learning methods, including linear regression, GLMs, and GAMs. It useful reference for understanding the applications of statistical learning methods in various fields.
Provides a comprehensive introduction to statistical learning methods, including linear regression, GLMs, and GAMs. It useful reference for understanding the theoretical foundations of statistical learning methods.
Provides a comprehensive introduction to statistical methods using the S-PLUS statistical software. It includes coverage of linear regression, GLMs, and GAMs.
Provides a broad overview of statistical methods used in the social sciences, including linear regression, GLMs, and GAMs. It useful reference for understanding the applications of statistical methods in the social sciences.
Provides a non-technical introduction to regression analysis, including linear regression, GLMs, and GAMs. It useful reference for understanding the concepts and applications of regression analysis.
Provides a comprehensive introduction to multivariate analysis of variance, including linear regression, GLMs, and GAMs. It useful reference for understanding the concepts and applications of multivariate analysis of variance.
Provides a comprehensive introduction to regression analysis, including linear regression, GLMs, and GAMs. It useful reference for understanding the concepts and applications of regression analysis.
Provides a comprehensive introduction to generalized linear mixed models, which are an extension of GLMs. It useful reference for understanding the concepts and applications of generalized linear mixed models.
Provides a comprehensive introduction to nonparametric statistical methods, which are an alternative to parametric statistical methods such as linear regression, GLMs, and GAMs. It useful reference for understanding the concepts and applications of nonparametric statistical methods.
Provides a comprehensive introduction to statistical inference, which is the process of making inferences about a population based on a sample. It useful reference for understanding the theoretical foundations of statistical inference.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Linear Regression, GLMs and GAMs with R.
Comprehensive Linear Modeling with R
Most relevant
Statistical Learning with R
Most relevant
Variable Selection, Model Validation, Nonlinear Regression
Most relevant
Generalized Linear Models and Nonparametric Regression
Most relevant
Statistical Learning with Python
Most relevant
Advanced Statistical Inference and Modelling Using R
Most relevant
Building Statistical Models in R: Linear Regression
Most relevant
Fitting Statistical Models to Data with Python
Most relevant
Advanced Linear Models for Data Science 2: Statistical...
Most relevant
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser