Questions tagged [glm]

For questions relating to generalized linear models. For the GLM math library, see the [glm-math] tag.

Generalized linear models are a class that encompasses a variety of standard statistical models, including ordinary least squares (a.k.a. linear models, OLS) regression, probit, logistic regression, Poisson regression, and other methods that can be expressed in the standard GLM form.

Consider whether your question is better suited to Cross Validated, the Stack Exchange site for statistics and machine learning. Questions on Stack Overflow should be about programming issues arising from fitting models to data.

In scientific software for statistical computing and graphics, a GLM can be estimated by the function glm.

2019 questions
0
votes
1 answer

GLM LM predicted values sum and High Dispersion

Any reason why the sum of predicted values and sum of dependent variable is same? ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2, 10, 20, labels =…
user35655
  • 13
  • 5
0
votes
1 answer

ANOVA problems with revoScaleR::rxGlm() in R

I build lots of GLMs. Usually on large data sets with many model parameters. This means that base R's glm() function isn't really useful because it won't cope with the size/complexity, so I usually use revoScaleR::rxGlm() instead. However I'd like…
Alan
  • 619
  • 6
  • 19
0
votes
1 answer

How to us lapply or sapply for GLM on multiple species separately?

I am trying to run a GLM on multiple different species in my data set. Currently I have been sub-setting my data for each species and copying this code and it's turned into quite the mess. I know there has to be a better way to do this, (maybe with…
user13314714
0
votes
0 answers

NaN, Inf or invalid value detected in weights on Python Gaussian Inverse statsmodels GLM

I'm running into an issue on a specific regression (GLM Inverse Gaussian) in Python that has worked previously with different data. Here is the example of the first data set throwing errors, and the same regression on different data. I can't isolate…
Carli
  • 28
  • 5
0
votes
0 answers

Error in using 'ddply' and 'glm' for k-value estimation (hyperbolic delay discounting) in R

I am trying to find the most suited k-value (or discount rate) that best explains my participants' choices for immediate vs delayed reward (where lower k value means they choose a lot of immediate options and higher k value means they are more…
0
votes
0 answers

Unexpected error - regression model using glm

I am trying to do a regression using glm but it is coming with an unexpected error Here is the code: mod1 <- glm(N_agreements ~ Population + PublicStaff + Macrorregion + Direct Plan, data = ILC, family = binomial) summary(mod1) the message: Error:…
0
votes
0 answers

Predict the injury time of a football match?

I have a project which requires me to predict the injury time of a football match. I have the relevant information, such as goals, corners, referee, 2 team names and the injury time for each half. I tried to use Poisson regression and I am confused…
waibibabo
  • 1
  • 2
0
votes
0 answers

Plotting a general linear model (glm) produced with the function monthglm() from the season package in R

Problem: I have fitted a general linear model (glm) with a categorical variable of the month using the function monthglm() based on the covariates of Month and Season, which was written by Barnett, A.G., Dobson, A.J. (2010) Analysing Seasonal…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
1 answer

How to set zero-inflated GLM intercept to positive in R?

I am trying to run some zero-inflated GLM's using the zeroinfl function, but a lot of them are giving me negative intercepts which don't make sense for my variables. Is there a way to set the intercept above zero? Thank you! For…
0
votes
0 answers

How can I get glmer model to read "missing" data as zeros?

I have data that is missing values, how can I get a glmer model to read these as 0's so i can avoid this... I know that I have less observations than random effects, I just don't understand R well enough to fix it. This is the data i am trying to…
Johnny5ish
  • 295
  • 1
  • 2
  • 12
0
votes
0 answers

predicting categorical variable by continues variables

I am doing a logistic regression analysis to predict a categorical variable(sex) by more than one continuous variable. However, I encounter some errors and really need someone to help me. Here I put the simulation data and the…
adR
  • 305
  • 4
  • 14
0
votes
0 answers

Betareg summary causes memory allocation error

I am currently building a model on a data set of 1,000,000 observations using the betareg package in r. My code is: m1 <- betareg(rr ~ cred_report, data = mydata, link = "logit") betareg seems to run just fine, however, when I go to summarize the…
0
votes
0 answers

How to predict with a regression model with many missing values?

I intend to analyze and build a regression model with a dummy variable as a dependent variable. I'm using the glm function, but I can't predict it. I don't want to exclude the missing values. What is the best way to make good predictions in cases…
0
votes
0 answers

R What are the consequence of a R glm that has not converged

I am looking to understand the consequences with futur predictions using the predict(*) R function with a R glm object that didn't converged during modeling process. However, I am able to manually backfilled the coefficients and the other components…
John E.
  • 137
  • 2
  • 10
0
votes
1 answer

extract exponential coefficients from models MuMIn::dredge

I'm trying to exponentiate coefficients and standard errors from multiple Poisson models from a MuMIn::dredge object to use with texreg::screenreg. In the case of one model we can do this: library(MuMIn) library(texreg) data(Cement) m1 <- glm(X1 ~…
user63230
  • 4,095
  • 21
  • 43