Stack Exchange Network

Stack Exchange network consists of 174 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
Make your voice heard. Take the 2019 Developer Survey now

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
3 views

Modelling percentage and proportion data with GLM's

I would like a simple answer, if there is one, to a question I cannot seem to find on here. What is the best way to model percentages? Say I have a glass that is empty and I fill it with liquid ...
0
votes
0answers
15 views

How to calculate effect sizes for generalized linear models?

In the famous article Halsey et al., 2015, the authors do a really good job criticizing the use of p-value. In their paper, they say that effect size estimates and their precision (95% CI) can be and ...
0
votes
0answers
15 views

Underlying Poisson Distribution in Cox Regression with censoring

My question stems from this post: Does Cox Regression have an underlying Poisson distribution? Cox regression with no censoring can be interpreted as Poisson regression. Can we interpret Cox ...
1
vote
0answers
29 views

Data exploration to determine if GAMs are appropriate [duplicate]

How to decide, based on data exploration and data visualisation, between a GAM and a GLM. Linear Models (LM) assume that the relationship between the response and the predictor are linear. ...
0
votes
1answer
27 views

How can I make simulated logistic regression model more noisy?

When I want to simulate Y coming from the linear regression model, $$Y_i = X_i ^T \beta + \epsilon_i,$$ I can use code like: ...
0
votes
0answers
22 views

Why is it so hard to find straightforward explanations for the use of GLMs and MEM? [closed]

We all know that for tests like ANOVA, T test, Wilcoxon, Kruskal-Wallis it is easy to state the conditions unto which we would be able to apply them. Examples: ANOVA: several groups, one variable, ...
0
votes
1answer
26 views

A priori contrast for binomial GLM

after much reading I decided to write because I cannot find a solution to my question. I already did a priori contrasts before for a continuous variable with normal distribution. Now I have another ...
1
vote
0answers
13 views

How do we perform residual analysis on binomial model with small counts?

I know that both Pearson and Deviance residuals tend to be approximately normal for Poisson and Binomial model with large counts when standardized, so we can exploit that to perform the residual ...
0
votes
0answers
25 views

Evaluating goodness of fit for Bernoulli glm

I am trying to fit a model estimating the success probability of the Bernoulli distributed random variable with the logistic link function. However, I am stuck with testing the goodness of fit of my ...
0
votes
0answers
22 views

How to deal with auto-correlation in generalized linear modelling?

I've built a generalized linear model by using glm.nb function (my response is a count type of data) using a single predictor. The model summary is given below. <...
0
votes
0answers
22 views

Generalized linear (mixed?) model with imbalanced nested data

I am unsure how to optimally model a data set obtained from a crude experiment to compare performance of two plastic molding tools used to manufacture widgets. Widgets are tested and results are ...
2
votes
0answers
9 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. ...
1
vote
1answer
31 views

How do you deal with “nested” variables in a regression model? in R

A conceptual solution for this scenario has been posted in: How do you deal with "nested" variables in a regression model? Problem is I am having trouble using this solution in R - glm() ...
1
vote
1answer
20 views

Is LDA just selecting the minimum Mahalanobis distance?

I have a question regarding Linear Discriminant Analysis (LDA). I know that LDA chooses the coefficients of a linear model, which maximize the separability of classes - that is the ratio of "between-...
0
votes
0answers
11 views

When binary predictor = 0, all other predictors = NA - what model structure do I need?

I have a genetics dataset which I want to build a model for. The dependent variable y is case or controls status (binary). The first independent variable x1 is whether or not they have a variant in ...
1
vote
1answer
22 views

RCT analysis using ANCOVA for rates

I have a question based on the following approach for the analysis of RCT's. The following works well for the outcome (and baseline) being continuous with normal errors. Expanding upon this, I was ...
0
votes
0answers
29 views

normality of independent variables [duplicate]

I am running a generalized linear model. The dependent variable is binomial and independent variables are categorical and continuous variables. My question is : 1. Does the continuous independent ...
0
votes
3answers
79 views

What are weights in a binary glm and how to calculate them?

I have a dataset that includes four variables. Three of them are factors and one is constant. My response variable contains (0,1) so my glm is about logistic regression. My question is, how do I know ...
0
votes
0answers
12 views

Quasipoisson model variable selection and find best model

I am running a Quasipoisson model in R with a lot of variables. This is my outcome: I want to find out which variables have an influence on the dormouse abundance (number of nests). After doing the ...
0
votes
0answers
17 views

Model fit for StMoMo

As a statistics newbie, I am trying to model mortality. I grabbed majority of the code from the package Vignette, and fitted the data. However, model fit does not seem to be great in my reproducible ...
3
votes
1answer
59 views

Do GEE and GLM estimate the same coefficients?

