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
0 answers

ordinal logistic regression with MORE THAN ONE random effects

I am evaluating how much the method B for data collection, predicts the method A. It’s important to SAY that METHOD A has HIERARCHY data (on a scale ranging from 0 to 3) and METHOD B has data with CONTINUOUS VALUES. Would anyone know how to use more…
Fran Braga
  • 197
  • 2
  • 14
0
votes
0 answers

Odd linear model results

I'm unit acceptance testing some code I wrote. It's conceivable that at some point in the real world we will have input data where the dependent variable is constant. Not the norm, but possible. A linear model should yield coefficients of 0 in this…
0
votes
1 answer

GlmmNP package gives me errors

I am new to glmm. I require it to fit a model that takes into account bees fed on two pollen treatments, placed in different cages, and their weight recorded on a daily basis. The question I seek to address is whether the weight of the bees varies…
0
votes
1 answer

DESeq2 design matrix including RIN as covariate in the formula

I have been following the last DESeq2 pipeline to perform an RNAseq analysis. My problem is the rin of the experimental samples is quite low compared to the control ones. Iread a paper in which they perform RNAseq analysis with time-course RNA…
FrAoJm
  • 5
  • 1
0
votes
1 answer

How do I aggregate data for glm() function in R

I am trying to estimate relativities for insurance pricing using a glm. I'm using the "freMPTL" in CASdatasets. ClaimNb is my response, Exposure is my Exposure, I'm interested in ClaimNb/Exposure. After dividing the larger categories such as driver…
William
  • 1
  • 1
0
votes
1 answer

How to iterate through dataframe and pass columns to glm function in Python?

I have a dataframe with 7 variables: RACA pca pp pcx psc lp csc 0 BARBUDA 1915 470 150 140 87.65 91.41 1 BARBUDA 1345 305 100 110 79.32 98.28 2 BARBUDA 1185 295 80 85 62.19 83.12 3 BARBUDA …
Paulo Barros
  • 157
  • 1
  • 2
  • 12
0
votes
1 answer

Combing tidyverse + survey [R]: How to use svyglm in Nest-Map-Unnest-Chain?

I am currently struggling to run weighted regression models on multiple variables in R. When using (non-weighted) glm, I was successful by running the following: mtcars_1 <- mtcars %>% nest(-gear)%>% mutate(model_0 = map(data, ~ glm(vs ~…
lrnd_lnrd
  • 3
  • 2
0
votes
1 answer

R glm - How to predict the same coefficient from two different dataset with the same data format and value

So let me explain my goal. (1) I have an existing glm with P input variables which one of them is named 'X'. (2) I have multiple datasets from different systems that each contains the 'X' input variable, but with a different names. Once I extract…
John E.
  • 137
  • 2
  • 10
0
votes
1 answer

Generate a Nice Looking Table from GLM

I intend to have the result of a logit regression in a nicely formatted table in R. so, I use library(xtable) with print(xtable) function. The result came out in a LaTex document that didn't look "nicely formatted" Any advice on how I could achieve…
0
votes
1 answer

Replicating marginal effects from logit model example in Gujarati & Porter on R

I am replicating a logit model example from Econometrics book from Gujarati and Porter (Spanish edition). I have no problems with the model estimation, but I can't replicate marginal effects. In book, regression results are the following: In the…
fcochaux
  • 135
  • 1
  • 13
0
votes
1 answer

large glm models and memory management

I am training a set of glm models using h2o where the very sparse training matrix (4million x 50k) is the same but the response variable (y) is different for each model. The steps I am using are training matrix is read as a 3col pandas table…
ironv
  • 978
  • 10
  • 25
0
votes
1 answer

Creating model matrix to predict new data using cv.glmnet object in R

I have a cv.glmnet to use to predict new data. I have a problem when creating the model matrix for new data to be predicted using cv.glmnet object. I need to block bootstrap the test data and predict the response for all samples. The problem happens…
Nile
  • 303
  • 2
  • 11
0
votes
2 answers

How to find the odds ratios for a logistic model?

I have a standard logistic regression model in R reg <- glm(formula = y ~ x, family = "binomial"(link='logit')) I am trying to find the odds ratios for my model in R. Is there a function or some other way to do this?
324
  • 702
  • 8
  • 28
0
votes
1 answer

Prediction using Poisson regression

I am wondering how I can predict outcomes in the 2018:2030 time frame using my data, which includes variables such as YEAR, AGE, FEMALE, and RACE. I am using a svydesign setup for this prediction, and I get accurate results, below, by just doing…
davidk
  • 133
  • 2
  • 11
0
votes
0 answers

Variable selection for multivariate logistic regression model, including quadratic and interaction terms in R

While I was working on a project, I stuck into an error saying glm.fit: fitted probabilities numerically 0 or 1 occurred when I tried glm() with full model. Before including quadratic and interaction terms into the model, it worked fine. How can…
1 2 3
99
100