1
$\begingroup$

I'm struggling to connect the idea of a sampling distribution of a test statistic to the null distribution.

If I run many simple linear regressions on samples extracted from a population of data I can create sampling distributions of my test statistics, in this case for the slope and the intercept.

f <- function () {
  fit <- lm(dist ~ speed, data = cars, subset = sample(nrow(cars), 30))
  coef(fit)
}
set.seed(0); f()
set.seed(0); z <- t(replicate(50, f()))
par(mfrow = c(1,2))
hist(z[,1], main = "intercept")
hist(z[,2], main = "slope") # code taken from http://stackoverflow.com/questions/40210817/replicate-a-regression-using-a-random-subset-of-data-each-time-and-check-distrib?noredirect=1&lq=1
m1<-lm(dist ~ speed, data = cars) # compare to population coeffs
print(m1)

I know that the null distribution will be a t-distribution with mean of 0 and affected by the degrees of freedom I have. But how is this null distribution produced?

$\endgroup$
  • 1
    $\begingroup$ The NULL distribution is assumed to be the correct distribution. Put crudely, it is made up or pulled out of thin air. You could just as soon assume that the NULL distribution is normal with a mean of 5 and a standard deviation of 2. The idea is to compare what you see in the data against whatever distribution you select in order to see if the evidence supports this assumption. $\endgroup$ – lmo Jan 5 '17 at 12:36
  • $\begingroup$ Thanks for your response. The mean of the null distribution makes sense to me and that it could take on any value depending on our null hypothesis. But how is the standard deviation of the null distribution defined? $\endgroup$ – adkane Jan 5 '17 at 12:39
  • 2
    $\begingroup$ It is defined in the same way. If theory/tradition suggests that you should use a t-distribution as the NULL, then the standard deviation is built into the distribution, based on the sample standard deviation and the sample size. Recall that the t statistic formula of a one sample test: $t = \frac{\bar{x} - \mu}{s / \sqrt{n}}$ $\endgroup$ – lmo Jan 5 '17 at 13:01
  • $\begingroup$ Ah okay, so for the case of the t statistic formula 's' is the sample standard deviation $\endgroup$ – adkane Jan 5 '17 at 13:08
  • $\begingroup$ Right. The formula is more complicated in regressions, but it amounts to the same thing, that the standard deviation or measure of spread is a function of the data. $\endgroup$ – lmo Jan 5 '17 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.