8
$\begingroup$

In hypothesis testing, if a question states the level of significance, which is alpha, then does it necessarily mean that we have to use the classical method? (Means finding critical value and then looking at the table). What if I use the p-value to conclude the hypothesis that it is rejected or acceped. Is it correct?

For example:

A random sample of 64 bags of white cheddar popcorn weighed, on average, 5.23 ounces with a standard deviation of 0.24 ounce. Test the hypothesis that
$\mu= 5.5$ ounces against the alternative hypothesis, $\mu<5.5$ ounces, at the 0.05 level of significance

(This is a question from Probability and statistics for scientist and engineers 9th edition) Look at the example.. (above provided) I have been taught to solve this question by finding the critical value and then looking at the table but what I want to do is to use the p-value and then looking at normal-distribution table to state the hypothesis if it's accepted or rejected.

$\endgroup$
13
  • 2
    $\begingroup$ I strongly recommend to look at permutation tests and then bootstrap tests. It will give you the intuition and will free you from a lot of math overhead $\endgroup$
    – Ggjj11
    Commented Oct 25 at 10:33
  • 5
    $\begingroup$ Questions like that one in the book help keep bad statistical practices alive. This was a place for estimation, not hypothesis testing. And note the many problems with $\alpha$. $\endgroup$ Commented Oct 25 at 11:30
  • 3
    $\begingroup$ @Frank Your comment relies on many implicit assumptions that likely are application specific. In other circumstances, such as quality control testing and demonstrating compliance with government standards -- both of them applications of interest to engineers -- this is definitely a testing (or monitoring) situation and does not necessarily reflect "bad statistical practices." $\endgroup$
    – whuber
    Commented Oct 25 at 19:42
  • 4
    $\begingroup$ @Dariober That's precisely my point: there are situations where a binary choice must be made: your product meets specs, your bridge design can be approved, you aren't cheating your customers, and so on. In such situations $\alpha$ is meaningful. One can question whether the prior choice of $\alpha$ is appropriate for the loss function, but not on the basis of "bad statistical practice"! $\endgroup$
    – whuber
    Commented Oct 25 at 21:21
  • 3
    $\begingroup$ @Whuber Frank Harrell's point that a textbook question leads to bad practice is correct even if you allow that sometimes hypothesis testing is appropriate. The absence of any consideration of context and loss function is bad practice and perpetuates the misuse of hypothesis testing even in the industrial acceptance testing circumstances where a binary choice is required. $\endgroup$ Commented Oct 26 at 20:17

5 Answers 5

11
$\begingroup$

I am trying to understand hypothesis testing

I'll leave aside meta-commentary about whether hypothesis tests are a good idea or whether the specific example question you supplied is a good candidate for a question about hypothesis testing and respond to the direct question here. That's not to imply I necessarily disagree with the comments, I simply choose in this case to stick to what I see as the framing of the question.

Glossing over some details, the Neyman-Pearson approach is effectively choose some probabilistic model, choose a test statistic, set a significance level, determine a rejection region from those, then examine whether the test statistic calculated on the sample falls into the rejection region. For simple cases, you can conventionally define the critical value as the least extreme value in the rejection region.

There's an equivalence between the Neyman-Pearson approach and use of p values: If all the steps are done correctly, adopting the rejection rule "reject if $p\leq\alpha$" is entirely equivalent in the sense that the two tests should always reject the same cases and not reject the same cases. That is, for any given sample, you should make the same decision in relation to the hypothesis being tested.

It's also entirely reasonable to do this (use a p-value to make the decision) within a Neyman-Pearson paradigm. One can simply define the p-value itself ― which is simply a transformation of the first test statistic ― as the test statistic of interest and literally everything behaves as it should, entirely inside the paradigm. It's not some weird Frankenstein methodology, it's simply a transformation of a test statistic, no weirder than moving from using say $T$ to $|T|$ as a test statistic when performing a two sided t-test.

does it necessarily mean that we have to [...] finding critical value and then looking at the table

As I lay out above, it's already what you're doing when you use a p-value. (But please do it with "open eyes", not blindly; understand what the attainable significance levels are, understand the properties of any approximations being used and so on.)

