0
votes
0answers
11 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
10 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
29 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
29 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
41 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
78 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
18 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
27 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
51 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 ...
3
votes
0answers
48 views

Classical or robust variogram for incorporation into generalized linear model [migrated]

I'm modeling counts of organisms over time at eleven locations. I'd like to account for temporal autocorrelation in the counts, assuming it's present. As the data are not equally spaced in time, ...
0
votes
1answer
30 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
49 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
35 views

Logistic regression with multi-class features in R

I'm working with a data set like the following: X = ...
2
votes
0answers
30 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
45 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
20 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
31 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
43 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
17 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
0answers
34 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
65 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
48 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
42 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
79 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
56 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
49 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
61 views

Why are confidence intervals for predicted values so large?

The data for this question can be downloaded with this code: ...
0
votes
0answers
22 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
509 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
63 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
121 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
138 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
23 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
53 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
31 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 ...
6
votes
2answers
163 views

Parameter estimation with generalized linear models

By default when we use a glm function in R, it uses the iteratively reweighted least squares (IWLS) method to find the maximum likelihood estimation the parameters. ...
3
votes
0answers
38 views

Type I error in Negative Binomial GLM

In the following R code, the expected type I error should be 0.05 (I think), but it is consistently greater than 0.05. I want to know why. ...
0
votes
0answers
76 views

Same p-value when comparing two GLM

This is my first question, please should I write something wrong correct me. I have a question when comparing two GLMs after applying stepwise selection. What I've always heard is that stepwise ...
3
votes
1answer
141 views

Feasible Generalized Least Square in R

I am studying the factors influencing the annual salary for employees at a undisclosed bank. The regression model that I have decided to employ is as follows: \begin{equation} ...
1
vote
0answers
33 views

Maximization of Log-likelihood Numerically and Local Maximum Problem

I am maximizing the log-likelihood function for a generalized linear model without using per-written functions like glm due to the form of the model I have. So to ...
1
vote
2answers
151 views

Fit distributions with glm

I'm trying to fit different statistical distributions (Gamma, Poisson, normal, inverse Gaussian) to my data with a glm. An example could be like this: ...
0
votes
0answers
57 views

R: Weights in glm-function

I'm analyzing a vote result in my country and I'm using a logistic model for this task (glm). The population was asked to vote yes or no, which resulted in an approval-value from 0% to 100% for each ...
0
votes
1answer
78 views

Residuals from glm model with log link function

In the following example: ...
1
vote
0answers
71 views

oversampling glm in R: how to define `weights`

Let's say I have 10 positives out of 1000 observations. I'd like to run glm on the 10 positives and a sample of 10 non-positives (so a total of 20 records in the ...
1
vote
0answers
54 views

Prediction method where predictors and response variable are binary

I have a group of binary tasks performed by multiple subjects. Every task can be either performed right or wrong (i.e.,1/0). My goal is to predict the accuracy of future task given the performance on ...
0
votes
2answers
92 views

Does failing a test for heteroscedasticity mean I need to reject the model?

I have a model produced by a logistic regression which tragically failed Breusch-Pagan test. ...
3
votes
1answer
185 views

Confidence Interval for predictions for Poisson regression

This is a follow-up question from this post, here: Confidence intervals for predictions from logistic regression The answer from @Gavin is excellent, but I have some additional questions which I ...
0
votes
0answers
25 views

Linear model in R - 2 fixed and one random factor

I have performed an experiment on plants and have some trouble analysing the data. For the experiment, we have three replicates (in time), two species and three treatments. In each experiment, we ...