0
votes
0answers
16 views

GAM and ordered probit regression in R

I want to check the fit of the ordinal probit regression model with the help of GAM (generalized additive models). There are plenty of examples how to construct GAM for dichotomous responses in R. ...
1
vote
0answers
39 views

Basic question about getting esimated probabilities in R

I've got what I think is a fairly basic problem. I'm not sure if it is a conceptual question or software question, but I'm fairly new to using R and these kinds of stats, so it could be either or ...
2
votes
2answers
94 views

Simplifying variable effects in a GLM in R

Apologies, but it looks like my question is off topic for this forum. Thanks for all the excellent replies though. For those who have come across this question if they've been looking for something ...
1
vote
1answer
23 views

Plot one predictor and its quadratic term versus response variable (GLM binomial distribution)

I have the following model with four independent variables: Model_A <- glm(GRSP~ppt+tem+density+land+I(land^2), family=binomial()) When I plot the variable ...
2
votes
1answer
42 views

Using ordered factor as predictor in R [duplicate]

This is a really simple problem I am having, yet for the life of me I can't find a solution searching around. In theory I can simply recode the data, but that is an extreme solution I would rather not ...
1
vote
1answer
43 views

Is it possible to get a covariance matrix of fitted values for a GLM model in R?

I would like to get a covariance matrix of fitted probabilities for a logistic regression model in R. I would like to do this because I want to find the variance of the difference between the two ...
0
votes
1answer
40 views

Can someone look at my method for fitting a GEE to my data?

I’ve been doing some statistical analyses in R on some data. It’s for use in a manuscript I’m hoping to get published in a biological journal. Unfortunately, the tests I ended up having to run are ...
3
votes
0answers
57 views

Why do my boostrapped CI's (using boot.ci in R) not include the point estimate?

