Can someone help me understand the meaning of the p-value of the Whelch's T Test in SciPy?   test = stats.ttest_ind(x, y, equal_var=False)   gives me    Ttest_indResult(statistic=5.4320992218489925, pvalue=7.614106565771353e-08)   But with a statistic of 5.43, shouldn't be a 0.00000... p-value according to the T table instead?
33635
I have a problem with the interpretation of a test result in which the p-value is 8.6e-28. How should it be interpreted? What is the e for?  Specifically, I used White's Test for the homoscedasticity assumption of a linear regression:  White's general test statistic :  150.0535  Chi-sq( 9)  P-value =  8.6e-28
52646
I am using the Kolmogorov&ndash;Smirnov two-sample test to compare distributions, and I noticed a $p$-value is frequently reported as the test statistic. How is this $p$-value determined? I know it's the probability of obtaining a result at least as large as the one obtained, but how is this $p$-value determined given this is a nonparametric test? That is, we can't assume Gaussian fluctuations in the distribution and compute the $p$-value using a $t$-test.  Thanks!
84938
I'm trying to conduct a Student's t-test for a table of values while trying to follow the explanation and details found on . I understand that if the p-value is   &lt;.01 then it's really significant >.05 it's not significant in between then we need more data   But on that page they seem to accept their null hypothesis no matter what the p-value is. So I'm really not understanding now when to accept or reject the null hypothesis.    When you do you accept or reject the null-hypothesis? Is it true that you are never supposed to accept your null hypothesis, but rather reject or fail to reject the null?
80269
I am testing Mann-Whitney rank test with two vectors a and b. Vectors are almost similar so I expect a p-value near 0, but the returned p-value is near 1. What is the reason? I read  and also run the code with different parameters, but don't get anything near to what I expect.  from scipy.stats import mannwhitneyu import operator import numpy as np  a = [1000,100,10,1,10,100,1000,10000,1000,100,10,1] b = [999,100,10,1,10,100,1000,10000,1000,100,10,1]  print(mannwhitneyu(a, b))   The output of the code:  MannwhitneyuResult(statistic=73.5, pvalue=0.95291544831453867)   Edit:  Let's formalize the problem to eliminate any misunderstanding (please edit the question if something is wrong):  What I try to prove is that rank distribution of data are approximately equal,   Null hypothesis ($H_0$)= "ranked distribution of a and b are approximately equal"  Alternative hypothesis ($H_a$)= "ranked distribution of a and b are not equal"  significance level (alpha) = 0.05  p-value= 0.95  (p-value > alpha) so there is no sufficient evidence that $H_a$ is correct, but we cannot also conclude that ($H_0$) is true.   Instead if (p-value &lt; alpha) was true, then we would have enough evidence against H0 and Ha can be accepted.  So what happened here is that I could not disprove the null hypothesis. However, it doesn't mean that null hypothesis is false. It is like an investigation to accuse MR X of being guilty:   $H_0$=" MR X guilty" $H_a$=" MR X not guilty"  We guess he is not guilty, but we don't have enough proof against him: (p-value > alpha), but that doesn't mean that ($H_0$) would not be true. If we could obtain enough evidence and state (p-value &lt; alpha), then we disprove $H_0$ and we can conclude that Ha is true and he is not guilty.
71540
Often people use programs to obtain p-values, but sometimes - for whatever reason - it may be necessary to obtain a critical value from a set of tables.   Given a statistical table with a limited number of significance levels, and a limited number of degrees of freedom, how do I obtain approximate critical values at other significance levels or degrees of freedom (such as with $t$, chi-square, or $F$ tables)?  That is, how do I find the values "in between" the values in a table?
116221
For example, the 99 percentile value of list A is p99_a, the 99 percentile value of list B is p99_b, list C is the full set of A and B, should the 99 percentile value of list C be the 99 percentile value of p99_a and p99_b or the average value of p99_a and p99_b?  I always thought it should be the former one, however, I tried it on codes:  import numpy as np import random data = [] p99list = [] for i in range(10000):     one_data = [random.randrange(10000) for x in range(1000)]     data += one_data     p99list.append(np.percentile(one_data, 99))  print('p99 of all data: \t' + str(np.percentile(data, 99))) print('average of p99: \t' + str(np.average(p99list))) print('p99 of p99 : \t' + str(np.percentile(p99list, 99)))   The results were:  p99 of all data:    9899.0 average of p99:     9889.646635999998 p99 of p99 :    9952.01   It showed that average of p99 was closer to the p99 of all data than p99 of p99. On the Contrary, if I changed the sixth line of code to as follows (on the purpose of simulating the response time of HTTP requests from one server):  one_data = [random.uniform(0.2, 0.4) for x in range(1000), random.uniform(1.0, 1.2) for y in range(5)]   I ran the code again, and the results were:  p99 of all data:    0.39801099789433964 average of p99:     0.37998116766051837 p99 of p99 :    0.39904330107367425   It turned out that p99 of p99 was closer to the p99 of all data than average of p99.  So which one is more accurate?
470
On the , there is this line:      $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.)    How can a value $&gt;1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page?
10764
Is there any intuitive way to interpret the standard deviation regardless of the probability distribution?  So for example, for the normal distribution, I know how to interpret being within 1 standard deviation - there is a a 68% of being there. For other distributions I can calculate this probability as well.  But if I don't know the distribution, how is it a meaningful statistic? Is it only meaningful in relation to other random variables that we know follow the same distribution, but have a different standard deviation?
79869
I have the mean and standard deviation of a large sample (30k obs) and the mean and std of a subsample (2k obs). The means are percentage figures (i.e. between 0 and 100% and hence not a normal variate). Also the means are not independent, since one is based on a subsample from the other.    Despite seemingly a harmless question, I could not find an appropriate testing procedure. Any ideas on how to test whether the mean of the subsample is different to the mean of the entire sample are much appreciated.
62396
I have been reading Geoff Cumming's 2008 paper  [~200 citations in Google Scholar] -- and  am confused by one of its central claims. This is one in the series of papers where Cumming argues against $p$-values and in favour of confidence intervals; my question, however, is not about this debate and only concerns one specific claim about $p$-values.   Let me quote from the abstract:     This article shows that, if an initial   experiment results in two-tailed $p= .05$, there is an $80\%$   chance the one-tailed $p$-value from a replication will fall in   the interval $(.00008, .44)$, a $10\%$ chance that $p &lt; .00008$,   and fully a $10\%$ chance that $p &gt; .44$. Remarkably, the   interval—termed a $p$ interval—is this wide however large   the sample size.   Cumming claims that this "$p$ interval", and in fact the whole distribution of $p$-values that one would obtain when replicating the original experiment (with the same fixed sample size), depend only on the original $p$-value $p_\mathrm{obt}$ and do not depend on the true effect size, power, sample size, or anything else:     [...] the probability distribution of $p$ can be derived without   knowing or assuming a value for $\delta$ (or power). [...] We do not assume any prior knowledge   about $\delta$, and we use only the information $M_\mathrm{diff}$ [observed between-group difference] gives about $\delta$ as   the basis for the calculation for a given $p_\mathrm{obt}$ of the distribution of   $p$ and of $p$ intervals.      $\quad\quad\quad$    I am confused by this because to me it seems that the distribution of $p$-values strongly depends on power, whereas the original $p_\mathrm{obt}$ on its own does not give any information about it. It might be that the true effect size is $\delta=0$ and then the distribution is uniform; or maybe the true effect size is huge and then we should expect mostly very small $p$-values. Of course one can start with assuming some prior over possible effect sizes and integrate over it, but Cumming seems to claim that this is not what he is doing.  Question: What exactly is going on here?    Note that this topic is related to this question:  with an excellent answer by @whuber. Cumming has a paper on this topic to:  -- but that one is clear and unproblematic.  I also note that Cumming's claim is repeated several times in the 2015 Nature Methods paper  that some of you might have come across (it already has ~100 citations in Google Scholar):     [...] there will be substantial variation in the $P$ value of repeated experiments. In reality, experiments are rarely repeated; we do not know how different the next $P$ might be. But it is likely that it could be very different. For example, regardless of the statistical power of an experiment, if a single replicate returns a $P$ value of $0.05$, there is an $80\%$ chance that a repeat experiment would return a $P$ value between $0$ and $0.44$ (and a $20\%$ change [sic] that $P$ would be even larger).   (Note, by the way, how, irrespective of whether Cumming's statement is correct or not, Nature Methods paper quotes it inaccurately: according to Cumming, it's only $10\%$ probability above $0.44$. And yes, the paper does say "20% change". Pfff.)
102327
Let's say I have a large sample ($n&gt;30$) with mean $\bar{X}$ and standard deviation $S$. I can calculate only: $T=\frac{\bar{X}-\mu}{S/\sqrt{n}}$.  If I want to use t-test for a hypothesis, then I have to assume normality of the population. If I want to use z-test for a hypothesis, then I have to assume that $\boldsymbol{s\approx\sigma}$.  What is the less important assumption? What test should I do? Should I do t-test, z-test or doesn't matter?
100987
I was reading on the computation of the unbiased estimation of standard deviation and the source I read stated      (...) except in some important situations, the task has little relevance to   applications of statistics since its need is avoided by standard   procedures, such as the use of significance tests and confidence   intervals, or by using Bayesian analysis.   I was wondering if anyone could elucidate the reasoning behind this statement, for example doesn't the confidence interval use the standard deviation as part of the calculation? Therefore, wouldn't the confidence intervals be affected by a biased standard deviation?  EDIT:  Thanks for the answers so far, but I'm not quite sure I follow some of the reasoning for them so I'll add a very simple example. The point is that if the source is correct, then then something is wrong from my conclusion to the example and I would like someone to point how how the p-value doesn't depend on the standard deviation.  Suppose a researcher wished to test whether the mean score of fifth graders on a test in his or her city differed from the national mean of 76 with a significance level of 0.05. The researcher randomly sampled the scores of 20 students. The sample mean was 80.85 with a sample standard deviation of 8.87. This means: t = (80.85-76)/(8.87/sqrt(20)) = 2.44. A t-table is then used to calculate that the two-tailed probability value of a t of 2.44 with 19 df is 0.025. This is below our significance level of 0.05 so we reject the null hypothesis.  So in this example, wouldn't the p-value (and maybe your conclusion) change depending on how you estimated your sample standard deviation?
21116
Let ${Y_1,...,Y_n}$ be independent random variables and $Y_i$~$N(\beta x_i, 1)$ where $x_1,...,x_n$ are fixed known constants, and $\beta$ is an unknown parameter.  I'm looking to find the p-value or rejection region for  the test  $$H_0: \beta=0 \quad \text{vs} \quad H_1:\beta\ne0$$  The Likelihood Ratio Test statistic $\Lambda$ is  $$e^{-1/2\left(\frac{\sum_{i=1}^n y_i x_i}{\sum_{i=1}^n x_i^2}\right)^2\sum_{i=1}^n x_i^2}$$  I have already asked a similar question with $H_1: \beta&gt;0$ here: .   After setting $\Lambda &lt; k$ I'm left with $\sum x_iy_i$ after removing constants to the right, which is the same as my previous question. How will finding the p-value or rejection region for this test differ?
85974
Suppose that $T_1,…,T_{10}$ are iid $Exp(λ)$ and the goal is to test if $H_0:λ≤1$ versus $H_a:λ≥2$. Suppose that the test statistic is $S=\sum_{i=1}^{10}T_i$, and rejection of the null occurs when $S≤7$.  I realize that $T_1...T_{10}$ is a gamma distribution  of $S =Gamma(10, \lambda$), but I am not sure how to use this information to find the p-value for the type 1 error.
68510
Why can't we  separately test each variable(using t-test), whether or not it is equal to 0? Why should we use the F-test for checking if all coefficients combined are equal to 0?
16711
The help pages in R assume I know what those numbers mean, but I don't. I'm trying to really intuitively understand every number here. I will just post the output and comment on what I found out. There might (will) be mistakes, as I'll just write what I assume. Mainly I'd like to know what the t-value in the coefficients mean, and why they print the residual standard error.   Call: lm(formula = iris$Sepal.Width ~ iris$Petal.Width)  Residuals:      Min       1Q   Median       3Q      Max  -1.09907 -0.23626 -0.01064  0.23345  1.17532    This is a 5-point-summary of the residuals (their mean is always 0, right?). The numbers can be used (I'm guessing here) to quickly see if there are any big outliers. Also you can already see it here if the residuals are far from normally distributed (they should be normally distributed).  Coefficients:                  Estimate Std. Error t value Pr(&gt;|t|)     (Intercept)       3.30843    0.06210  53.278  &lt; 2e-16 *** iris$Petal.Width -0.20936    0.04374  -4.786 4.07e-06 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1    Estimates $\hat{\beta_i}$, computed by least squares regression. Also, the standard error is $\sigma_{\beta_i}$. I'd like to know how this is calculated.  I have no idea where the t-value and the corresponding p-value come from. I know $\hat{\beta}$ should be normal distributed, but how is the t-value calculated?  Residual standard error: 0.407 on 148 degrees of freedom   $\sqrt{ \frac{1}{n-p} \epsilon^T\epsilon }$, I guess. But why do we calculate that, and what does it tell us?  Multiple R-squared: 0.134,  Adjusted R-squared: 0.1282    $ R^2 = \frac{s_\hat{y}^2}{s_y^2} $, which is $ \frac{\sum_{i=1}^n (\hat{y_i}-\bar{y})^2}{\sum_{i=1}^n (y_i-\bar{y})^2} $. The ratio is close to 1 if the points lie on a straight line, and 0 if they are random.  What is the adjusted R-squared?  F-statistic: 22.91 on 1 and 148 DF,  p-value: 4.073e-06    F and p for the whole model, not only for single $\beta_i$s as previous. The F value is $ \frac{s^2_{\hat{y}}}{\sum\epsilon_i} $. The bigger it grows, the more unlikely it is that the $\beta$'s do not have any effect at all.
67559
I have three replicates of an experiment which gives me ratios of the abundance of different peptides.  If I take the data for one peptide:  pep1 &lt;- c(4.3, 5.7, 6.3)   I can use a one-sample t-test to test the hypothesis that the ratio is different from 1:  t.test(pep1,         alternative=c("greater"),        mu=1,        paired=FALSE,        var.equal=FALSE,        conf.level=0.95)   output:  data:  pep1 t = 7.4818, df = 2, p-value = 0.0087 alternative hypothesis: true mean is greater than 1 95 percent confidence interval:  3.703107      Inf sample estimates: mean of x   5.433333    However if I try and apply this to the rows of a dataframe called peptides, where each row is a separate peptide, with three ratios:  t_test &lt;- function(x) p_val =  t.test(x,                                        alternative=c("greater"),                                       mu=1,                                       paired=FALSE,                                       var.equal=FALSE,                                       conf.level=0.95)$p.value  apply(peptides, 1, t_test)   I get the data are essentially constant error.  I don't understand! I think apply is doing what I want because if I substitute 't-test' for 'mean' then it does the correct calculations.   My aim is to get the p-values for each peptide and then adjust these for multiple comparisons.  I'm relatively new to R, and any advice would be very much appreciated!