# glm

1. ### Does my predictor in my multiple regression have too many variables?

So I am trying to work out what is the best predictor of a) awareness over environmental issues, b) concern over environmental issues and c) pro-environmental behaviour from a set of sociodemographics (eg. age bracket, political standing, location etc) measured using a survey. I am using a...
2. ### Why is an interaction term better than two regressions?

I have struggled with the "because it is" and vague answers on this topic for a while and I was hoping someone could actually give a real reason why using an interaction term in regression is better than doing two regressions. For example: While doing a GLM to see how environmental factors...
3. ### Unbalanced confounding variable

Apologies if this has been asked before, but I could not find anything relevant. I have created a physiological score (continuous variable, values between 0 and 1) that correlates to a disease (binary variable, 0 = healthy, 1 = patient). The idea is to use this score to predict the disease...
4. ### How to calculate partial residuals by hand?

Code for GLM Poisson regression (R): library(datasets) mydata <- warpbreaks poisson_mod <- glm(breaks ~ wool + tension, mydata, family = poisson()) Gives: Call: glm(formula = breaks ~ wool + tension, family = poisson(link = "log"), data = mydata) Coefficients: (Intercept) woolB...
5. ### How family=Poisson works in glm function in R?

Let's assume I am working with this dataset on R: n <- 40 x1 <- rnorm(n, mean=3, sd=1) x2 <- rnorm(n, mean=4, sd=1.25) y <- 2*x1 + 3*x2 + rnorm(n, mean=2, sd=1) mydata <- data.frame(x1, x2, y) I cannot understand how Poisson regression works in R, I would assume that the following are...
6. ### Difference between simulating the dependent variable and simulating the error terms and adding them to the fitted values values assuming normality?

What's the statistical difference between simulating the dependent variable and simulating the error terms and adding them to the fitted values values assuming normality (gaussian GLM)? Say I'm doing a simple multiple regression on the following data (R): n <- 40 x1 <- rnorm(n, mean=3, sd=1)...
7. ### Interpret quasipoisson GLM with interactions

Hello to all the community, I write this post because I would need a little help with the interpretation of my model's summary. First, here is the model : glm(formula = Nb_bone_discovery ~ Order * Time, family = "quasipoisson") #I used quasipoisson since I got surdispersion. Where : -...
8. ### Kernel of GLM Log-Likelihood

In Agresti's Foundations of Generalized Linear Models, it states that the kernel of the log-likelihood function of a distribution in the exponential family is simply sum(y_i*theta_i), but I'm confused as to why c(y_i,phi) is not included, as this is also a function of the range. Basically, I am...
9. ### Variable restriction in (exhaustive) model selection

Hi all, I have a high number of variables (around 80) with which to model an intermediate-size sample (around 50 points) using GLMs. I would like to do an exhaustive search for the "best" model, but using all of the variables in an exhaustive (or semi-exhaustive, like glmulti's genetic...
10. ### Year as continous variable

Hello, Im new in statistics. Can I use "years" as a continuos variable to see if NDVi (normalized difference vegetation index) has changed over the years positively or negatively, for example with a GLMM or GLm? Thanks!!!!
11. ### Survival analysis at few dates: glms? logrank? cox ?

Hello, In many documentation I have read that Kaplan-Meier curves followed by logrank test and/or cox models are the most recommended statistical methods to analyse Survival and test for different factors that may impact the Survival. However, I have also heard that these are suitable if I...
12. ### Which non-parametric test should I use while running GLM?

I'm trying to analyze some experimental data about animal behaviour using R and would need some help or advice regarding which non-parametric test should I use. The variables I have are: - Response variable: "Vueltasmin", a numeric one - Explicatory variable: "Condicion", a factor with 6 levels...
13. ### GLM for two quantitatives data as DV

Hello all, I have the following data res=structure(list(Zone = 1:12, Cat1 = c(0.5, 3.5, 1, 1, 2, 5.75, 9.33333333333333, 9, 11.6666666666667, 3.41666666666667, 4.58333333333333, 0), Other_cat = c(48.5, 45.5, 42, 52, 50, 42.25, 39.6666666666667, 34, 41.3333333333333, 42.5833333333333...
14. ### Multiple A/B test in R: methodology and any know tutorial

Dear All I'm currently facing the following situation. We have run a marketing campaign providing to some members one of two type of coupones. In addition to this, some of these members were already contacted in the previous one by another campaign. So I have the following dataset, where...
15. ### Data frame of results

Hi all Suppose I have 10 different models as such: fit1.glm <- glm(admit ~ gre , data = dat, family = "binomial") fit2.glm <- glm(admit ~ gpa, data = dat, family = "binomial") fit3.glm <- glm(admit ~ rank, data = dat, family = "binomial") ... Suppose then, I want to form a data frame...
16. ### Adjust for overdispersion in glm family = binomial (logit) model

I have an overdispersion problem in my model.. I have the following data: y= succes/fail (%) x= Var1 : Temperature data m1<-glm(cbind(succes,fail)~Var1, data=data, family = binomial(logit)) Call: glm(formula = cbind(succes, fail) ~ Var1, family = binomial(logit), data = data)...
17. ### Which model/test should I choose? (GLM..?)

Hello! I'm new to statistics but I am getting really stuck with my data so I hope someone could help me to choose the best statistical test. I have some test (dummy) data. I have data from 64 different hospitals, for 5 different countries countries, over 5 different years. In all of the...
18. ### Moran's I Spatial Autocorrelation. Interpreting results.

I have carried out a Moran's I test on the residuals of a GLM model in the "ape" package in R which has returned the output below: Observed: -0.158 Expected: -0.0303 SD: 0.058844 Probability: 0.030002 On this basis is it correct to state that there is negative spatial autocorrelation...
19. ### Help with R GLM Formula for paired/nested model

I have an experimental design as follows: Two treatments, carried out on the same sample. The samples are collected from soil at five depths, in five different pits, from five different fields. I want to: (1) see if the treatment has an effect on the species richness found in the soil...
20. ### Link = log code won't work

Hi, doing a generalised linear model with poisson distribution, here is my model code... model<-glm(carnivore_abundance~altitude_1+dist_stream+canopy_openess+basal_area+dist_large_river,family=poisson,data=main_data) really frustratingly whenever I try to add link=log is doesn't work it...