In a GLM, the likelihood equations depend on the assumed distribution only through the mean and the variance. The likelihood equations are $$\sum_i^n (\frac{\partial \mu_i}{\partial \eta_i}) \frac{...
3
votes
0answers
69 views

Is the use of loglik or AIC to compare logit/probit/cloglog models valid?

I would like to know whether I can use AIC, or if the models have the same number of predictors, the log-likelihood, to compare logit vs probit vs cloglog models (fitted for instance with glmer or ...
0
votes
0answers
7 views

Correlated Data in Model

i have the problem that i am doing a glm quasipoisson in R and some of my Data in the model correlate (0.564 e.g.). Is There a way to deal with this so that i dont get wrong Results? Thanks!
0
votes
1answer
24 views

Chi-square test with replicate nested

I have a question about how to analyse count data with replicates nested in each treatment. For example, imagine temperature can influence the sex ratio of mosquito larva emerged from eggs. I have two ...
0
votes
0answers
17 views

Kolmogorov–Smirnov test in logistic regression

When applying KS-test (as goodness-of-fit test) on logistic regression (class: 0,1), where x-axis = probability of being classified as class 1, sorting ascendingly. Here are the 2 questions: Why are ...
1
vote
1answer
28 views

Model Quasipoisson interpretation and validation

I am currently doing my Master thesis with evaluating my results in R. I am stuck on my analysis of my glm with quasipoisson. I am analysing influencing variables on the dormouse abundance in 2 types ...
-1
votes
0answers
15 views

R code GLM & confusion matrix [duplicate]

I am trying to do a GLM and I get a confusion matrix where not all the data is represented: ...
1
vote
1answer
64 views

glm returns NA as coefficient for logistic regression

I am fitting a logistic regression for the response variable- 0 or 1. There are 15 explanatory variables- 10 are continuous and 5 are categorical with 3 levels each. I checked collinearity among the ...
2
votes
0answers
86 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 ...
1
vote
2answers
41 views

Regarding glm.nb() and my parameter

I have been doing a negative binomial regression model using the following code My my estimate here comes out as 3.48. (the exponential of the intercept). The data was taken randomly (with set seed) ...
0
votes
0answers
15 views

caret chooses non-optimal RMSE?

I run a linear regression via caret / glmnet method with "RMSE" as metric. In the final model, caret tells me which values of the tuning parameters alpha and lambda were selected to minimize RMSE. If ...
1
vote
0answers
11 views

Efficiently producing Partial Residual Plots in R [migrated]

I have a large glm (4Gb in size) for which I would like to display the partial residual plots using crPlots(myGLM) Currently RStudio hangs on displaying the first plot. The machine I'm using is ...
0
votes
0answers
22 views

Get relative risk ratio and confidence interval from logistic regression

There are many examples on these forums of people calculating risk ratios from logistic regressions, but none of them seem to match my situation. I have two predictor variables - one continuous and ...
0
votes
1answer
50 views

Canonical link of Gamma Distribution [duplicate]

I wonder why my professor said that Gamma's canonical link is $\frac{1}{\mu}$. My thoughts are: EDIT: $\theta$ is the canonical parameter. Since $$\mathbb{E}_\theta(Y)=b^{'}(\theta)=-\frac{1}{\theta}...
2
votes
1answer
38 views

Covariance of Constrained Maximum Likelihood Estimators

I plan to numerically estimate the parameters of a GLM but with constraints imposed on some of the parameters. In this case, does the general approach of estimating the covariance matrix of my MLE ...
1
vote
1answer
57 views

In GLMs are the Scale and Dispersion parameters the same?

Given a data set and a genralized linear model I am asked to find the estimation of the scale parameter obtained with the Pearson statistic. But I am a bit confused: I know that ${\rm Var}(Y)=\phi\...
0
votes
0answers
49 views

R Repeated measures with fixed intercept at 0

I am trying to run a repeated measures glmm with a fixed intercept at 0 for a longitudinal study calculating the spread of a parasite within different genotypes of Daphnia hosts, and testing for a gxg ...
2
votes
1answer
52 views

Compare species count data between sites

I'm comparing species counts between areas. My data is very similar to the below. ...
0
votes
2answers
27 views

How to find cutoff point in Logistics Regression using R

I have run a Logistics Regression model in my data set. Below is the code: ...
0
votes
1answer
16 views

Generalized Estimation Equations 3 levels

I have a dataset where students are nested within classes, and classes are nested within schools. I am interested in evaluating the effects of a treatment delivered at the student level. The response ...
1
vote
2answers
46 views

What does the intercept mean in this GLM? Will it mean the same thing if I add more variables?

I have a GLM looking at death rate of characters based on gender: fit2 <- glm(Death~as.factor(Gender), data=data, family=binomial(link="logit")) This is my output: ...
0
votes
0answers
13 views

How can i interpret my residual deviance and degrees of freedom?

Ive made a binomial GLM in r and my resid. deviance and df are rather high; Null deviance: 4396.2 on 3207 degrees of freedom Residual deviance: 3679.4 on 3205 degrees of freedom (4346 ...
0
votes
0answers
12 views

confusing result from likelihood ratio test when covariate is factor

I got really confusing result from likelihood ratio test. I'm using mtcars data as an example. The following code works as expected. In ...
0
votes
0answers
23 views

Writing the matrix form of a linear regression model?

I don't know how to write a simple linear regression model in a matrix form.. in our book we are given a table having values of $ x,y,x2,y2,xy.$ . I created a very small example and I attached it as ...
-1
votes
0answers
21 views

are my model nested or non nested?

Let's say that I have a model with Y1,Y2 and M1 that includes the interaction between M1 and Y2 where all three variables are categorical. Also I have the same model where M1 is not categorical but ...
1
vote
0answers
23 views

Approach to automatically determining the source of data matrix singularity?

When you're using R built-in glm functions (and in other languages I assume), the software has a built-in ability to automatically eliminate redundant or inestimable parameters. For example, when ...
0
votes
0answers
14 views

Probit Hypothesis Test: $H_0: \beta_1 \geq 1$

Problem Given the output of a probit model and no knowledge of the sample data: ...
0
votes
1answer
49 views

GLM for count data with all zeroes in one category

I have a GLM where the response variable is count data and the predictive variable is a factor with 4 levels. I used a negative binomial distribution to model the relationship between both variables (...
1
vote
0answers
33 views

Poisson residuals

I have been working with count data (n=66) recently, trying to fit a simple model to explain distribution in an outcome whereby the count (number of successful trials in a region) is relative to an ...
1
vote
1answer
75 views

What is the main difference between GLM and GEE?

From my understanding, glm(not glmer) and GEE both handle binary values. But GEE is a marginal model and glmer is a random effects model (mixed model). So then what is the main difference between GLM (...