Questions tagged [generalized-linear-model]

A generalization of linear regression allowing for nonlinear relationships via a "link function" and for the variance of the response to depend on the predicted value. (Not to be confused with "general linear model" which extends the ordinary linear model to general covariance structure and multivariate response.)

1,611 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11 votes
1 answer
328 views

Correlation between two binary variables within one categorical variable

The Problem: I have measured two binary variables within 1 categorical variable with 5 levels. Initially, I thought I'd be able to use Fisher's Exact test or some $N \times M \times K$ version of it. ...
baffled's user avatar
  • 561
10 votes
0 answers
2k views

"weight" input in glm.nb function in R. How exactly does the weight affect the likelihood?

I would like to understand how the weight argument of glm.nb is affecting the likelihood function. I understand that glm.nb find ...
FairyOnIce's user avatar
9 votes
0 answers
494 views

How do sufficiency statistics help in the interpretation of regression results?

One of the results why canonical link functions are widely used in GLMs is the existence of sufficiency statistics for the regression parameters, which in turn allow for: ... minimal sufficient ...
Alex's user avatar
  • 4,100
9 votes
0 answers
6k views

Getting the bootstrap-validated AUC in R

In a paper by Faraklas et al, the researchers create a Necrotizing Soft-Tissue Infection Mortality Risk Calculator. They use logistic regression to create a model with mortality from necrotizing soft-...
oort's user avatar
  • 1,023
8 votes
0 answers
1k views

Alternatives to Cohen's d for non-Gaussian models

Cohen's d (or Hedges' g) are often used to compute effect size. They rely on the assumption of homogeneity of variance across samples however. Because of the pooling of variance that they do, I'm also ...
Jehol's user avatar
  • 472
7 votes
0 answers
312 views

Nonnegative identity-link Poisson regression with ridge or fused ridge penalty

I would like to fit nonnegative identity-link Poisson regression models with a ridge or fused ridge penalty, i.e. with nonnegativity constraints on the fitted coefficients, Poisson error noise & a ...
Tom Wenseleers's user avatar
7 votes
0 answers
389 views

Robust Gamma Regression

I am modeling some spectroscopic data where the response of the instrument to the size of the input is strictly positive and non-linear. Gamma regression seems like a good choice to explain the data, ...
udushu's user avatar
  • 223
7 votes
0 answers
794 views

Time series models (e.g. ARMA) a type or extension of GLM? Particular/stipulated forms of dependence in time series models

I am trying to understand the relationship between ARMA Time Series models and the GLM (Generalized Linear Model) family of models. As far I know, all GLMs have the following 3 components: 1) random ...
ColorStatistics's user avatar
7 votes
1 answer
677 views

Adding a magnitude penalty to a GAM

This is a follow-up to a previous question of mine, explaining the problem in more detail in the hopes of getting more precise advice. Consider the following structured additive regression model or ...
Paul's user avatar
  • 10.8k
7 votes
0 answers
2k views

How to compare models with different distributional assumptions for response variable in GLM?

Let's say I have measurements $Y$ which are all positive, and the distribution seems to be somewhat skewed. I'm modelling $Y$ in GLM framework. Now I could set my GLM using different distributional ...
Jouni's user avatar
  • 136
7 votes
1 answer
2k views

Geometric Interpretation of Softmax Regression

I'm writing a series of blog posts on the basics of machine learning, just for fun, mostly to validate my understanding of Andrew Ng's class. As I'm currently studying generalized linear models (GLMs),...
cjauvin's user avatar
  • 613
7 votes
0 answers
117 views

Zero values and discontinuity in explanatory variable

