# Tag Info

## New answers tagged generalized-linear-model

0

To follow up on my comment, it may be possible to recover the proportions of hits and false alarms, allowing modelling of the data via a GLM as indicated in the other answer that you linked. To do so however you'd need to know the number of trials run in each condition, and the value of the other signal detection theory parameter, that is the criterion $c$. ...

0

If I understand this correctly, you want to be able to determine which of 2 peaks a new value selected from your horizontal axis corresponds to. A logistic regression model should be able to do that pretty well. Consider each of your peaks to represent 1 of 2 classes, and collect a set of values representing both class membership and the horizontal-axis ...

0

When including an interaction in a regression, you should always center (= x - μ) to maintain interpretability of the main effects (by centering, main effects are calculated for the mean value of x). Whether you divide by sd is up to you. The standardising by sd is usually done to make regression estimates directly comparable. A side effect is that it ...

0

Quasi-likelihood theory is as valid with underdispersed data as it is with overdispersed data, so you could just go that way. But, I would be careful, context matters a lot. While overdispersion is quite common, and is easily explained by simple mechanisms, that is not the case with underdispersion! For instance, extra, unmodeled (or unobserved) variation/...

0

The number of data points is to low to read much into the residual plot. In a comment this is explained with If you discard 5 points with fitted values >=8, you will find that variation of the residual increases along the fitted values, and it is what the Poisson regression should be. So I do not think you need to worry about Poisson assumption. – ...

4

This was a reply to @Victor's comment on @mkt's answer, but it grew rather large, and I suppose it answers the question. The point of using a GLM is to allow different error distributions than Gaussian. Is the data generating process continuous, with a central tendency and can it take on both positive and negative values? Then a regular LM is a decent ...

10

Another great answer from @mkt on this forum. Here are a few more pointers you might find useful. GLMs include some widely used types of regression models: Binary Logistic Regression Models; Binomial Logistic Regression Models; Multinomial Logistic Regression Models; Ordinal Logistic Regression Models; Poisson Regression Models; Beta Regression Models; ...

0

First, the 0 cells mean that you will have quasicomplete separation, which makes the results of logistic regression look the way yours did - that is, huge standard errors around the parameter estimates. Second, I'm not sure what you are doing a t-test on, but a t-test compares two means. You don't have two means. Third, if this is really all the data you ...

12

As with many other cases in statistics, the goal of finding a single test to replace one's judgement is a bad one. There are several sources of information you can and should use while deciding: the theoretical expectation of the distribution, prior empirical work on the topic, the properties of the data (e.g. is it truncated or zero-inflated?), and the ...

1

You ask: Would you rely on the log-transformation? Or would you rather use a non-parametric method? for me, that would depend on what the variables are and what my question is. Does taking the log make substantive sense? It often does make sense for variables involving money (such as income, wealth, expenditures) because we tend to think of those ...

5

1) You do not need the raw data to be normally distributed. It's only the residuals that need to be. 2) Removing 'outliers' is generally a bad idea unless you have very good reason to believe that those data points are invalid for some reason, such as instrument failure. 3) If the residual distribution is actually a problem, you can still avoid log ...

1

Stepwise variable selection tends to provide too optimistic results (too low p values etc). The main critique with the method is that researchers often ignore that fact and present the model results without mentioning that bias. In your comparison, the focus is not on how valid the results are but on how the method competes with alternative modelling ...

0

@whuber is correct. Your tabulation yields: 1 4 8 13 A 0 1 0 0 C 0 0 0 1 H 0 1 0 0 K 0 0 1 0 V 0 1 0 0 HG 1 0 0 0 This treats the counts (1, 4, 8, 13) as fixed levels of a categorical variable. It seems you want to test if the counts are approximately equal. If we take the sum (26) as the total, out of which, say, 13 became ...

0

I sense two areas of confusion here. One is the logarithmic data transformation of predictor variables (like mapping Time to TimeLog) versus the logarithmic link function used in the generalized linear model. The former has to do with the predictor variables, the second with the response variable and its relationship to the linear part of the model. In ...

3

