Skip to main content

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,598 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
1 answer
340 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
  • 571
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
500 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,452
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,033
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
  • 482
7 votes
0 answers
324 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
417 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
839 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
715 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
  • 11k
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
118 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
  • 63.7k
6 votes
0 answers
121 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 ...
Matata's user avatar
  • 671
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
6 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
  • 521
5 votes
0 answers
142 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
0 answers
569 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
422 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
1 answer
199 views

Modelling % cover that do not add up to 100% : GLM distribution families

I have an experimental set-up that consists in studying the impact of diversity of plant mixtures on the development of invasive species. On each plot, we recorded the % cover of each species which ...
Guillaume A2'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
  • 18.2k
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
585 views

Why is the deviance $\chi^{2}_{n-p}$ distributed?

Consider a GLM with vector of parameters $\boldsymbol{\beta}$, the maximum likelihood estimates of the non-saturated model (no. of parameters = $p < n$) is $\boldsymbol{\hat{\beta}}$ and the ...
python_learner's user avatar
5 votes
0 answers
277 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,787
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
79 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,952
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
279 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
270 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,179
5 votes
0 answers
780 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
  • 614
5 votes
0 answers
3k 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
489 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.8k
5 votes
0 answers
699 views

What GLM family and link function for "proportion of time"?

A simple question to which I don't seem to find the answer anywhere. I have a response variable duration of time spent doing A of individuals tested for $\text{...
crazjo's user avatar
  • 848
5 votes
0 answers
776 views

Creating observed/expected ratio using logistic regression

I am using logistic regression to benchmark the performance of some students in different years. I created a scenario as below: ...
lokheart's user avatar
  • 3,299
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
408 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,624
4 votes
0 answers
315 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
1 answer
605 views

Perform linear regression after box plot. Is that possible?

I am currently investigating a dataset with a visible linear relationship between the considered variable (Look at the red dots in the figure). However, the linear regression results are not good due ...
Daniele Pinton's user avatar
4 votes
0 answers
229 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
286 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. $...
tunar's user avatar
  • 523
4 votes
0 answers
295 views

Distribution of OLS predictions

Suppose: $y = X\beta + \varepsilon$, with $\varepsilon \sim (0, \Omega) \Rightarrow y|X \sim (X \beta, \Omega)$ $\hat{\beta}_{ols} = (X'X)^{-1}X'Y = \beta +(X'X)^{-1}X'\varepsilon \sim (\beta, \Sigma)...
Albert Zevelev's user avatar
4 votes
0 answers
701 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
73 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
0 answers
146 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
  • 299

1
2 3 4 5
32