One of my independent variables measures worker productivity through the variable $\frac{\log{sales}}{\text{# of workers}}$, and I'm creating one variable for skilled and another for unskilled workers....
user62117's user avatar
  • 104
7 votes
0 answers
2k views

Analysis of survival data using binomial GLM with offset

We are interested in determining whether there's an association between frequency of screening visits and cancer outcomes and whether that differs by race. We have Medicare data to analyze this. ...
AdamO's user avatar
  • 60.5k
6 votes
0 answers
113 views

using `lmer` to fit the linear mixed effects models

Edit: I know some people vote this question is off-topic since it is more like a Cross Validated question. However, I am not here to ask about the coding thing (but I might word in the wrong way). I ...
Nan's user avatar
  • 609
6 votes
0 answers
1k views

Standard error of the coefficient in GLM

I'm trying to learn about Wald test. I know, that its test statistics is $$ t = \frac{\beta_i}{se\left( \beta_i \right)} $$ But, how is standard error $se$ computed in GLM? I've found only the ...
Eenoku's user avatar
  • 483
5 votes
0 answers
116 views

Question concerning svydesign and svyglm in R

I have a complicated data set which was made by a multistage stratified cluster design. I had originally analysed this using glm, however now realise that I have to use svyglm. I'm not quite sure ...
Ian Holdroyd's user avatar
5 votes
2 answers
707 views

How to calculate the degrees of freedom for L1 and L2 regularised GLMs?

My goal is to calculate various information criteria for generalised linear models (e.g., the AIC). To do this, we need to calculate the effective degrees of freedom of the trained model. In an ...
nick's user avatar
  • 151
5 votes
0 answers
502 views

Autocorrelation in Poisson model's residuals - Is my model not specified correctly?

I am fitting a poisson regression model in R to count time series data to perform an Interrupted Time Series Analysis, the aim of my analysis is to see if an intervention affected the counts. I am ...
Undergraduate413's user avatar
5 votes
0 answers
414 views

IRLS for truncated normal GLM

I have data for which responses fall in $y \in [0,\infty)$ for which, it seems, the standard GLMs based on, say, gamma or inverse-Gaussian fail since they don't allow responses with values equal to 0. ...
Confounded's user avatar
5 votes
0 answers
187 views

Which approach can be used to regress sleep time on brain mass, in this data set?

I was reading this blog post: https://htmlpreview.github.io/?https://raw.githubusercontent.com/avehtari/BDA_R_demos/master/demos_rstan/sleep.html the author describes a model to predict how many ...
DeltaIV's user avatar
  • 17.4k
5 votes
0 answers
67 views

Why is the $\chi^{2}$ approximation for deviance GLM $\sim \operatorname{Binomial}(n_{i},\pi_{i})$ not valid when $n_{i} = 1$?

I know from McCullagh & Nelder's text (p.118) that the $\chi^{2}$ approximation for deviance for the binomial family is based on a limiting operation in which $n$, the number of observations, is ...
python_learner's user avatar
5 votes
0 answers
245 views

Bradley-Terry model for unequal team comparisons

I'm trying to predict the outcome of a sports match between two teams. I have data on wins and losses for all teams in the league. I intend to use a Bradley-Terry model to find the relative rankings ...
ilanman's user avatar
  • 4,697
5 votes
1 answer
2k views

What's the relation between Canonical Correlation Analysis (CCA) and Regression?

I'm wondering if CCA is just a feature transformation method. Can I use it for predicting continuous variables like in regression methods? What I'm doing is to use CCA to transform my training and ...
Shudong's user avatar
  • 571
5 votes
0 answers
78 views

Is this degrees of freedom calculation from McCullagh and Nelder wrong?

This is a question regarding the Generalized Linear Models book of Mccullough and Nelder. It's available here. Starting on page 204 there is an example regarding shipping incidents; one of the ...
guy's user avatar
  • 8,692
5 votes
0 answers
2k views

Covariance matrix of multivariate multiple regression coefficients

I would like to perform a regression analysis on a dataset comprising one independent variable (X) and two dependent variables (Y1 and Y2) which may be affected by correlated errors. R's stats::lm ...
PVM's user avatar
  • 51
5 votes
0 answers
2k views

Spatial Autoregressive Poisson model in R

I am estimating a gravity model of migration on cross-sectional data. The Moran I statistic indicates a positive and significant spatial autocorrelation in the residuals of the non-spatial model, and ...
goclem's user avatar
  • 151
5 votes
0 answers
272 views

Dispersion parameters in GLM

I'm trying to find the motivation behind the extended form of the exponential family of distributions in the fundamental paper on GLM by Nelder and Wedderburn (Generalized Linear Models, J. R. Statist....
user2537291's user avatar
5 votes
0 answers
244 views

What is the mathematics behind the GAM prediction intervals?

From the R gam function available in the gam and mgcv package there is the option to obtain ...
Donbeo's user avatar
  • 3,129
5 votes
0 answers
721 views

How does GEE (Generalized Estimating Equation) treat different cluster size?

I have a population of 200,000+ patients and their hospital visit information. I'm trying to see if having a certain disease would have an effect on whether they will have readmission or not (this is ...
Ashley Zhou's user avatar
5 votes
0 answers
1k views

How can I evaluate spatial autocorrelation in a binomial GLMM?

Following Dormann et al 2007 Ecography, I have employed a GLMM approach in R to account for spatial autocorrelation in a binomial regression model (logistic regression) that does not have random terms....
tef2128's user avatar
  • 594
5 votes
0 answers
2k views

Paired test using GLM with Gamma distribution

I know, that a paired T-test can be formulated in the framework of a linear model for gaussian distributions. I have two vectors of paired mesurements (rates under certain conditions) that follow a ...
Chrelli's user avatar
  • 71
5 votes
0 answers
485 views

Why do my boostrapped CI's (using boot.ci in R) not include the point estimate?

I'm interested in estimating an average treatment effect $$ \operatorname{ATE}\left(A', A''\right) = \mathbb{E}\left( Y\ |\ A'' \right) - \mathbb{E}\left( Y\ |\ A' \right) $$ with a generalized ...
shadowtalker's user avatar
  • 12.1k
5 votes
1 answer
2k views

creating contrast matrix (limma) for two factorial in R

I am attempting to construct a contrast matrix that I can run in R, using the limma bioconductor package, but I am not sure that I have coded the contrast matrix correctly. A previous post and the ...
hesaguy's user avatar
  • 51
5 votes
0 answers
2k views

Segmented regression in R: interpreting the other coefficients

I am running segmented regression using the R package 'segmented'. The original binomial logistic regression has two coefficients, approach_km (continuous), and sea (dichotomous) that explain the ...
marcellt's user avatar
  • 511
5 votes
0 answers
405 views

Can I use weights generated by robust regression in a quasipoisson glm in R?

I have response variable count data that should be treated as quasipoisson or something similar. This data also contains outliers which are important to the dataset. I cannot find an r package that ...
Jennifer's user avatar
5 votes
0 answers
1k views

How to write a mathematical equation for GLM model with gamma and gaussian distribution?

I am writing a paper and the following is a code that I wrote in R. The reason that I am struggling with this is because I tried hundreds of models with different variables and the following model ...
Python_R's user avatar
  • 181
5 votes
0 answers
2k views

Examples of spatial generalized linear models

I've been reading some materials on Spatial data analysis, and I've a good background in GLMs. Right now I'm looking to find an example in spatial generalized linear models, but so far I've not found ...
user9292's user avatar
  • 1,604
4 votes
0 answers
287 views

Variance of a gamma distribution being proportional to its mean - a vacuously true statement?

I used to believe that the negative binomial distribution (for count data) and Gamma distribution (for continuous data) shared the property that the variance can take arbitrary values regardless of ...
Arnaud Mortier's user avatar
4 votes
0 answers
221 views

Why is my quasibinomial GLM estimator biased - Monte Carlo simulation

I'm playing with some Monte Carlo simulations to get an idea of the properties of some linear and non-linear models. The linear OLS model in my case is specified as: $Y_t = \beta_0 + \beta_1x+ \...
Beethoven_90's user avatar
4 votes
0 answers
2k views

How do I choose the correct power in a tweedie GLM?

I'm developing a GLM with a tweedie family distribution. How do I choose P correctly and how much does it matter? I know it has to be between 1 and 2, and when I try different values, I don't see an ...
Jordan 's user avatar
  • 235
4 votes
0 answers
256 views

Can we compare the effects of continuous covariate and categorical covariate on response variable in generalized linear regression?

I want to construct a linear model among several variables. The model is $y = \beta_0 + \beta_1 x + \beta_2 z + \varepsilon$, in which $x$ is a continuous variable, and $z$ is a dummy variable, i.e. $...
emberbillow's user avatar
4 votes
0 answers
604 views

Partitioning data into train and test sets in generalized linear mixed models

please excuse my probable lack of knowledge in machine learning - I am a vet trying hard to find my way around in this somewhat new world. The data I am analyzing was collected on 5 different farms, ...
ILo's user avatar
  • 41
4 votes
0 answers
71 views

Would this modification accelerate convergence of generalized linear model, or break it?

This page describes the following iteratively reweighted linear least-squares (IRLS) method for solving a generalized linear model (GLM): let $x_1=0$ for $j=1,2,...$ do linear ...
Museful's user avatar
  • 375
4 votes
1 answer
932 views

Can you use regression to predict values if you imputed data using MICE?

I used multiple imputation on a data set that had some missing values (I had to do this as the sample size was low so I couldn't just exclude the NAs). I know you can do ...
Ryan's user avatar
  • 413
4 votes
0 answers
136 views

GLM and saturated models: how do we justify the relation $\hat{\mu}_{i} = y_{i}$?

Given the saturated generalized linear model $g(\mu) = \eta = \textbf{X}\beta$, where the number of parameters equals the number of observations, why do we have $\hat{\mu}_{i} = y_{i}$? Let's us take ...
user avatar
4 votes
0 answers
2k views

R: lme4 vs. glmmTMB for binomial GLMM

I am fitting a GLMM to test if parasite prevalence in snails (positive snails divided by total snails) differs between different sites (site_type). Sites were ...
Joris's user avatar
  • 289
4 votes
0 answers
984 views

How do you stratify a Poisson regression in GLM?

I would like to obtain a stratified baseline hazard in a Poisson regression model. What is the correct way to do it ? Let A (=0/1) be the binary covariate on which I wish to stratify my baseline ...
Flora Grappelli's user avatar
4 votes
0 answers
4k views

Goodness-of-fit glm: Pearson's residuals or deviance residuals?

I want to evaluate the goodness-of-fit (or badness-of-fit) of a negative binomial glm. However, even here within CV, I've seen multiple different approaches for doing so. Some use the the residual ...
ltlf653's user avatar
  • 109
4 votes
1 answer
124 views

Canonical Location Parameter

What does "Canonical Location Parameter" mean? I'm looking for a general meaning of this term and then separately within the context of generalized linear models.z UPDATE Given how often this term ...
StatCurious's user avatar
4 votes
0 answers
151 views

binomial glm where number of trials is also a predictor

I am modeling the probability of success $p_i$ under a binomial framework. In fact I am actually modeling $x_i \sim Bin\left( n_i, p_i\right)$ being the number of trial varying along each observation. ...
Giorgio Spedicato's user avatar

1
2 3 4 5
33