Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
0answers
5 views

Does it make sense to compare Cooks distance between two models

If I have a greater amount of observations that high values of Cooks distances in one model than another does that suggest that the model is not as suitable? For example, here ...
0
votes
0answers
12 views

Modeling the mean with a more complicated model than a simple average

Marc Kery discusses modeling means as an alternative/can be synonymous to a simple average in his book: Kéry, M. (2010). Introduction to WinBUGS for ecologists: Bayesian approach to regression, ...
0
votes
0answers
4 views

Integral form of the deviance residual

Is there an integral form of the deviance residual? I've always seen the deviance residual written as $$ d_i = 2w_i\Big(y_i\big(\tilde{\theta}_i - \hat{\theta}_i\big) - \big(b(\tilde{\theta}_i) - b(\...
0
votes
0answers
4 views

Deviance (or log likelihood) on a new dataset using glm in R

I fit a generalized linear model using glm in R. I know R outputs deviance on the training set. Is there a way to compute the deviance or log likelihood on a test dataset?
1
vote
1answer
30 views

Defining fixed effect and random effect in a model

I'm unconfident that whether my understanding on fixed effect and random effect is correct: Fixed effect= variable that make inferences about the specific levels. Random effect= variable that make ...
0
votes
0answers
8 views

R GLMER Output - why isn't there information about the null model? [on hold]

With a glm() model there's information about the null deviance, which can be used to test whether the model significantly improves on the null. This isn't present ...
0
votes
2answers
37 views

Which test you recommend?

Assume in a study the dependent variable is quantitative, while most independent variables are categorical, with some of them being quantitative. We aim to evaluate the relationship between the ...
1
vote
1answer
35 views

maximum likelihood method for generalized mixed effects model

reference: http://www.stat.wisc.edu/~bates/UseR2008/WorkshopD.pdf from page 120. Now I want to fit a generalized logistic mixed model, where $\beta$ is fixed effect, $\theta$ is variance covariance ...
0
votes
0answers
13 views

Centering / standardizing leads to very different results for GLM (logistic, poisson, negative binomial distribution)

I have a dataset with count data and around 1 million observations. My regressions contain around 40 variables (binary and continuous) and 10 thousand fixed effects. I analyze this dataset with linear,...
3
votes
1answer
22 views

How to estimate confidence intervals for LC50

