1
vote
2answers
40 views

Understanding dummy (manual or automated) variable creation in GLM

If a factor variable (e.g. gender with levels M and F) is used in the glm formula, dummy variable(s) are created, and can be found in the glm model summary along with their associated coefficients ...
4
votes
1answer
23 views

Using log-linear models for presence/absence data in wildlife

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed ...
1
vote
2answers
49 views

Homoscedastic and heteroscedastic data and regression models

How to understand the homoscedasticity and heteroscedasticity in context of regression models? Is there a way to check these properties in R?
0
votes
0answers
20 views

How do you extract confidence intervals and OR out of the step() function in R?

I've been wondering something for a while. If you run a simple regression model in R and then perform a step-wise selection (it doesn't have to be the way I typed the code below), how do you extract ...
0
votes
1answer
21 views

How to interpret coefficients in a Poisson regression with interaction terms?

This question is a prolongation of this question: How to interpret coefficients in a Poisson regression? If we follow the (almost) exact same routine, but we add correlation between the variablese ...
0
votes
0answers
34 views

Fitting non-normal data in lme4 with a family distribution

I'm currently working on fitting a model where we predict the level of some biomarker as a function of time (see image at bottom). I have two difficulties: Each person contributes 2-3 datapoints ...
2
votes
1answer
93 views

GLM for count data

I ran an experiment with an eye tracker and my data frame has this look: ...
0
votes
0answers
16 views

How to select a model in quasi-poisson GLM with interactions using drop1 command?

I want to evaluate the effect of three factors (one categorical, and the other two continuous) on the response variable, which is a count data. I have performed 7 candidate GLM models with ...
0
votes
1answer
32 views

glm inflated error…why?

I'm pretty new to stats, so this may be dumb. I've been running a bunch of models on randomly generated data to try and develop my understanding of type 1 error. I've noticed that using ...
0
votes
0answers
5 views

Best method to fit a GEV distribution with generalised linear modelling of parameters?

I need to fit a generalised extreme value distribution to my data but I want the ability to perform generalised linear modelling of the parameters, particularly the location. Can anyone recommend the ...
0
votes
0answers
15 views

Including squared predictors in model matrix [migrated]

I have the following code x <- c(1, 2, 3) y <- c(2, 3, 4) z <- c(3, 4, 5) df <- data.frame(x, y, z) model.matrix(x ~ .^4, df) This gives me a model ...
1
vote
1answer
34 views

Poisson GLM vs Quasi Poisson GLM

I have a Poisson GLM in R that is over dispersed, so I fit a quasipoisson GLM, however the residual deviance nor the degree of freedom change. Can that happen? What does it mean in that case? Thank ...
2
votes
2answers
59 views

Same dataset analysed with four different linear models

I've analysed the same dataset (diamonds from ggplot2) in R with four linear models. Each model has a different error structure. ...
1
vote
0answers
32 views

Comparison between normal glm and glm.nb regression with quadratic term?

Let's say I have a function to simulate data for negative binomial regression: ...
2
votes
1answer
40 views

Why NB and Poisson performs superior than ZIP, ZINB and Hurdle in presence of lots of zeros?

I am working on a data which contain nearly 80% of zeros and positive counts as large as 7. The dataset is very large, nearly 16,000 cases. It is a health related data. I have fitted ZIP, ZINB and ...
0
votes
0answers
50 views

Treating numeric as categorical variable in regression

I need a little bit of help and confirmation that I have the right idea. I have some fake data of 8 tribes; within each tribe members work hard to gain food for their own tribe. No one can speak to ...
3
votes
0answers
20 views

Using residualized predictors outside the linear model context

Can anyone point me towards a good explanation of when a residualized variable in a regression will give you the same answer as using a non-residualized variable with controls? For instance, say I ...
2
votes
1answer
31 views

Should anova(model, test=“Chisq”) not produce a test statistic as well as a P value?

Doing a poisson regression like this: model<-glm(y~x*z,family=poisson) with one predictor being a factor, I would use ...
2
votes
1answer
52 views

R code for zero inflated Poisson

I have used glm() to model some data I have. The code looks like the following: ...
3
votes
0answers
51 views

R: Problem with NaNs in gamma regression using glm

I have found a problem with NaNs when I try to fit the model from example 5.1 in the book Generalized Linear Models. With Applications to Engineering and Life ...
3
votes
1answer
81 views

Why are there no one-inflated count data models?

I am working on zero-inflated count data models using the pscl package. I am just wondering why there is no development of models for one-inflated count data ...
4
votes
0answers
96 views

How to fit log-linear poisson autoregressive mixed model?

I have time-series count data $N_{i,j}$ (population sizes in site $i$ and year $j$) and I want to correlate year-to-year changes with the environmental conditions $x_{i,j}$. For this, I want to fit ...
0
votes
0answers
47 views

Output of dredge and model.avg functions of MuMIn

I am running a GLM of about 15 predictor variables and using dredge and model.avg functions of ...
2
votes
1answer
53 views

How to replicate Stata's robust glm for proportion data in R?

There is an example on how to run a GLM for proportion data in Stata here: http://www.ats.ucla.edu/stat/stata/faq/proportion.htm The IV is the proportion of students receiving free or reduced priced ...
2
votes
0answers
33 views

creating contrast matrix (limma) for two factorial in R

I am attempting to construct a contrast matrix that I can run in R, using the limma bioconductor package, but I am not sure that I have coded the contrast matrix correctly. A previous post and the ...
1
vote
1answer
75 views

