Top "Glm" questions

For questions relating to generalized linear models.

How to succinctly write a formula with many variables from a data frame?

Suppose I have a response variable and a data containing three covariates (as a toy example): y = c(1,4,6) d = data.…

r dataframe glm lm
How to debug "contrasts can be applied only to factors with 2 or more levels" error?

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 : …

r regression lm glm r-faq
Warning: non-integer #successes in a binomial glm! (survey packages)

I am using the twang package to create propensity scores, which are used as weights in a binomial glm using …

r glm
Extract pvalue from glm

I'm running many regressions and am only interested in the effect on the coefficient and p-value of one particular variable. …

r glm p-value
Confidence intervals for predictions from logistic regression

In R predict.lm computes predictions based on the results from linear regression and also offers to compute confidence intervals …

r statistics glm confidence-interval
how do i exclude specific variables from a glm in R?

I have 50 variables. This is how I use them all in my glm. var = glm(Stuff ~ ., data=mydata, family=binomial) …

r statistics glm
Extract standard errors from glm

I did a glm and I just want to extract the standard errors of each coefficient. I saw on the …

r extract glm standard-error
Get 95% confidence interval with glm(..) in R

Here are some data dat = data.frame(y = c(9,7,7,7,5,6,4,6,3,5,1,5), x = c(1,1,2,2,3,3,4,4,5,5,6,6), color = rep(c('a','b'),6)) and the plot of …

r statistics glm confidence-interval mixed-models
R error which says "Models were not all fitted to the same size of dataset"

I have created two generalised linear models as follows: glm1 <-glm(Y ~ X1 + X2 + X3, family=binomial(link=logit)) …

r glm lm anova
Deciding threshold for glm logistic regression model in R

I have some data with predictors and a binary target. Eg: df <- data.frame(a=sort(sample(1:100,30)), b= …

r glm predict logistic-regression