I'm interested in estimating an average treatment effect $$ \operatorname{ATE}\left(A', A''\right) = \mathbb{E}\left( Y\ |\ A'' \right) - \mathbb{E}\left( Y\ |\ A' \right) $$ with a generalized ...
2
votes
1answer
42 views

When to use zero-inflated poisson regression and negative binomial distribution

I have a fairly simple dataset looking at the relationship between the first nesting date of a bird in a given year (Date) and the birds overall fledgling production from that year (Fledge; count data ...
0
votes
0answers
34 views

R: Prediction using glm() [migrated]

I am using glm() function in R with link= log to fit my model. I read on various websites that fitted() returns the value which we can compare with the original data as compared to the predict(). I ...
1
vote
1answer
65 views

linear regression intercept does not match

I have done a linear regression in R, using glm function. The calculated intercept says 0.98, but when I plot it, it does not seem to hit the estimated intercept on Y axis. Its far below. Here are my ...
9
votes
1answer
125 views

Increased Type I error - GLM

Some of you might have read this nice paper: O’Hara RB, Kotze DJ (2010) Do not log-transform count data. Methods in Ecology and Evolution 1:118–122. klick. In my field of research (ecotoxicology) ...
0
votes
0answers
23 views

Zero inflated model problem: system is computationally singular

I'm using R.After getting an error asking me to provide starting values for a glm (poisson family), I took a look at my data and realized I had quite a bit of zeroes. So, I tried zeroinfl from pscl. I ...
0
votes
0answers
15 views

package in R for BMA of a logistic model?

I am trying to perform analysis similar to Gerlach et al. (2002). it involves predicting the posterior probability of a particular binary outcome using the previous 5 observations. I was just ...
0
votes
0answers
11 views

rebuild model based on what columns a record has

I've built a model in R using glm, and in the new dataset that I need to predict, there exist some new levels for the columns that are non-numeric. I know there are so many approaches to deal with ...
2
votes
0answers
39 views

What GLM family and link function for “proportion of time”?

A simple question to which I don't seem to find the answer anywhere. I have a response variable duration of time spent doing A of individuals tested for ...
1
vote
1answer
36 views

Interpret GLM Output (Gaussian - identity) with B0 close to zero

I am doing a GLM (guassian - identity) using R. I am modeling different variables (8) to try to understand what creates brand value in an organization. Some extracts from the output are: ...
0
votes
1answer
63 views

Binary logistic regression with interaction terms

I have been reading several CV posts on binary logistic regression but I am still confused for my current situation. I am attempting to fit a binary logistic regression to a series of continuous and ...
1
vote
1answer
100 views

Count data on proportion or different kind of type?

I really do not know which kind of variable my response data is. I cannot find any answer to my question in the world wide web. I have the results from a survey of 900 farmers. Each farmer told how ...
0
votes
0answers
24 views

Using glm(family = guassian) on data that is actually Poisson. Strange non-symmetrical bias

Let's say I want test the consequences of assuming a normally distributed response variable in a glm model when it is really Poisson. I simulate some data with some quadratic terms. ...
0
votes
0answers
28 views

linear or poisson regression for monsoon onset

I was interested to know if I have historical data of onset of monsoon every year (where onset for each year is in Julian day) and I want to do a regression of onset against time to study whether the ...
4
votes
0answers
62 views

How exactly is the sum (or mean) centering constraint for splines (also w.r.t. gam from mgcv) done?

The data-generating-process is: $y = \text{sin}\Big(x+I(d=0)\Big) + \text{sin}\Big(x+4*I(d=1)\Big) + I(d=0)z^2 + 3I(d=1)z^2 + \mathbb{N}\left(0,1\right)$ Let $x,z$ be a sequence from $-4$ to $4$ of ...
1
vote
0answers
27 views

combining and contrasting time course GLMs using R

I am analyzing some time course data in which I have set up a GLM using R for each subject. Each GLM I want to run is an attempt to extract estimates of different behavioral conditions effects on the ...
0
votes
1answer
41 views

GLM with categorical predictor on R

I need to do a model with a generalized linear model. My data are these: habitat : 0 or 1, group : 1 or 0 , mortality : yes or no, and the numbers of individuals for each case (habitat, group and ...
0
votes
0answers
90 views

R² (squared) from a generalized linear mixed-effects models (GLMM) using a negative binomial distribution

I try to compute the marginal and conditional R² for a GLMM using a negative binomial distribution by following the procedure recommended by Nakagawa & Schielzeth (2013) . Unfortunately, the ...
1
vote
0answers
75 views

Logistic regression with multi-class features in R

I'm working with a data set like the following: X = ...
2
votes
0answers
33 views

R GLM verifying performance statistics for validation

I do not want to say my AUC is 0.77 and find out I am overlooking a lot. Below is my code and a two question at the bottom: ...
1
vote
0answers
45 views

How does the cubic spline basis exactly look like

By the definition (1) $S(x)=\begin{cases} S_0 = a_0x^3 + b_0x^2 + c_0x + d_0, & \text{if }t_0\le x\le t_1\\ .....\\ S_{k} = a_kx^3 + b_kx^2 + c_kx + d_k, & \text{if }t_{k-1}\le x\le ...
0
votes
1answer
46 views

What is the z-value of glm model parameters?

I know what the z-value of a single observation is, that is explained in Wikipedia. But what is the z-value of a parameter in a glm model?
1
vote
0answers
43 views

error structure in Generalized linear models when y is continuous data and errors not normally distributed

Lets say I have continuous y and x variable and I run a linear regression: mdl1<-lm(y ~ x) A generalised linear model should also give me the same parameters ...
1
vote
0answers
52 views

fitting an exponential decay onto a regression line

I have data for adherence to medicines which follows a downward linear trend for about 6 months (from 100%) and then plateaus at about 50%. Another way of describing it is by saying that adherence ...
0
votes
0answers
49 views

Tukey for GLM can't find data in model

I fit a GLM to a dataset. Now I want to see where the difference between my groups is, so I tried to run a Tukey HSD as a post-hoc test. Because of it is a GLM, I can't use ...
0
votes
0answers
23 views

Fisher Scoring v/s Coordinate Descent for MLE in R

R base function glm() uses Fishers Scoring for MLE, while the glmnet uses the coordinate descent method to solve the same equation ? Coordinate descent is more time efficient than Fisher Scoring as ...
0
votes
1answer
57 views

GLM with multiple categorical variables in R : how to interpret the result?

I have a binomial variable that I regress against different categorical variables which I have contrasted to build a reference of an individual Female, Married, aged 35-45, High education : ...
-2
votes
1answer
117 views

Predict y value from glm for a x vector larger than data used in the model [closed]

I have fitted a Poisson regression model using, model <- glm(y ~ x, family = "poisson", data = df) where length of df is 50 ...
1
vote
0answers
83 views

Left skewed distribution implementation generalized linear model

I am very new to modelling and I have a question. I am using a generalized linear model (glm) for my data in R. My response variable is however skewed to the left ...
1
vote
1answer
58 views

Why does a binomial glm give negative predictions?

I'm using count data in quite a simple way, but I cannot understand how a binomial glm can return negative predictions example code, where count of successes increases with responce variable: ...
3
votes
0answers
103 views

Generalized linear model with lasso regularization for continuous non-negative response

I have a big data problem with a large number of predictors and a non-negative response (time until inspection). For a full model I would use a glm with Gamma distributed response (link="log"). ...
1
vote
0answers
79 views

Creating observed/expected ratio using logistic regression

I am using logistic regression to benchmark the performance of some students in different years. I created a scenario as below: ...
1
vote
0answers
51 views

Difference categorical variables R [closed]

I can't figure out how to do the following: I need the following linear predictor $\eta=team_i-team_j$ where, both $team_i$ and $team_j$ are categorical variables, which have 163 categories. Normally ...
5
votes
0answers
68 views

Why are confidence intervals for predicted values so large?

The data for this question can be downloaded with this code: ...
0
votes
0answers
28 views

Logistic Regression Performance on training data set V/s AIC

I am fitting a logistic Regression on data set having 700 variables (after Chisquare test) and 15000 rows. For that I did best subset analysis using glmulti package in R on first 70 variables and got ...
5
votes
5answers
808 views

Logistic Regression on Big Data

I have a data set of around 5000 features. For that data I first used Chi Square test for feature selection; after that, I got around 1500 variables which showed significance relationship with the ...
1
vote
1answer
70 views

Logistic regression: can weights be used as a predictor variable?

I counted the number of birds in a flock, which gave counts like these: ...
1
vote
2answers
182 views

Should the final R glm include only significant levels of factors

I am running a glm in R on data with quite many predictors (~50), both initially continuous and factors. The response is binary and the volume of the data is OK (~100K rows), in order to model ...
1
vote
0answers
151 views

ANOVA on percentages

Please read edit 3 first I am trying to find out the significant factors in a dataset of percentages, a sample of which are below. The difficulty is that the data violates the assumptions of ANOVA, ...
0
votes
0answers
34 views

Parameter covariance matrix for a multivariate (matrix-Y) logit model

I've got a partially-observed unidirectional network. Nodes can be linked (0/1) in one of many ways. For now, lets call them $y_1$ and $y_2$. The unit of analysis is the potential network link ...
0
votes
0answers
58 views

Multi level mixed-effects model in glmer

I have data for a set of users (UID), over numerous dates (date), and over numerous sessions (these are just small chunks of time that a user was active) within each date. For each session I have a ...
1
vote
0answers
38 views

unique spline for different groups in a linear model (and no spline at all for one group)

I have a problem that has puzzled me for a long time. It involves linear models and spline functions. I need to model "time since diagnosis" when some individuals never had a diagnosis. I use Poisson ...