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
4 votes
3 answers
5k views

How to Fit Piece-Wise Exponential Model in r?

I am experimenting Piece-Wise Exponential Model for survival data. What is the best way to fit the model? Is there an existing package?
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 ...
1 vote
1 answer
63 views

How can Null model likelihood be higher than Fitted model likelihood

As far as I know, when fitting a GLM, the fitted model should always have a higher likelihood compared to the null model (with only an intercept) for the same training set. When I run a small ...
3 votes
1 answer
38 views

What to do when the residuals of a general LMM are non normal and a generlized LMM will not build, when is it just too non-normal?

I've been having no luck building a general LMM. The residuals are not normally distributed, they follow somewhat of a leptokurtic distribution and homoskedacity is also present. Using log ...
0 votes
0 answers
21 views

Signs for marginal effects and regression coefficients are inconsistent for beta regression

I have conducted a zero-one inflated beta (ZOIB) regression using a logit link function for explaining tenure incidence in colleges and universities. Tenure incidence is a proportion in the interval [...
2 votes
1 answer
55 views

Distribution of a conical combination of n poisson variables?

Does a conical combination of n Poisson distributed variables have a closed-form distribution (linear combination with nonnegative coefficients)? I know that the sum of random Poisson variables would ...
130 votes
4 answers
130k 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 ...
0 votes
0 answers
51 views

Why does weights argument in glm change the outcome of lsd?

I have dataframe df. ...
0 votes
0 answers
5 views

link log and identity in GLMER

Say that we have a GLM model with the following formula: outcome = b1x1 + b2x2 + b0 and outcome is cost, x1, x2 are independent variables Fitted using log link with gaussian distribution, so log ...
0 votes
1 answer
25 views

GLM vs Kruskal-Wallis/ANOVA?

I am trying to analyse some data in R that has one continuous dependent variable (x) and two categorical variables (sex: M/F, surface: D/V). My main goal is to understand if sex and surface affect 'x'....
0 votes
0 answers
29 views

GLM or GLMM design for different tasks

I am conducting a study involving 70 participants diagnosed with Mild Cognitive Impairment (MCI) and 75 without MCI. All participants were engaged in taxonomic semantic, thematic semantic, and ...
2 votes
1 answer
336 views

What does the dispersion parameter means in negative binomial regression?

I am completely new to the topic of negative binomial regression and am unsure about what the output of my regression exactly means. Before I decided to use the negative binomial regression, i did ...
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. ...
2 votes
0 answers
87 views

How can we justfify the assumption of equal scale/variance in the definition of R-squared from Deviances in GLMs?

If we take the R-squared to be the comparison of Deviances between models (the model of interest, the saturated model, and the constant model), we can write it as (see this answer CC BY-SA 4.0): $$R_{...
0 votes
1 answer
1k views

GLM with Gamma distribution: Choosing between two link functions

I need to perform a GLM based analysis on a purely positive, continuous, and highliy right skewed (inflated around low values) outcome variable. I tested several combinations of distributions and link ...
4 votes
1 answer
92 views

Is it appropriate to present predicted probabilities from emmeans for a mixed-effects binomial logistic regression?

I am trying to understand how to analyze data for a generalized mixed model (GLMM) with a binary response. I am interested in visualizing the predicted probabilities, as well as a measure of effect ...
1 vote
0 answers
48 views

Issue of multicollinearity in R for glm analysis

I was wondering if someone could help me with a statistical problem I have run into. Any help would be incredibly helpful. Please note that for clarity, I have simplified the below description. It ...
3 votes
1 answer
3k views

Is the canonical parameter (and therefore the canonical link function) for a Gamma not unique?

Consider $Y_1, \dots, Y_n$ independent from the Gamma distribution. For $y > 0$: $$\begin{align} f(y \mid \alpha, \beta) &= \dfrac{1}{\beta^{\alpha}\Gamma(\alpha)}y^{\alpha-1}e^{-y/\beta} \\ &...
15 votes
3 answers
7k views

Do test scores really follow a normal distribution?

I've been trying to learn which distributions to use in GLMs, and I'm a little fuzzled on when to use the normal distribution. In one part of my textbook, it says that a normal distribution could be ...
0 votes
0 answers
23 views

Drop Level for Categorical Variables in GLM [closed]

I am running a regression with some numerical and some categorical variables. This issue that I am encountering is that 2 levels of categorical variables are perfectly correlated. For example, let's ...
1 vote
0 answers
32 views

Model test sensitivity to ability

I have a set of tests and a population of agents whose ability I want to assess. Each agent has taken some of the tests. The agents have no memory of the tests they have taken, so each time an agent ...
0 votes
0 answers
43 views

How does the formula of a negative binomial regression model look like? [closed]

For a term paper I use a zero-inflated negative binomial regression. I would like to viszualize the formula in my method section. Lets say I model the zero component based on variables v1 and v2, ...
1 vote
1 answer
247 views

Should I use ordered factor in glm model in R?

I want to fit a generalized linear model (logistic regression) to Titanic dataset. In EDA stage I transformed a variable (Pclass) to ordered factor. Before passing ...
2 votes
1 answer
91 views

What type of regression to use when outcome is integers from 0 to 10

I have an outcome variable that measures "community perception," with responses ranging from $0$ to $10$. For instance, the outcome variable might represent answers to the question: "In ...
1 vote
2 answers
2k views

Interpreting output from lmer

This probably has been asked many a times, but I cannot find the answer. I'm trying to interpret the output that I get from lmer. My code is as follows: ...
1 vote
1 answer
2k views

Effect Size interpretation for GLM (Logit)

I am using the following code from effectsize package in R: ...
1 vote
1 answer
3k views

Interpreting results from Generalized Linear Model, gamma family, log-link

I have a small number of observation point, and the data is continuous and very skewed. I decided to analyze the data with Generalized Linear Model, gamma family, log-link. I'm having hard time ...
3 votes
4 answers
10k views

how to calculate R-squared in glm? [closed]

I came up with below for my glm analysis but I need to calculate R-squared to cite in the paper? anyone can help me with this please? summary(lrfit) Call: ...
25 votes
5 answers
55k views

How to specify a lognormal distribution in the glm family argument in R?

Simple question: How to specify a lognormal distribution in the GLM family argument in R? I could not find how this can be achieved. Why is lognormal (or exponential) not an option in the family ...
4 votes
1 answer
292 views

In SAS, does the using the GLM statement ABSORB invalidate the standard errors of the parameter estimates?

SAS provides a handy tool for handling panel models with a large number of groups by 'absorbing' those groups (PROC GLM; ABSORB). My understanding is that it factors the effect of the absorbed ...
4 votes
1 answer
79 views

How to structure repeated measures in GLM based on my study design? Nested or not nested

So I'm having some trouble deciding how to format the repeated measures in my model. Basically deciding between: ...
1 vote
1 answer
252 views

How to treat proportions with different sample sizes as response variable in GLM / GLMM?

For an ecological research project, I am trying to model the effect of different factors on the prevalence of a specific pathogen in ticks. Ticks were collected from around 80 different plots and ...
2 votes
1 answer
42 views

Appropriate way to configure contrasts and interactions in GLM likelihood ratio test

I have a pretty large experiment where we are looking for differences in gene expression in RNA sequencing experiments. We are using EdgeR's GLM functionality, and then using contrasts to look for ...
2 votes
1 answer
66 views

Prove that the Deviance and the Generalised Pearson Statistic are asymptotically equivalent

I am reading the paper Exponential Dispersion Models from Jørgesen and at page $137$ I have encountered a claim that I don't know how to prove. The author claims that the Generalised Pearson Statistic,...
0 votes
1 answer
251 views

Meaning of residual vs. predicted quantile plots in DHARMa?

I am fairly new to statistics and R and I need a bit of help to understand the results of my GLM. I am using bee species richness as the response variable and plant species richness as the predictor ...
0 votes
0 answers
25 views

Before-after intervention variation: difference in-difference or broken-stick regression?

I am trying to figure out which analysis would best answer our research question. Our study aimed to find out whether the variation in surgical rate decreases in a group of hospitals after an ...
0 votes
1 answer
727 views

Calculating Mediation Indirect Effects using GSEM in Stata or R for Count (Discrete) Mediators

Estimating the following model in Stata helped me get the direct effects. This is a set of three models, a beta regression with the final outcome as the dependent variable, and two mediating negative ...
4 votes
1 answer
316 views

How to interpret the output of a Generalized Linear Model with R lmer

I am having trouble understanding the output of a GLM I am trying to run with R package lme4. Here is an example of what I would like to achieve with some mock data:...
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),...
1 vote
2 answers
41 views

How to interpret the average rate of NB-GLM when offset is involved?

My question is on how to interpret the coefficients of a negative-binomial GLM that included an offset. My dataset is a clinical trial where patients got one of two treatments (A or B) and stayed in ...
1 vote
1 answer
301 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. ...
4 votes
1 answer
3k views

How to create a regression model object from intercept and coefficients values only (without the database) in R

I want to recreate a regression model based on what was given in a scientific paper. They gave intercept and coefficient terms. I know how to create regression models in R, but is this possible to ...
0 votes
0 answers
5 views

Simulating a dataset from model output when model includes multiple binary deviation-coded variables

I am trying to simulate data using parameters from a glmer() model output. The model, which comes from a published paper, is as follows: DV ~ 1 + group* sex *verb type + trial number + (1 |participant)...
2 votes
1 answer
41 views

Pseudo $R^2$ for probit model: In-sample or out-of-sample?

I have a dataset test_data that measures mortality in response to dosage of a pesticide. I used a probit model that evaluates the efficacy of a single pesticide. ...
0 votes
0 answers
20 views

How to handle explanatory variables with meaningful missing/NA values in logistic regression [duplicate]

I am wanting to fit a logistic regression where some explanatory variables have null values. The nulls are meaningful - for instance, a continuous explanatory variable capturing 'time since last ...
0 votes
0 answers
21 views

Why do the standardized beta values and CIs of a glm poisson regression model not differ from the unstandardized ones (using report function)?

For a specific research question i fitted a generalized linear mixed model using a poisson link function due to the characteristics of my data. For reporting purposes i used the report package and the ...
1 vote
0 answers
410 views

How to compute effect sizes of single predictor in a logistical regression?

I have a logistic regression, with a binary response, a continuous predictor, and a categorical one. Is there any way to calculate the effect size of each of those predictors, similar to partial eta-...
2 votes
1 answer
473 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
1 answer
1k views

Do we need a reference dummy variable for non-mutually exclusive groups?

I am trying to build a GLMM and have converted a group of factors to dummy variables. Many have multiple groups and I would like to test the interactions between them as well. Do I need a reference ...
2 votes
1 answer
1k views

Offset in Poisson GLM with log link function where I have values equal to zero

I am trying to build a GLM model (poisson family) using python statsmodels package on train data. The data I have contains categorical values as exogenous variables and numerical values for my target (...

1
2 3 4 5
91