GLM for proportion data in r

I have proportion data on the percentage of female employees in 500 organizations. I want to use GLM to explain this dependent variable using other independent variables such as company size, ...
0
votes
0answers
46 views

Fit of negative binomial regression model

I have ran a negative binomial regression. I'm guessing the use of a negative binomial regression is not ideal given my design, but I'm hoping I can 'get away with it', as it seems to be working ...
0
votes
1answer
55 views

How to interpret regression estimates

I am studying the effect a certain chemical and age on an outcome. As variables, age is a factor of with levels 1, 2, and 3 and ...
0
votes
1answer
36 views

Interpreting estimates from generalized models in R [duplicate]

I'm using R to run some generalized linear models (GLM) and I want to interpret the estimates. If I use a GLM assuming Gaussian distribution with identity link, interpretation is easy: if the ...
2
votes
2answers
63 views

Multiple regression with categorical and numeric predictors

I am relatively new to R, and I am trying to fit a model to data that consists of a categorical column and a numeric (integer) column. The dependent variable is a continuous number. The data has the ...
1
vote
0answers
33 views

Incorporating the non-independence of 'Date' into a model predicting temperature

I'm trying to analyse some temperature data, collected at 49 sites over a three month period. The data are in the form of a maximum reading at each site on each day. I'm interested in how temperature ...
3
votes
1answer
62 views

SE of fit versus SE of prediction

I would like to get the standard error on a prediction. Using R glm, I can get the SE of the fit for a specific prediction: ...
0
votes
0answers
46 views

Distribution of Data

I have a question about glm model fitting of my data. The distribution shape is likely to follow a poisson distribution, but the response variable is not count/rate, but continuous decimals with ...
0
votes
1answer
65 views

Non-significant p-values for factor levels with only 0s in negative binomial glm using glm.nb() in R

I am trying to fit a negative binomial GLM to fish catch data with month of the year (factor) as my explanatory variable. I have selected the month with the greatest number of catches as my reference ...
1
vote
1answer
137 views

Repeated measure t test with covariates in R

I have a two data-sets of a set of subjects with values for their baseline and followup visit. I would like to do a repeated measure test to see whether there is a significant difference between the ...
0
votes
0answers
23 views

Dinamic changing of parameter in a formula during optimization

I have two functions, the first one calulates the result of a generalized linear model for a series of values (Dose) respect to a given series of ...
3
votes
0answers
47 views

Can I use weights generated by robust regression in a quasipoisson glm in R?

I have response variable count data that should be treated as quasipoisson or something similar. This data also contains outliers which are important to the dataset. I cannot find an r package that ...
0
votes
2answers
98 views

Logit-link GLM Summary Interpretation

I made a logit link, GLM model with 7 explanatory variables. How do I interpret the coefficients and CI? ...
0
votes
0answers
23 views

How can I feed the randomized tables into the linear model as its 'expected tables'

I want to estimate all the possible interactions of three variables with linear model in R. My dataset is like this:   ...
4
votes
1answer
89 views

Help Translating R GLM Command to Math Notation

I have the following generalized linear model. Object glmDV is modeled as a proportion of successes over total trials. Objects ...
0
votes
0answers
39 views

Is it possible that all parameters are highly significant? [duplicate]

I just did a binary linear regression in R with a dataset that has 100000 lines. The output of the regression is, that almost every parameter is highly significant. I wouldn't expect that when I look ...
1
vote
1answer
67 views

Estimating variability in a response variable not accounted for by measured predictors using linear regression and R

Background I have a data set of patients who were operated on at two different hospitals, A and B. Lymph nodes were removed from each patient during the operation and counted, this is saved as ...
1
vote
1answer
64 views

std errors in poisson glm

With this data: ds <- data.frame(y=1:10,z=rep(c("A","B"),each=5)) I fit this model: ...
1
vote
0answers
22 views

Ecalp function on R

I am doing some model validation and calibration of training data fit to use with glm and gam models, and I am having a problem with the ecalp function. Does anyone had this problem before? Any ...
3
votes
1answer
174 views

Likelihood Ratio Test and Wald test provide different conclusion for glm in R

I'm reproducing an example from Generalized, Linear, and Mixed Models. My MWE is below: ...
2
votes
1answer
98 views

Predict with type='response' for GLM with errorest() function in package ipred

Apologies if this is a simple question... I am attempting to use the errorest function of the ipred package in R to to K-fold ...
0
votes
1answer
171 views

R crossvalidation cv.glm: prediction error and confidence interval

I am using the R package boot and the cv.glm function. The output 'delta' gives me the un-adjusted and adjusted prediction error. Here is an example on the top of page 10: ...
4
votes
0answers
123 views

Lasso on Negative Binomial Regression Model

Is there anyway that I can perform LASSO with Negative Binomial Regression on R? I am performing a negative binomial regression on my dataset because the data are too dispersed to impose poisson ...
0
votes
0answers
46 views

Logistic regression on 3 covariates each with unequal sample size

I have 3 covariates $(x_1,x_2,x_3)$, each covariate takes only 2 values $\{0,1\}$ but each covariates have unequal sample size. $n(x_1)=79,\;n(x_2)=80,\; n(x_3)=77$ $x_1$:(60 zeros and 19 ones) ...
0
votes
1answer
46 views

Are these 2 quasi poisson glm identical?

Approach 1: lm.fit <- glm(response ~ 1, offset=log(lam), family="quasipoisson") summary(lm.fit) Approach 2: Feed summary.glm with a pearson dispersion. ...