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.)

Filter by
Sorted by
Tagged with
2 votes
0 answers
35 views
+50

Model has higher (and closer to 1) $\beta$, but similar $R^2$ and correlation

I have model one which produces prediction $\hat{y_1}$, later I came up with a new model which produces prediction $\hat{y_2}$. I have ground truth $y$. The models are not regression based but they ...
1 vote
1 answer
1k views

Steps to conduct ANCOVA between two groups that has 2 covariate?

Using R, I want to compare two groups (1 & 2), each group having two covariate. More specifically, i need to: Within each group, test for significant relationships between the dependent variable (...
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),...
0 votes
0 answers
19 views

Using the glm.nb() R package [closed]

I want to fit the negative binomial data using the glm.nb() function. For some reason, I already had the ground truth dispersion parameter of the negative binomial distribution, so I would only have ...
1 vote
0 answers
22 views

Is it necessary to transform the tide variable using a truncated Fourier series for GLM (Gamma), and how should I interpret interactions? [closed]

I’m using glm to see whether there is an association between zooplankton biomass (response) with two variables: 1) hours from high tide (high tide is zero, hours before are negative at one hourly ...
70 votes
1 answer
31k views

Why is the square root transformation recommended for count data?

It is often recommended to take the square root when you have count data. (For some examples on CV, see @HarveyMotulsky's answer here, or @whuber's answer here.) On the other hand, when fitting a ...
1 vote
1 answer
54 views

Compare effects in a small sample

I would like to analyse whether measures A, B, and C have a different influence on a measure D compared to a measure X on D. My exploratory hypothesis is that A, B, or C could influence Z negatively ...
1 vote
1 answer
403 views

Incorporate Weights/Offsets with Nonparametric Models

I am modeling pure premium in R. I have read that pure premiums are usually modeled using a Tweedie distribution (glm). There is generally an offset or weight added to the model, such as an exposure. ...
2 votes
1 answer
1k views

AIC of a two-part/hurdle model?

I have continuous data with a point mass at zero, so my plan is to use a two-part model where I first model whether an observation is zero or non-zero in a logistic regression and then model the ...
2 votes
1 answer
605 views

What is a GAM; question about sklearn's SplineTransformer

From my understanding, using basis-spline feature expansion/transformation with fixed parameters (number and placement of knots, etc.), then feeding that into a linear/logistic regression is ...
1 vote
2 answers
267 views

Regression model with (almost) non-negative residuals

I would like to fit a regression model with continuous response and predictors. A fraction of the response is a non-negative linear combination of several predictors. What is not covered by this ...
0 votes
1 answer
22 views

Intercept estimates VERY different comparing glm and glmm

Can anyone explain the following puzzling phenomenon? I'm fitting a binomial glmm using glmer from the lme4 package of R. The mean of the binary response variable in the dataset is about 0.1. When I ...
7 votes
2 answers
286 views

How much dispersion is too much for quasipoisson regression?

Quasipoisson regression goes beyond standard poisson regression in taking into account overdispersion (whereby the dependent variable's variance is much greater than its mean). This is explained at ...
1 vote
1 answer
347 views

Simulated data (with the outcome and predictors) from a GLM model

The goal of simulation is to produce a number of synthetic datasets, where the outcomes are a function of the known regression coefficients. I would like to know if my reasoning behind creating ...
1 vote
1 answer
35 views

Linear models to compare SNP categories between patients

I have 8 patients (GROUP: 3 healthy, 5 disease). For each patient, I determined single nucleotide polymorphisms (SNPs) and annotated the effect of the SNPs (EFFECT_CATEGORY). Each SNP (~3000 per ...
0 votes
0 answers
13 views

How to choose default uninformative prior in the R Package BAS

I'm conducting a Bayesian multilevel logistic regression based on the Rpackage BAS. I'm a beginner in Bayesian statistics. But in bas.glm, I don't understand and I don't know how to specify my prior. ...
3 votes
1 answer
41 views

Modelling spatial autocorrelation with GAMs

the topic of spatial autocorrelation (SA) within the context of generalized additive models has already been discussed in several posts within this forum, see e.g. Why does including latitude and ...
3 votes
1 answer
116 views

Validity of AIC When Comparing Models with Varying Dispersion Parameters

I'm currently making a binomial model with a logit link, which is parameterised as a quasibinomial since I'm allowing it to calculate the dispersion parameter. I was wondering, since changes to the ...
5 votes
3 answers
366 views

Why does my Poisson regression fail? I'm using the R command glm(), x and y are non-negative integers, I'm using a linear link

I'm trying to regress one set of hurricane numbers per year onto another, as a way to estimate the proportion of the hurricanes that hit the US, and the uncertainty around that proportion, all in the ...
0 votes
0 answers
31 views

Comparing Gaussian GLMM models for positive, slightly non-normal data: Interpreting conflicting model selection criteria

I'm analyzing data using glmmTMB in R with the following model structure: ...
0 votes
0 answers
31 views

How to interpret my GLM results [closed]

I'm running a GLM to see if there are any differences in % cover of fescue and native grasses along a bison use intensity gradient (Do we have more fescue or more native grasses where there are more ...
2 votes
1 answer
24 views

What is the best test to run to compare presence/absence of something between sampling locations?

I have data on the presence/absence of four different pathogens found in edible crabs in 7 locations over 2 seasons. For this study, 30 crabs were collected from each site and for each crab the ...
1 vote
1 answer
549 views

Retrieving standard deviation from glm and glmer

For my thesis I've conducted several GLM's and GLMM's. Now for my report I need standard deviation values, however the summary tables of my models only produce Std error values. ...
0 votes
0 answers
25 views

How to choose a feature as an offset in GLM Binary Regression

Is there any statistical test to determine that Feature A should be an offset instead of Feature B and Feature C. From what I understand, if in insurance modelling, usually, offset has a connection ...
3 votes
1 answer
616 views

Improving fit of underdispered beta regression model in glmmtmb

I have survey data where the outcome is the proportion of a research budget interviewees wished to assign to one of three different "types" of research into solutions for various issues. I ...
2 votes
1 answer
32 views

GLM for longitudinal or time-series -- how to model and interpret a binary logistic regression over time controlling for covariates using R

I work with the risk of delays (0 = no risk, 1 = risk). I want to run a binary logistic regression considering panel data over time. I have data from 4 years (4 time-points) and some covariates (...
0 votes
0 answers
8 views

Calculate HC3 robust vcov matrix when knowing only of Gradient and Hessian matrices of a GLM model

Suppose that a Generalized Linear Model is fitted using Maximum-Likelihood Estimation, but we only have access to two results from it: the gradient matrix $G$ is a $n \times p$ matrix where each row $...
10 votes
5 answers
1k views

Why GLM don't have an error term and why shouldn't residuals be i.i.d?

I've read dozens on post on the subject but I cannot figure this out. From what I've gathered, GLMS don't include an error term in their formulation unlike linear models (LM). I was wondering why (or ...
0 votes
1 answer
540 views

How to deal with an aliased predictor in a generalized linear model?

https://www.dropbox.com/sh/vc6yv2mqfm2xots/AAAc-yCyrUR9QBnohNjttFxVa?dl=0 Using the attached data, I am working on the effects of poverty on farmers' adaptive capacities (N=1211). Multivariate ...
3 votes
1 answer
81 views

Application of robust Poisson regression

I am applying a Poisson regression with robust standard errors to model a binary response variables. I was wondering what are the assumptions underlying this type of regression? Does robust Poisson ...
1 vote
1 answer
28 views

Lagged Dependent Variable in Bayesian Linear Regression

I'm constructing a Bayesian General Linear model to try to model the number of customers a business has. Essentially Market Mix Modelling. I believe the number of customers to be explained by the ...
1 vote
1 answer
421 views

Help with modeling GRBDs experimental design analysis (Generalized randomized block design)

I am struggling with the formulation in lme of a generalized randomized block design (GRBD's) with subsampling. The experiment consists of 2 treatments: Genetic ...
3 votes
1 answer
41 views

How to analyze this data in R, where there is no clear distinction of the response variable and the predictor variable? [closed]

Is there a statistician out there who knows how to analyze psychology surveys? Due to the way my response variable is structured in my data frame, I'm struggling to analyze it in R. Please, I ...
6 votes
1 answer
276 views

How to simulate data for a Gamma glm?

I am wondering about whether there might actually be different ways to simulate data for say a Gamma GLM, which in turn relates to what might be the parametrization that the ...
3 votes
2 answers
244 views

Inconsistency in statistics: parameters estimation with heteroskedasticity

I want to estimate this model $$ y_t = a + b x_t + \sigma x_t\epsilon_t $$ where we have an error with heteroskedasticity (it depends on $x_t$). Suppose I estimate this model with OLS so, assuming ...
0 votes
0 answers
49 views

Given that quasibinomial/quasipoisson reg models overdispersion, why ever use normal bin/poiss regression if quasi is more flexible?

In reading about quasibinomial regression: The quasi-binomial distribution, while similar to the binomial distribution, has an extra parameter 𝜙 (limited to |𝜙|≤min{𝑝/𝑛,(1−𝑝)/𝑛} ) that attempts ...
3 votes
1 answer
648 views

Interpret dispersion parameter in gamma GLM?

On p. 383, Fox writes that "[with a gamma GLM] the dispersion parameter is simply the inverse of the shape parameter." I am trying to understand for what distribution this applies to. ...
131 votes
4 answers
138k views

When to use gamma GLMs?

The gamma distribution can take on a pretty wide range of shapes, and given the link between the mean and the variance through its two parameters, it seems suited to dealing with heteroskedasticity in ...
1 vote
1 answer
390 views

Using a AIC or LRT for a GLM and LMM

I am trying to compare 2 models (a GLMER with a random effect and a GLM with the random effect removed). However, I was told you can't use an AIC for GLM's but I thought you could!?
1 vote
1 answer
387 views

Does my predictor in my multiple regression have too many variables?

So I am trying to work out what is the best predictor of a) awareness over environmental issues, b) concern over environmental issues and c) pro-environmental behaviour from a set of sociodemographics ...
0 votes
1 answer
768 views

Regression model with non-constant variance

I have a dataset to analysis and the following information is known: $y_i \sim N(\mu_i, \theta(\mu_i)^2)$ The link function is $\ln(\mu_i) = (\beta)^\top X$ $y_i$s are count data. The model parameter ...
0 votes
0 answers
35 views

GLMM for not so gaussian data

I am having an issue with GLMM and hope you could advice me. So basically I have data from microscopy experiment of three independent groups (variable: subfolder) nested within 4 experimental ...
1 vote
2 answers
1k views

Generalised linear models (for dummies)

I'm trying to get to grips with this topic, and it's proving tough. Could anyone point me in the direction of some good web based sources to read? I'm looking for good explanations of the theory and ...
4 votes
2 answers
2k views

How do I get a positive intercept using linear regression with logarithms?

I'm trying to change negative values to positive from my linear model. Here is my attempt: ...
1 vote
0 answers
20 views

Testing the difference between two Root Mean Square Error values for statistical significance [duplicate]

I would like to compare the predictive power of 2 models. The models are meant to model count data and respective probabilities. I am using two metrics as means of comparison: Root Mean Square Error ...
0 votes
1 answer
46 views

why does LASSO regression return unstandardized coefficients [closed]

I have more general questions that does not refer to a coding issue. Why does LASSO regression require standardization of the predictors but return unstandardized coefficients (glmnet function - https:...
26 votes
3 answers
3k views

Why do we make a big fuss about using Fisher scoring when we fit a GLM?

I'm curious about why we treat fitting GLMS as though they were some special optimization problem. Are they? It seems to me that they're just maximum likelihood, and that we write down the ...
1 vote
1 answer
226 views

Comparing average success rates of varying sample sizes

I have the following data frame: ...
0 votes
1 answer
38 views

How to approach GLMs using data with beta distribution in R?

I'm trying to run some models on bee presence with five predictor variables. A snippet of the data is attached, but essentially I measured floral abundance and richness, calculated floral evenness and ...
3 votes
2 answers
81 views

Didactic example of mean-variance dependency in linear models

I'd like to illustrate the importance of accounting for the dependency between mean and variance in inference with linear models. Is my example below a good one? Do you agree with my comments on it? ...

1
2 3 4 5
94