New answers tagged

0 votes

Logistic regression with highly left-skewed data for the independent variable

For an issue like this, I would suggest collapsing values of the saturation variable into three categories $k=3$: $1-\textrm{Saturation}\leq 50\%$; $2-50\%>\textrm{Saturation}\leq 95\%$; $3-\textrm{...
wjktrs's user avatar
  • 817
1 vote

Logistic regression with highly left-skewed data for the independent variable

First, the variable shown will have negative skewness as it has a long tail at the low end. I'm not sure what went wrong with your calculation. In your title, you correctly say "left skew" ...
Peter Flom's user avatar
  • 118k
2 votes
Accepted

How can I fit a curve to my data?

This is because you have to precise which family of distribution and link function you want to use. If you don't, then the default family is gaussian and link function is linear and gives you a linear ...
lulufofo's user avatar
  • 482
0 votes

How to use principal components as predictors in GLM?

Its funny that this question is yet to be answered correctly, despite of the additional clarification provided. I want to use PCA to avoid using correlated variables in the GLM. However, PCA gives me ...
Roshan Satapathy's user avatar
0 votes

GLM: invalid value encountered in log special.gammaln

Your data doesn't fit a binomial distribution. In R you would not be able to run this code, but statsmodels doesn't throw an ...
Maverick Meerkat's user avatar
2 votes

What is theta in a negative binomial regression fitted with R?

Here comes an attempt to clean up the "Negative Binomial Parametrisation Confusion". In the following, $\mathrm{NB}(x; \ldots)$ stands for the PMF of the Negative Binomial (N.B.). The $(r,p)...
András Aszódi's user avatar
1 vote

OLS uses t-test but GLM uses z-test in statsmodels python

To add to Josef's answer: unlike R, the statsmodels library doesn't choose between t and z statistics automatically. The (...
Maverick Meerkat's user avatar
1 vote
Accepted

Interpretation of interaction plot from GLM

The y axis is the conditional expectation. It is interpreted depending on what you pass as covariates to the predict method for glm.nb. Let's see a small example. ...
Demetri Pananos's user avatar
3 votes

How to decide on the family type for variables with bimodal distribution in GLM?

GLM (generalised linear model) is a generalisation of OLS (Ordinary least squares) by allowing more types of conditional distributions wrapping the linear descriptor in a link functions to describe ...
Sextus Empiricus's user avatar
4 votes

How to decide on the family type for variables with bimodal distribution in GLM?

As was mentioned in the comments, a linear model does not assume that the response is normally distributed, rather that the error is. The estimate for the latter is conditional on the fit! Consider ...
PBulls's user avatar
  • 3,858
2 votes

How to model predicted proportion data without weights

Those plots are not valid for the ordered beta distribution, which is a mixture of discrete and continuous responses. To get a better view of fit, use the pp_check_ordbeta function in the ordbetareg ...
Robert Kubinec's user avatar
1 vote
Accepted

Added more data and suddenly GLMM fails to converge (R)

Outlier deletion is questionable at the best of times, as it is basically throwing way information, but in your case you detect 10% of your data as outliers, which is just unacceptable. Also if you ...
Lukas Lohse's user avatar
  • 2,472
3 votes

Suitable GLM function in R for skewed continuous percentage abundance data

In that histogram you're examining the marginal distribution, which is not a useful strategy $-$ a GLM is a model for the conditional distribution which may be quite unlike the marginal (e.g. it may ...
Glen_b's user avatar
  • 282k
3 votes
Accepted

Suitable GLM function in R for skewed continuous percentage abundance data

This is a rare case where I would consider dichtomizing the data to 0 and 100 and then using logistic regression. Another possibility is to use Poisson or negative binomial regression on the count ...
Peter Flom's user avatar
  • 118k
1 vote

How to calculate an effect size and confidence interval after running a Generalised Estimating Equation?

We can't help with the "is this correct" because that is predicated on the scientific question at hand and something only you and subject-matter experts can determine. If you are naive to ...
jpsmith's user avatar
  • 329
0 votes

Logistic regression via robust glm (glmrob) not appropriate if have only one observation in one of two categories of an independent variable?

What you're describing is quasi-complete separation in your data. A strategy for dealing with this is Firth's (bias-reduced) logistic regression which uses a penalized likelihood estimation method. ...
Jack's user avatar
  • 118
2 votes

Design Matrix for a Bradley Terry Model

The Bradley-Terry model supposes the log odds (aka the logit) of the chance that team $i$ beats team $j$ is the difference of a parameter $\lambda_i$ and a parameter $\lambda_j:$ $$\operatorname{logit}...
whuber's user avatar
  • 322k
0 votes

Design Matrix for a Bradley Terry Model

Because, we are doing pairwise comparisons, the number of columns will be the individual teams and each row is one pairwise comparison, using the model that is given the first row will look like below....
Harry Lofi's user avatar
1 vote

How to transform my sparse count data into normal distribution?

You should use a Poisson regression (or in case of overdispersion, maybe negative binomial or quasi-Poisson regression). There is no assumption of normality in those models, so no need for ...
kjetil b halvorsen's user avatar
1 vote
Accepted

binomial GLM for proportion Vs Beta regression

Provided that there are enough cases so that the proportions can be considered to be sampled from continuous distributions, the choice depends on your understanding of the nature of the sampling. Beta ...
EdM's user avatar
  • 91.8k
0 votes

What is the distribution of the model prediction and the expectation of the model prediction in linear regression?

It is common to assume the errors are $iid$ Gaussian (so the conditional distributions $Y\vert X$ are Gaussian) because the maximum likelihood estimation is equivalent to minimizing the sum of squares....
Dave's user avatar
  • 61.6k
1 vote

Understanding the significance of a few results derived in the course of linear regression

$\sigma^2 tr((X^TX)^{-1}$ is telling us something about how difficult the regression problem is. First, $tr((X^TX)^{-1})$ is equal to the sum of the reciprocals of the eigenvalues of $X^TX$. So, if $X^...
user1848065's user avatar
2 votes

What's the practical meaning of alpha in a GLM with gamma family?

The gamma distribution can be expressed as a distribution from the exponential dispersion family and the $\alpha$ parameter works like the inverse of the dispersion parameter. $$f(x;\theta, \phi) = h(\...
Sextus Empiricus's user avatar
1 vote

Application of robust Poisson regression

One wouldn't ever realistically use a Poisson regression for a binary response. This seems much easier to model with a logistic regression instead, regardless of whether or not the data belongs to a ...
Shawn Hemelstrand's user avatar
0 votes

glm() with binary outcome not specify family = binomial

You ran a linear probability model. While there are issues with such a model, it is a model that exists in the statistics literature and has its advocates. Most of the advocacy I have seen for linear ...
5 votes

glm() with binary outcome not specify family = binomial

not really looking stupid like “i tried a different approach blah blah and found this!” Your updated results would not be a different approach. They would reflect a correct approach. Or, at least, a ...
5 votes

glm() with binary outcome not specify family = binomial

I'm sure you have the sympathy of many people here; that's an unpleasant situation to find yourself in. It's also probably worth noting that some people might give different advice on a public ...
2 votes
Accepted

Is a binomial logistic regression valid in this case, and how do I use it / interpret its results?

Shawn's answer (+1) covered most of what I would have said. Just a little bit of elaboration follows. Fitting the model and getting the coefficients is only the first step. That doesn't by itself ...
EdM's user avatar
  • 91.8k
3 votes

Is a binomial logistic regression valid in this case, and how do I use it / interpret its results?

First, I think the $p = .000$ just isn't being precise enough. You likely have a very large decimal value that is cutoff by the output here (I'm not sure how this works in Python so I am making ...
Shawn Hemelstrand's user avatar
4 votes
Accepted

Geometric understanding of linear regression

Rather than $Y=\beta X+\varepsilon,$ you need $Y= X\beta+\varepsilon.$ The matrix $X$ has $n$ rows and $p$ columns and $\beta$ has $p$ rows and just one column, so $X$ needs to be on the left and $\...
Michael Hardy's user avatar
2 votes
Accepted

Interpreting a rootogram

How would one interpret this plot? Your understanding seems correct: the red lines/dots show the expected (square root) frequencies that the model predicts, the grey bars show the (discrepancy from) ...
PBulls's user avatar
  • 3,858
1 vote

Pearson chi squared test vs deviance test in GLM

Generally, the G-test is useful in case of categorical data, but when we see the concept of "Goodness of fit", the more powerful test is chi-square test as compared to the LRT. Also I would ...
Awais Munir's user avatar

Top 50 recent answers are included