As Isabella Ghement also mentioned in her comments, it seems that you have a count variable. Hence, you could instead try fitting a Poisson or negative binomial mixed effects model. Both typically specify a log link function, resulting in the same type of model for the mean as the one you specify with the Gamma mixed model. In some implementations, such as ...

0

There's no indication here that you need anything other than a normal distribution. It's possible, but none of the information you present supports that. Your dependent variable is continuous and unbounded, so there's no need for Poisson, logistic, etc.

1

According to the Frequentists' theory and MLE, the model and other following statistical tests only work correctly when it follows the real underlying data generating distribution. If the data is sampled by Poisson distribution from your project context, Poison regression should be used rather then Ordinal regression. Firstly, Poisson distribution is the ...

0

If the non-negative integers have true integer "meaning" (i.e. 3 represents a quantity three times what 1 represents), and particularly if they represent arrivals in a process, then Poisson regression is a good place to start. For example, if these are numbers of purchase orders from customers, and you want to predict the number of purchases a customer will ...

3

A famous adage states that sample size is where you randomize. It seems that you have randomly assigned (?) 4 plants to treatment and 5 plants to control. So even if you go for the suggested Wilcoxon's rank sum test on the differences, you would have a fairly low overall sample size of 9 plants. Additionally, it it usually the case that nonparametric ...

2

Yes, it is true. And, I can't think of an exception when that would not be the case. But, you have to watch out about your data set, and when you test your model against new data. Let's say variable A has a standardized coefficient of 1.0 and variable B has one of 0.75. So, variable A is more influential than variable B. However, in your new data set ...

5

I would generally recommend your option #4, collapsing the two factors to a one-way layout that includes all of the possible combinations. That way you can fit models without (1) throwing away cases with "missing" data or (2) running into rank-deficiency problems. You can still estimate all the things you want (e.g. difference between W and WO for ...

1

A couple of points: It seems to me that you could your outcome as a count, i.e., the number of frog callings in a three hours period. Hence, you could fit a mixed effects Poisson or negative binomial models (the latter accounts for over-dispersion). These are, for example, provided by the GLMMadaptive package I have written; you can find several examples ...

4

In the following linked paper you have a detailed answer: in short, MLE will try to set the estimated coefficients to +/inf, as explained at pag.340-341 of this paper that is a very good suggested reading. If you need practical remedies, and examples/solutions to be implemented in R consider also this answer in addition to the previous text. And this ...

0

Generalizing this recipe to GLMs indeed is not difficult as GLMs are usually fit using iteratively reweighted least squares. Hence, within each iteration one can subsitute the regular weighted least squares step with a ridge penalized weighted least squares step to get a ridge penalized GLM. In fact, in combination with adaptive ridge penalties this recipe ...

0

By Wilks' theorem, if the two models are the same, then $-2 \log \Lambda$ is $\chi^2$-distributed (where $\Lambda$ is the likelihood ratio). The statistic and its p-value can be obtained, e.g., by running anova(x1, x2) in R, where x1 and x2 are results from the glm function. I discovered this result after being pointed in the right direction by user2974951'...

1

For the record, a simple pure R implementation of R's glm algorithm, based on Fisher scoring (iteratively reweighted least squares), as explained in the other answer is given by: glm_irls = function(X, y, weights=rep(1,nrow(X)), family=poisson(log), maxit=25, tol=1e-16) { if (!is(family, "family")) family = family() variance = family\$variance ...

0

I made a mistake: pbinom() is for the cumulative distribution function whereas I should use dbinom() for the density/mass function. And all is ok now ! I do not delete the question just in case someone did the same mistake as me !

1

The "base" level (often called the 'reference level') should not have been left out of the model. It is represented by the intercept. The other levels are typically specified in your output, but those coefficients are not actually the values for those levels, instead they are the differences between the values for the indicated level and the base level. ...

1

I() means "as is" (see ?I): this is needed because operators such as ^ and * have different meanings in a formula context than when they are doing regular computation. I(age^2) and I(age*age) are equivalent; they both mean to add an "age-squared" term to the model. If the formula contained unprotected age^2 or age*age terms, it would denote the interaction ...

1

The relative importance is based on the coefficients, the scaled importance is the relative importance scaled between 0 and 1. You can see the normalized coefficients for comparison by using h2o.coef_norm().

Top 50 recent answers are included