Tamas Ferenci
  • Member for 10 years, 4 months
  • Last seen this week
What are 'aliased coefficients'?
Accepted answer
37 votes

I suspect this is not an error of lm, but rather vif (from package car). If so, I believe you have ran into perfect multicollinearity. For instance x1 <- rnorm( 100 ) x2 <- 2 * x1 y <- rnorm(...

View answer
What does the name "Logistic Regression" mean?
28 votes

As it has been already pointed out, ''logistic'' comes from logistic curve/function/distribution (which is underlying logistic regression). So the question is: where is logistic coming in their names? ...

View answer
If P(A)=0, is A a null event?
13 votes

First of all, note that the term ''null event'' is not unambiguous: some sources use it in a sense ''an event that has zero probability'', while others understand it as ''empty set (as an event)''. As ...

View answer
Expectation of a squared Gamma
Accepted answer
13 votes

The expectation of the square of any random variable is its variance plus its expectation squared, as $\mathbb{D}^2(X)=\mathbb{E}([X-\mathbb{E}(X)]^2)=\mathbb{E}(X^2)-[\mathbb{E}(X)]^2 \Rightarrow \...

View answer
Why is the interaction term defined by multiplying the IVs?
9 votes

Here is an approach. Consider this model: $$Y = \beta_0+\beta_1 X_1 + \beta_2 X_2 + \varepsilon.$$ Now, the marginal effect of $X_1$ on $Y$ ($Y$'s derivative w.r.t $X_1$) is simply $\beta_1$. I can ...

View answer
Example when using accuracy as an outcome measure will lead to a wrong conclusion
7 votes

It might worth adding another, perhaps more straightforward example to Stephen's excellent answer. Let's consider a medical test, the result of which is normally distributed, both in sick and in ...

View answer
On Stationarity and Invertibility of a process
Accepted answer
7 votes

The confusion comes from the fact that these conditions (that you state under the label "can be easily proven") pertain to the $Y_t=\varepsilon_t-\theta_1\varepsilon_{t-1}-\theta_2\varepsilon_{t-2}$ ...

View answer
Linear Model with Categorical Predictor Variable: What's the Math behind it?
6 votes

First of all, days are not ordinal, but nominal. (The elegant way to include them in a regression is to convert them into a factor, you haven't done that, but in this particular case it doesn't matter,...

View answer
Reproducing simple t-test result with ANOVA
Accepted answer
5 votes

I don't really see the problem. For me t.test(A,B,var.equal=TRUE) and summary(aov(c(A,B)~rep(c("A","B"),each=10))) and anova(lm(c(A,B)~rep(c("A","B"),each=10))) all result in $p=0.00268$.

View answer
Comparing two histograms
Accepted answer
5 votes

If you understand a graphical technique under ''comparison'' you should probably try a QQ-plot (qqplot under R). If you are thinking of an analytical way (i.e. statistical test), the two-sample ...

View answer
Shifted log-normal distribution and moments
4 votes

We have $Y^n=(aX+b)^n=\sum_{k=0}^n \binom{n}{k}(aX)^k b^{n-k}$ so $\mathbb{E}Y^n=\mathbb{E}(\sum_{k=0}^n \binom{n}{k}(aX)^k b^{n-k})=\sum_{k=0}^n \binom{n}{k} b^{n-k} a^k \mathbb{E}X^k$. The rest ...

View answer
What are some standard bimodal distributions?
Accepted answer
4 votes

While I am not aware of anything that can be called ''standard'' bimodal distribution, in this particular case, mixture normal distribution seems to be appropriate at first glance. The pdf of such ...

View answer
Exponential distribution hypothesis testing
Accepted answer
4 votes

You can use, for example, two-sample Kolmogorov-Smirnov test with kstest2. (If the other distribution is also available as a sample. If it is a prespecified distribution (e.g. exponential with a ...

View answer
Are all sequences of of random (uniform) numbers also uniformly distributed?
Accepted answer
4 votes

It depends on whether the generator outputs independent variates or not. (I assume from your question that it outputs identically distributed variates.) If it is independent and identically ...

View answer
What is the difference between AIC() and extractAIC() in R?
Accepted answer
3 votes

There are two differences for a usual linear regression model (lm) between AIC and extractAIC: AIC accounts for the estimation of the unknown variance of the error (i.e., scale) while extractAIC does ...

View answer
Why do I get different results when variables are identified as Factor and Int in Generalized Linear Model?
Accepted answer
3 votes

R doesn't know that your variable is nominal (which I assume it should be, if it means sites). More precisely, it knows for Var1 because using letters will make it to have a type of character which ...

View answer
Why include a time trend in a regression?
3 votes

If both unemployment and vacancy have a trend in the long-run, then regressing one against the other would be very misleading. (Every time series with strong positive trend could be well regressed ...

View answer
Possible methods for parameter estimation of a compound Poisson
2 votes

I have no experience on this field, but what about method of moments? We could work it out: \begin{align*} \mathbb{E}\left(Z\right)&=\mathbb{E}\left[\mathbb{E}\left(Z\mid N\right)\right]=\mathbb{...

View answer
Omitted variable bias in regression only containing dummy variables
Accepted answer
2 votes

You're right that the requirement is $\mathrm{cov}\left(x_4,x_1\right)\neq0$. The important part is that $\mathrm{cov}$ doesn't care if any of the variables (or both) is continuous or categorical. You ...

View answer
Sum of squared variables equals Chi-squared implies that the variables are standard normal?
Accepted answer
2 votes

No. The sum of independent $\chi$-squares is $\chi$-squared, so $Y_i\sim\chi_1$ will work, and $\chi_1\neq\mathcal{N}\left(0,1\right)$.

View answer
Does $E(X \mid Y,Z)=0$ imply $E(X \mid Y)=0$?
2 votes

Yes, by the law of iterated expectations (with a slight generalization): $\mathbb{E}\left(X\mid Y\right)=\mathbb{E}\left[\mathbb{E}\left(X\mid Y,Z\right)\mid Z\right]=\mathbb{E}\left[0\mid Z\right]=0$...

View answer
How to convert estimated precision to variance?
Accepted answer
2 votes

Following the suggestion of @BenBolker, I've asked this on the R-INLA mailing list, where I received an extremely rapid and detailed response from Håvard Rue. Briefly, log precision should be ...

View answer
What variables need to be controlled for in regression?
2 votes

Just to add one remark to @Frans Rodenburg's answer: Overadjustment might also be an issue. I.e. you don't want to control for variables for which it is not meaningful to keep them fixed when the ...

View answer
Null Hypothesis on regression coefficients
Accepted answer
2 votes

It is fairly straightforward to test such linear constraints on coefficients with a Wald-$F$ test. For example, in R, you might use the glht function of the package multcomp: lmod <- lm(Fertility ...

View answer
Run Many Small or a Few Big Simulations to Estimate the Mean?
Accepted answer
2 votes

If you run 100,000 simulations, you'll get a very good estimate of the true (population) value of the parameter, but no information -- at least from the simulations -- on its sampling distribution (...

View answer
Clustering Two Variables With Disease Information
Accepted answer
2 votes

First note that this is not a clustering problem in the usual sense of the word. The ''clusters'' what you described are actually called contingency table of Diabetes and CHF. To answer your first ...

View answer
Rank of a matrix in regression hypothesis test?
Accepted answer
2 votes

Your procedure is correct. The rank can be very well interpreted for a single vector as well: the (row) rank will be the number of linearly independent rows. Given that a row vector has a single row ...

View answer
Multivariate normal distribution has peaks
2 votes

Try x1 = -5:.02:5; x2 = -5:.02:5; instead. The problem is that the distribution is quite - but not exactly - parallel to one of your axis. If you consider the $\left\{3.6,3.8\right\} \times \left\{-...

View answer
What does an ARIMA model with 6 values mean?
Accepted answer
1 votes

This is not an ARIMA model (strictly speaking) but a SARIMA - seasonal ARIMA - model. The first set of coefficients (i.e. (2,1,0) in your example) pertains to usual differencing, AR- and MA-terms, the ...

View answer
F-test of joint significance vs multiple t-test for regression parameters?
1 votes

The answer in one word: multicollinearity. If two predictors are correlated it might happen that both is insignificant itself (i.e. with $t$-test), but they are jointly significant (with $F$-test). ...

View answer