If define that your test statistic is the p-value, then your critical value can simply be chosen from among available $\alpha$ values, the labour having been undertaken in the step of transformation between initial test statistic and p-value.

[Ggjj's point in comments about permutation tests etc has some relevance here. If you're used to using them the distinction seems pointless]

If both the original test statistic and this transformed one are treated in the same way, then the decisions should be identical in every case (i.e. the tests should be equivalent).

However, if your question about what you have to do relates to what you're expected to do within a subject you're being taught, we cannot address that.

I have been taught to solve this question by finding the critical value and then looking at the table but what I want to do is to use the p-value and then looking at normal-distribution table to state the hypothesis if its accepted or rejected.

If you do it both ways, what happens?

Indeed, try it on dozens of different examples.

If you can find a case that differs, figure out exactly why; that will enlighten you about something you're doing (arguably wrongly).

$\endgroup$
7
  • $\begingroup$ Thankyou for your oversight! $\endgroup$ Commented Oct 26 at 7:34
  • $\begingroup$ I admit I'm confused myself about all this Fisher vs N-P vs F-N-P... Your answer makes me wonder why we need two or more paradigms since you say There's an equivalence between the Neyman-Pearson approach and use of p values and It's also entirely reasonable to [...] use a p-value to make the decision within a Neyman-Pearson paradigm. Would you mind to elaborate ideally with some example code? (I'm aware this has been address in a million posts, but as I said, I'm still not sure myself I understand,,,) $\endgroup$
    – dariober
    Commented Oct 27 at 16:28
  • $\begingroup$ The Fisherian approach is not just 'use p values', so pulling p values into a Neyman-Pearson approach (which changes it not at all) still leaves the two as distinct as they already were. $\endgroup$
    – Glen_b
    Commented Oct 27 at 20:33
  • $\begingroup$ @dariober I talk about some of those differences here. The major distinction is that Fisherians only treat p values as continuous, whereas NPs treat p-values as dichotomous (to prevent Type I error). The reason this matters in my opinion is the practical fallout of these decisions. NP people often nudge p values below .05 so they can reject, Fisherians avoid the topic of Type I error. NP is just an extension of Fisherian p values. $\endgroup$ Commented Oct 28 at 8:08
  • $\begingroup$ @ShawnHemelstrand I think I've read too much and too superficially about this topic. Glen_b and others (including you?) seem to state that Fisher and N-P can coexist in what is called NHST, which perhaps gives you the best of both worlds. Others (e.g. Perezgonzalez) state that you get an incoherent, incongruent framework. I would like to see a simulation (with code) of an experiment designed, analysed, and interpreted under the three scenarios to see what happens. If this is material for a separate question, I can post one. $\endgroup$
    – dariober
    Commented Oct 28 at 9:03
7
$\begingroup$

If by below you mean the $p$ value:

What if I use the p-method to identify the hypothesis. Is it correct?

Then it depends. Typically, people use the Fisher-Neyman-Pearson approach to null hypothesis testing, which includes the set alpha level for your $p$ value. In this specific case, you can only claim statistical significance if the $p$ value is lower than alpha.

However, this is only one paradigm within frequentism. The neo-Fisherian approach completely abandons setting alpha altogether, but that is less common. There are also Bayesian approaches which neglect the absurdity of null effects completely with things like region of practical equivalence (ROPE) testing instead. However, when using the F-N-P method, we usually can only conclude statistical significance if our $p$ value is within the cutoff. So it will depend on what you are doing.

What if I use the p-method to identify the hypothesis.

I'm not sure what is meant here, but I assume you mean whether or not you can assert some hypothesis as being true or false. A low $p$ value only tells us the probability of finding a statistical estimate from the model, given the null hypothesis. When the probability is low enough to fall below our set alpha, we can only reject the null, but we can neither accept the null, nor accept the alternative, based off the $p$ value alone. By the way, alpha and $p$ are not the same thing. Alpha is essentially a cutoff which helps try to prevent Type I error by making the threshold low, where $p$ values below this provide us less chances that this is made (though this hardly actually works in practice).