This is my first question, so I hope the question is properly done (my apologies if it's not...) I am using a binomial GLM model (logit) for some toxicology data investigating the effects of a ...
0
votes
0answers
16 views

random effect variance as pseudo-rsquared in GLMM

Suppose I have data on the abundance of a species across multiple sites that differ in some covariate of interest. Suppose that the logarithm of the abundance (logAbun) meets assumptions for linear ...
4
votes
1answer
37 views

Repeated Measures Linear mixed model notation

Not sure the right place to ask this question but struggling with specifying the correct notation and wording for my linear mixed model. Problem set up: I have a set number of biological replicates (...
0
votes
0answers
17 views

Poisson regression with continuous data

I have a time series of floating numbers, say, 0.1, 0.5, 1.1, 0.6, 2.0, 1.4, 0.4 Now, I would like to model this series with Poisson regression, since the numbers, even though they seem ...
0
votes
0answers
16 views

Finding the fitted probability for an aliased constraint in a binomial model?

For a binomial model, with probit link function: model = glm(response~A+B+C, family = binomial("probit"), na.action = na.omit) where A and B are continuous, C is ...
0
votes
0answers
19 views

How are these two power law fitting glm models different?

I have some data that I thought I'd try fitting with a power law (in R). ...
4
votes
1answer
51 views

Interpreting GLM with logged variable

For my logistic regression model I have: glm(reconv ~ -1 + log(precon) + log(age), data = crime, family=binomial) With the following co-efficients outputted from ...
0
votes
0answers
8 views

How to fit a Poisson-Tweedie model with power parameter fixed with mcglm

I'd like to fit a Poisson-Tweedie model with power parameter fixed (particularly, p=2). I`m using the following code, according to Case number 7 - Set of examples 1 - Univariate models - Author: ...
0
votes
2answers
30 views

R - Help interpreting GLM and ANOVA output

Am I correct in understanding that the effects of flood.level and plant.species are significant predictors of Inv.Simpson (my measure of diversity)? Is it also correct to say that the effect of ...
0
votes
1answer
17 views

Formula for deviance residuals for Poisson model with identity link function?

I understand the deviance residuals $r_D$ for a Poisson GLM with log link function are given by $r_D = \mu_{ij} \log(\mu_{ij}/\hat{\mu}_{ij}) + (\hat{\mu}_{ij} - \mu_{ij})$ I was wondering though ...
2
votes
1answer
51 views

How to choose “family” in Generalized Additive Model (GAM)

When modelling a GAM model using mgcv in R, we need to define the family = . I tried some families (e.g., Gaussian, Gamma), R ...
0
votes
0answers
11 views

How to calculate One Standard Error rule tuning parameter for prediction error during k-fold CV

I'm trying to wrap my head around exactly how this rule goes into place, so I can use it by hand in other model selection setups. So here's some R code to get it started: ...
1
vote
0answers
23 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 ...
1
vote
1answer
33 views

How to perform binomial logistic regression on this dataset? [closed]

I have a dataset that looks like this: ...
0
votes
1answer
17 views

Proportion/Rate data and zero-inflation (two counts)

I have an experimental dataset which makes use of two counts. Using vague terms, we are studying animals as they become behaviourally inactive and then apply a stimulus once an hour. One of the counts ...
0
votes
0answers
13 views

What is the logistic equation for a model with interaction [closed]

I have a GLM with four variables $Y = (X_1 + X_2) * (X_3 + X_4))$ $X_1$ = continuous variable $X_2$ = continuous variable $X_3$ = continuous variable $X_4$ = categorical variable (6 level = A, B,C,...
1
vote
0answers
10 views

Interpreting Pearson and Deviance residual graphs

Using a generalised linear model and predicted probabilities, I have been able to plot the Pearson residuals and Deviance residuals. I did this in order to have goodness of fit measures for the model. ...
0
votes
1answer
18 views

Adjusted Mean of Variable given Single Covariate with Weak/Moderate Relationship

Say I have two variables X and Y, each a data set with corresponding data points 1 through n. These two variables have some casual, small but significant relationship (low r value). Then I am unsure ...
0
votes
1answer
22 views

GLM: Logistic Regression Fitted Probabilities Numerically 0 or 1 occurred for non-linearly separable data

I have data that I don't believe is linearly separable. See below; X = 761, 700, 3488, 555, 2784, 1336, 380 Y = 0, 1, 1, 0, 1, 1, 0 My belief is that because of the first two observations I shouldn'...
1
vote
0answers
32 views

Beta estimates of logistic regression

I am trying to predict the likelihood of violent incidents as a function of time in hour in r. Its a binomial classification problem. ...
0
votes
0answers
14 views

Generalized Least Squares and Heteroskedasticity

I am trying to model a OLS where I know that the hetero-skedasticity is like this $E(\epsilon^2)$ = $\sigma_i^2$ = $\delta_0$ + $\delta_1*X_{i2}$ So, I was using the concept of feasible generalized ...
0
votes
0answers
29 views

What is the difference between ziformula=~1 or ziformula=~spp in glmmTMB? And which one fits my data better? [closed]

I am trying to fit a glmm model, and am not sure which ziformula to use if it all. My dataset is count data of wood inhabiting fungi, collected on pieces of deadwood within 40 forest stands that ...
0
votes
0answers
18 views

Why does removing the intercept in my categorical GLM result in the same model?

I'm trying to understand what is going on when I remove the intercept in my model using y ~ x + 0 Why do these models have the same predicted values despite one not having the intercept? ...
0
votes
1answer
26 views

In generalized mixed-effects model, after fixed effects and variance covariance matrix are fitted, how are empirical random effects calculated?

For example, I would like to fit a logistic mixed-effects model. This article fitting glmm talks about how to fit fixed effects as well as variance covariance matrix of random effects. Theoretically ...
0
votes
0answers
29 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 ...
1
vote
0answers
17 views

lambda value threshold beyond which shrinkage penalty in glm is high and coefficients approach zero

Conceptually, for both LASSO and ridge regression methods as lambda becomes "very large", the penalty impact grows and the coefficients approach zero. However, a) is there a particular threshold for ...
2
votes
2answers
84 views

Can the alpha, lambda values of a glmnet object output determine whether ridge or Lasso?

Given a glmnet object using train() where trControl method is "cv" and number of iterations is 5, I obtained that the bestTune alpha and lambda values are alpha=0.1 and lambda= 0.007688342. On ...
1
vote
1answer
25 views

Should I include offset in null negative binomial model for comparing to full model?

I'm modeling how various landscape and ecological factors affect the I'd like to evaluate how well my negative binomial model performs over the null. I've specified an offset variable in my model to ...
1
vote
0answers
41 views

Goodness of Fit test for Logistic Regression Model

Data have been collected for 176 students. The response variable is 'Choice of Career' having 2 categories namely 'Academic' and 'Non-academic'. I have taken two explanatory variables namely 'Gender'(...
7
votes
2answers
190 views

Logistic regression BIC: what's the right N?

TL;DR: Which $N$ is correct for BIC in logistic regression, the aggregated binomial or Bernoulli $N$? UPDATES AT BOTTOM Suppose I have a data set to which I'd like to apply logistic regression. For ...
1
vote
1answer
36 views

Loss function for generalized linear models

What is the loss function in the GLMs. We only deal with the mean posterior of response given input $E[Y|X]$, therefore I assume underneath we assume $L_2$ loss. Is that correct? What about other loss ...
1
vote
0answers
39 views

Poisson vs Gaussian GLM: which to use?

I'm going to provide a simulated case. However, the question is of a general nature (see end of the post). Let's suppose we have some data generated in this way: ...
1
vote
1answer
39 views

R: GLMM for unbalanced zero-inflated data (glmmTMB)

Study design: I have count data of snails per date, counted over many dates at sites, nested in localities. So, in each locality the snail counts come from several different sites, repeatedly ...
0
votes
0answers
8 views

GLM 3 factors, significant two way interaction. Pairwaise comparisons?

I used generalized linear models using 3 factors Each factor has 2 levels. My main effects are not significant, nor is the three way interaction But there is a significant interaction between factor ...
0
votes
0answers
14 views

Regression Non-Normal distribution [on hold]

I'm trying to make regression models for this sample data. And distribution is this: The net hourly electrical energy output (EP) is the response variable, ...
0
votes
1answer
48 views

Simulate data based on negative binomial regression coefficient

I'm trying to simulate a dataframe with columns x and y based on a real-world dataset. Fitting a negative binomial regression ...
0
votes
1answer
21 views

Offset term in negative binomial regression

I am fitting a simple negative binomial regression model with (Yearly cancer death ~ Offset (Size of population) + Age + Household income). I used the offset term because I want to compare the yearly ...
0
votes
0answers
16 views

LDA attribute similar to fitted values from glm

I am comparing the results of LDA vs logistic regression as an exercise in understanding their differences and similarities. When fitting a glm model ...
0
votes
0answers
12 views

1) Am i right in conducting an ANOVA 2) no p value because of lack of results

Im unsure whether I should conduct a two way ANOVA as GLM on minitab 17. Got seven mutant plants (with different knockout genes, including the wildtype and lines incase a knockout didnt occur). I'm ...
0
votes
0answers
27 views

Model failed to converge in lme4::glmer() when the a factor is centered or releveled

I'm running a mixed-effects model using glmer() function. The modeling works well with R's default dummy coding. But if I center or relevel a factor of 2 levels, the model failed to converge. I am ...
0
votes
0answers
35 views

Visualising Generalised linear models

I read about linear regression where we assume, the response is linear and the noise $\epsilon$, follows $N(0, \sigma^2)$ (Gaussian noise model), this leads us to conclude $E[Y|X] = b^*x$ and that the ...