glm Questions

4

I've got some coefficients for a logit model set by a non-r user. I'd like to import those coefficients into r and generate some goodness of fit estimates on the same dataset (ROC and confusion mat...
Chloral asked 6/9, 2014 at 0:6

3

I am trying to save trimmed-down GLM objects in R (i.e. with all the "non-essential" characteristics set to NULL e.g. residuals, prior.weights, qr$qr). As an example, looking at the smallest objec...
Shadwell asked 7/12, 2015 at 11:12

1

I have done some searching for this, but the mailing list posts I have found are associated with the person not specifying a random effect in nlme whereas I have done this. I also own the book Mixe...
Wellintentioned asked 29/12, 2011 at 3:51

7

I have some data with predictors and a binary target. Eg: df <- data.frame(a=sort(sample(1:100,30)), b= sort(sample(1:100,30)), target=c(rep(0,11),rep(1,4),rep(0,4),rep(1,11))) I trained a ...
Beeson asked 23/4, 2014 at 9:27

2

Solved

When one performs a logit regression in R, it is possible to obtain coefficients after the optimization algorithm has converged (or not) with coefficients() function: library(MASS) data(menarche) ...
Crippen asked 24/10, 2015 at 17:9

3

Solved

I am trying to get the F-statistic and p-value for each of the covariates in GLM. In Python I am using the stats mode.formula.api to conduct the GLM. formula = 'PropNo_Pred ~ Geography + log10BMI ...
Sundaysundberg asked 6/12, 2014 at 5:28

2

I want to derive coefficients of Gamma regression by iterated reweighted method (manually). When I run this code with out for{} loop it works properly but with loop it produce NaN. My code is: n&lt...
Erik asked 10/1, 2023 at 10:56

2

I am modeling a mediated zero-inflated negative binomial (ZINB) model. i am following the steps of O'Rourke & Vazquez (2019) --> https://www.sciencedirect.com/science/article/abs/pii/S030646031...
Kiushu asked 22/4, 2020 at 10:45

2

Solved

I am confused with the way predict.glm function in R works. According to the help, The "terms" option returns a matrix giving the fitted values of each term in the model formula on the linear p...
Amontillado asked 22/6, 2016 at 9:28

5

Solved

I'm running many regressions and am only interested in the effect on the coefficient and p-value of one particular variable. So, in my script, I'd like to be able to just extract the p-value from t...
Indispose asked 23/5, 2014 at 22:2

1

I have heard people talk about "modeling on the residuals" when they want to calculate some effect after an a-priori model has been made. For example, if they know that two variables, var...
Serene asked 4/5, 2021 at 12:51

0

We are fitting a generalized linear model to a set of data using R on Fedora 33. We are 3 people that have the exact same data set, exact same OS (Fedora 33) , exact same R version and package vers...
Bobbitt asked 26/4, 2021 at 22:41

2

Solved

In R predict.lm computes predictions based on the results from linear regression and also offers to compute confidence intervals for these predictions. According to the manual, these intervals are ...
Franco asked 20/1, 2013 at 9:45

1

I tried to construct a generalized linear model in R. I receive the following output below with the error "fitted probabilities numerically 0 or 1 occurred". I am wondering is this ...
Karyoplasm asked 28/2, 2021 at 17:41

1

I have semicontinuous data (many exact zeros and continuous positive outcomes) that I am trying to model. I have largely learned about modeling data with substantial zero mass from Zuur and Ieno's ...
Extrados asked 16/1, 2021 at 0:8

4

Solved

I am trying to use the crossvalidation cv.glm function from the boot library in R to determine the number of misclassifications when a glm logistic regression is applied. The function has the fol...
Mcmullen asked 27/5, 2013 at 22:55

2

Solved

When I am using R, how can I save a model built by glmnet to a file, and then read it from the file so as to use it to predict? Is it also the same if I use cv.glmnet to build the model? Thanks!...
Ecbatana asked 9/12, 2013 at 3:26

2

Solved

I'm trying to do some glm's inside a data.table to produce modelled results split by key factors. I've been doing this sucessfully for: High level glm glm(modellingDF,formula=Outcome~IntCol + ...
Fraga asked 25/9, 2013 at 9:59

2

Here are two related questions but they are not duplicates of mine as the first one has a solution specific to the data set and the second one involves a failure of glm when start is supplied along...
Waiver asked 25/2, 2016 at 3:59

3

I would like to know how to constrain certain parameters in lm() to have positive coefficients. There are a few packages or functions (e.g. display) that can make all coefficients, and the intercep...
Pegasus asked 2/12, 2014 at 8:26

1

Solved

I'm wondering how are default starting values specified in glm. This post suggests that default values are set as zeros. This one says that there is an algorithm behind it, however relevant link ...
Pontias asked 4/3, 2020 at 12:54

3

Solved

Here are all the variables I'm working with: str(ad.train) $ Date : Factor w/ 427 levels "2012-03-24","2012-03-29",..: 4 7 12 14 19 21 24 29 31 34 ... $ Team : Factor w/ 18 lev...
Cambric asked 26/5, 2017 at 11:16

6

I have created two generalised linear models as follows: glm1 <-glm(Y ~ X1 + X2 + X3, family=binomial(link=logit)) glm2 <-glm(Y ~ X1 + X2, family=binomial(link=logit)) I then use the anov...
Viera asked 22/8, 2013 at 17:39

3

Solved

Why there is no possibility to pass only 1 explanatory variable to model in glmnet function from glmnet package when it is possible in glm function from base? Code and error are below: > modelX...
Biancabiancha asked 24/3, 2015 at 11:14

1

Solved

I have computed a binomial regression in R: Call: glm(formula = cbind(success, failure) ~ x * f, family = "binomial", data = tb1) Deviance Residuals: Min 1Q Median 3Q Max -3.6195 -0.9399 -0....
Supper asked 25/10, 2019 at 14:14

© 2022 - 2025 — McMap. All rights reserved.