$\endgroup$
3
  • $\begingroup$ A low p value doese not give us a probability the null is true given our data, and it is not even conditional on our data like Bayesian probabilities are. Best to revise. $\endgroup$ Commented Oct 25 at 11:28
  • 2
    $\begingroup$ @FrankHarrell you are absolutely right and I seemed to mince my words on that one. I have fixed it to be more accurate. I try to be very careful with the wording on that and still sometimes fudge the semantics. $\endgroup$ Commented Oct 25 at 11:35
  • $\begingroup$ Thankyou for your time. $\endgroup$ Commented Oct 26 at 7:36
7
$\begingroup$

A random sample of 64 bags of white cheddar popcorn are weighed. On average, they weight 5.23 ounces with a standard deviation of 0.24 ounce. Test the hypothesis that = 5.5 ounces against the alternative hypothesis, <5.5 ounces, at the 0.05 level of significance.

In the above, it's not clear to me what you mean by = 5.5.

If you mean "the true mean of the production line is 5.5", I would assume that bag weights are normally distributed and independent from each other (they are i.i.d). So I would calculate the t-statistics given the sample of n=64, mean=5.23, and sd=0.24, in R:

diff <- 5.23 - 5.5
stderr <- (0.24/sqrt(64))
tstat <- diff/stderr # => -9

How extreme is this t-statistics?

p <- pt(tstat, df=63)

p ~ 3.24e-13 which means that in a world where the factory produces with weights from normal distribution with mean of 5.5, you are extremely unlikely to see a sample of n=64 with mean as low as 5.23 and sd=0.24.


If instead you mean "a bag plucked at random from the production line is < 5.5 ounces". I would calculate the z-score given the observed mean, standard deviation and reference weight (5.5):

z <- (5.23 - 5.5)/0.24

Then map this value to a t-distribution with 64-1 degrees of freedom:

pt(z, df=63)
[1] 0.132

This means that given the data and assumptions, ~13% of the bags is expected to weigh 5.5 ounces or more.


Either way, I don't see the point in setting a significance threshold, at least in the way the question is phrased.

$\endgroup$
1
  • $\begingroup$ Thankyou for your time. $\endgroup$ Commented Oct 26 at 7:35
5
$\begingroup$

Comparing a test-statistic to a critical value at a significance level $\alpha$, and computing the associated p-value and comparing it to $\alpha$ are equivalent ways of performing hypothesis testing.

$\endgroup$
3
$\begingroup$

Thanks to the OP for indicating where the question came from (wish more OP's would do so). This book is often used for undergrad stats for engineers (i.e. applied statistics, for non statisticians), and is purely frequentist (except for the very last chapter, which briefly intriduces Bayesian statistics, over 10 pages...). The textbook does not even mention bootstrap, or permutation (a sad situation, typical of many (most?) common textbooks). That specific question is at the end of chapter 10, "One- and Two-Sample Tests of Hypotheses".
Even w/o the background/context of the textbook, this is a classic industrial QC application, where one is checking if the manufacturer is actually "cheating" its customers (a situation which could be extremely costly for the manufacturer, if it were true).

So it is clear that a "classic" frequentist hypothesis test is called for in this case.

Now the OP asks whether the fact that the questions specifies a significance level $\alpha$ implies using the "classic method" (not sure what is meant by that?) or can she use the "p-value". But the p-value only makes sense if we have a significance level, because we can only reject the null if $p<\alpha$. So the mention of $\alpha$ does not at all rule out the use of a p-value.
In fact, the 2 are the same; the "classic method", will compute a t-statistic (in this case, for this test of a single mean), then will look it up in a table (or a computer will do that), and will see that the probability for obtaining this test statistics, or more extreme, is $p$, and will return $p$, the p-value. So the 2 methods are one and the same; yes, you can do the work by hand, and use a table, or you can let the computer/calculator, etc. do it and give you the p-value. It is the same statistic being applied (which I think is what is most important for the OP to understand in this case)
Then, the student will compare $p$ to $\alpha$, and decide to either reject, or fail to reject, the null hypothesis, that the manufacturer gives its customers an average of 5.5oz of popcorn per bag.

$\endgroup$
1
  • $\begingroup$ Thankyou for your time. $\endgroup$ Commented Oct 26 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.