Presentation is loading. Please wait.

Presentation is loading. Please wait.

Remembering way back: Generalized Linear Models Ordinary linear regression What if we want to model a response that is not Gaussian?? We may have experiments.

Similar presentations


Presentation on theme: "Remembering way back: Generalized Linear Models Ordinary linear regression What if we want to model a response that is not Gaussian?? We may have experiments."— Presentation transcript:

1 Remembering way back: Generalized Linear Models Ordinary linear regression What if we want to model a response that is not Gaussian?? We may have experiments with responses where:

2 Assume the a function of the mean response can be modeled as a linear function of (possibly transformed) explanatory variables: GLMs A function of the mean response: link function A linear function of explanatory variables Residual noise with some distribution depending on what kind of data the responses Y i, are

3 Depending on the response type, choose a different link function f, and noise distribution. By specification of regression family in R by default does: GLMs Response distributed asCanonical or commonly used link function family = ? Y i ~ Ber(p i )logit binomial Y i ~ Bin(n i, p i )logit binomial Y i ~ NegBin(n i, , p i ) logUse: glm.nb function in MASS Y i ~ Poi( i ) log poisson

4 Deviance between two models fit to data: GLM fitting is a little more tricky A measure of how “close” two models are Popular to use to measure “good-ness” of fit for GLMs One way to examine fit is to look at how deviance changes as explanatory variables, x i are added. Called “Analysis of Deviance” Use anova() function in R CAUTION: order the x i are added affect things!!!!!!

5 GLM fitting is a little more tricky # glass fragments recovered Specify error dist/link function Performs analysis of deviance (ANODE). Here, ANODE statistic for addition of a x i is equivalent to a LR test. Test significance with chi-square distribution. Deviance statistic for addition of x i Order of x i MATTERS!! P-values for addition of x i. Null hypothesis is that inclusion of x i does not significantly increase deviance from simplest model: y i =  0

6 GLM fitting is a little more tricky

7 GLM: Model Comparison Let’s go through this together Competing models Check the regression coefs Model Fit/Comparison Diagnostics

8 GLM: Model Comparison Let’s go through this together Competing models Parse the data into (random) training and test sets

9 GLM: Model Comparison Check the regression coefficients Model Fit/Comparison Diagnostics

10 GLM: Model Comparison Model Predictions Actual count Model 3 and 2 predicted mean counts


Download ppt "Remembering way back: Generalized Linear Models Ordinary linear regression What if we want to model a response that is not Gaussian?? We may have experiments."

Similar presentations


Ads by Google