Gordon Smyth
  • Member for 5 years, 5 months
  • Last seen this week
Difference between LOESS and LOWESS
39 votes

lowess and loess are algorithms and software programs created by William Cleveland. lowess is for adding a smooth curve to a scatterplot, i.e., for univariate smoothing. loess is for fitting a smooth ...

View answer
Continuous generalization of the negative binomial distribution
Accepted answer
29 votes

That's an interesting question. My research group has been using the distribution you refer to for some years in our publicly available bioinformatics software. As far as I know, the distribution does ...

View answer
If the sum of the probabilities of events is equal to the probability of their union, does that imply that the events are disjoint?
Accepted answer
27 votes

No, but you can conclude that the probability of any shared events is zero. Disjoint means that $A_i \cap A_j=\emptyset$ for any $i\ne j$. You cannot conclude that, but you can conclude that $P(A_i \...

View answer
R: calculate p-value given Chi Squared and Degrees of Freedom
Accepted answer
24 votes

In applied statistics, chisquared test statistics arise as sums of squared residuals, or from sums of squared effects or from log-likelihood differences. In all of these applications, the aim is to ...

View answer
Many p-values are equal to 1 after Bonferroni correction; is it normal?
17 votes

Nothing went wrong. The adjusted p-values are correct. Adjusted $p=1$ simply means no evidence at all for rejecting the null hypothesis. However p.adjust(data2$raw.p, method = "holm") is always ...

View answer
Binomial-binomial is binomial?
16 votes

As Ben points out, you've made an algebraic error and the result is correct. This process is called binomial thinning and, if you search for that expression, you'll find many mentions of it in the ...

View answer
What does the assumption of the Fisher test that "The row and column totals should be fixed" mean?
Accepted answer
16 votes

In my opinion, the source that you link to is wrong in that it is confusing conditioning with assumptions. Fisher's exact test conditions on the margin totals, meaning that it does not use any ...

View answer
How to read scientific notation output (numbers that include "e")?
Accepted answer
15 votes

The "e" is a symbol for base-10 scientific notation. The "e" stands for $\times 10^{\rm exponent}$. So -1.861246e-04 means $-1.861246 \times 10^{-4}$. In fixed-point notation that would be -0....

View answer
Given a GLM using Tweedie, how do I find the coefficients?
Accepted answer
13 votes

Are you familiar with generalized linear models in R? If so, you can fit Tweedie glms just like any other glms. The glm family definition necessary to make this happen is provided by the statmod R ...

View answer
Why does the glm function converge and not give an error when all y's are equal to the same value?
12 votes

In some cases, y is equal to the same value (example 1) for all observations. Theoretically, the model should not converge. Nonsense. This is a very simple dataset for which the maximum likelihood ...

View answer
Linear Regression + confounder
Accepted answer
12 votes

You need to adjust X as well as Y for the confounder The first approach (using multiple regression) is always correct. Your second approach is not correct as you have stated it, but can be made ...

View answer
Can a model for non-negative data with clumping at zeros (Tweedie GLM, zero-inflated GLM, etc.) predict exact zeros?
12 votes

Predicting the proportion of zeros I am the author of the statmod package and joint author of the tweedie package. Everything in your example is working correctly. The code is accounting correctly ...

View answer
Is there a way to calculate R-squared in OLS without computing the coefficients?
Accepted answer
11 votes

No, given a multiple regression, there is no way to compute R-squared while avoiding the bulk of the other computations. You can certainly avoid computing the coefficients themselves, but the main ...

View answer
Does scaling a central $\chi^2$ distribution produce a non-central $\chi^2$ distribution?
Accepted answer
11 votes

Unfortunately, the Wikipedia article on "F-test of equality of variances" is incorrect. When the variances are unequal, the distribution of $F$ is neither $F$ nor non-central $F$, it is simply scaled $...

View answer
How bad is Cholesky decomposition for OLS?
Accepted answer
10 votes

What you are seeing is exactly what one would expect. The condition number of your matrix $X$ is about $10^6$. Double precision floating point calculations give about 18 figures of accuracy so, in ...

View answer
Polynomial Chebyshev Regression versus multi-linear regression
Accepted answer
10 votes

I think you have misunderstood the motivation for Chebyshev polynomials. Chebyshev polynomials are not used for statistical modelling at all --- their purpose is quite different. Chebyshev polynomials ...

View answer
What precisely does it mean to borrow information?
Accepted answer
10 votes

This is a term that is specifically from empirical Bayes (EB), in fact the concept that it refers to does not exist in true Bayesian inference. The original term was "borrowing strength", which was ...

View answer
What is the reason behind the name "adonis" (for permutational MANOVA)?
Accepted answer
10 votes

Actually it isn't -- the statistical method is not called adonis. The authors of the vegan software package for R (http://vegan.r-forge.r-project.org) implemented the statistical procedure you refer ...

View answer
How should this BBC chart (Brexit correlation between education and results) have been drawn?
10 votes

I agree that coloring the quadrants pink is largely cosmetic, but overall I view this as a clear informative plot. The message is immediately apparent and is not misleading. The BBC has plotted the ...

View answer
What are .RDX and .RDB files for R?
Accepted answer
10 votes

Actually, the link you give leads to just two files. The first is a pdf file, as I'm sure you know. The second is a zip file containing an R package. You are supposed to unzip the file, then copy the ...

View answer
Deviance for Gamma GLM
Accepted answer
9 votes

The general derivation of the deviance for a GLM family is given in Section 5.4 of Dunn and Smyth (2018) (the book that you mentioned in a previous post). You can insert the form of the gamma density ...

View answer
What is wrong with the linear regression variance estimator when p+1>n?
9 votes

Nothing is wrong with the formula No, it is not correct that the estimated variance of $\hat\beta$ is zero. There are a couple of errors in your reasoning. First, the MSE is NA rather than 0. The ...

View answer
Using the letter P to represent an event
Accepted answer
8 votes

In mathematics, you can use any notation you like as long as you clearly define the symbols you use and the resulting notation is unambiguous to a reader. Having said that, it will generally be easier ...

View answer
How do you program a custom hypothesis test in R?
8 votes

The hypothesis test functions in the stats package use classic S3 object-orientated programming. You write a function that creates a "htest" object, which is a list with a standard set of components, ...

View answer
Non normal residuals for Tweedie GLM
8 votes

No, a Tweedie GLM assumes that the responses follow a Tweedie distribution so, obviously, neither the data nor the ordinary residuals are expected to follow a normal distribution. No, a Shapiro test ...

View answer
Estimating Normal Distribution Probability Using Simulation in R
8 votes

Your code will run and give a correct answer, but it is written in Fortran-like style. As R code, it is spectacularly inefficient because you're not making use of R's vectorizations. Your code is ...

View answer
Fisher's Exact test implementation in R
Accepted answer
8 votes

You have chosen to do a one-sided test and, obviously, order is important in a one-sided test. Your first call to fisher.test is testing the null hypothesis Pct1 = Pct2 vs the alternative that Pct1 &...

View answer
How does this test compares to Pearson's test?
Accepted answer
7 votes

I think you are trying to rediscover the G-test or likelihood ratio test. Your $H$ is a scaled version of the G statistic, which is defined as $$G=2\sum_{i=1}^m O_i \log(O_i/E_i)$$ with $E_i=n/m$. $G$ ...

View answer
The difference of Standard Error between glm(y~x, family=poisson(link=identity)) and optim() in R
Accepted answer
7 votes

In statistical likelihood theory, minus the second derivative of the log-likelihood function is called the observed information. We might write this as $$ I = -\ddot \ell(y; \theta) $$ where the dots ...

View answer
Conditionally heteroskedastic linear regression: How can I model variance from given predictors?
Accepted answer
7 votes

Simultaneous modelling of mean and variance using double generalized linear models The emphasis of gamlss is obviously on generalized additive models (GAMs). The general of idea of simultaneously ...

View answer
1
2 3 4 5