Questions tagged [p-value]

In statistical significance testing the p-value is the probability of obtaining a test statistic at least as extreme as the one that was actually observed.

The p-value is a key concept in the approach of Ronald Fisher, where he uses it to measure the weight of the data against a specified hypothesis, and as a guideline to ignore data that does not reach a specified significance level. Fisher's approach does not involve any alternative hypothesis, which is instead the Neyman–Pearson approach. The p-value should not be confused with the Type I error rate (false positive rate) α in the Neyman–Pearson approach – though α is also called a "significance level" and is often 0.05, these terms have different meanings, these are incompatible approaches, and the numbers p and α cannot meaningfully be compared.

791 questions
6
votes
1 answer

R boxplot, change number of digits in p value using "stat_compare_means"

Using the ToothGrowth dataset (built into R), I have used the following code. library(ggplot2) library(tidyverse) library(ggpubr) p <- ggboxplot(ToothGrowth, x = "supp", y = "len", color = "supp", palette = "jco", add =…
Sylvia Rodriguez
  • 1,203
  • 2
  • 11
  • 30
6
votes
1 answer

R ggplot2 boxplots - ggpubr stat_compare_means not working properly

I am trying to add significance levels to my boxplots in the form of asterisks using ggplot2 and the ggpubr package, but I have many comparisons and I only want to show the significant ones. I try to use the option hide.ns=TRUE in…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
6
votes
2 answers

Is there a R function that convert p.value to significance code?

summary displays significance code for p.values. Is there a R function that convert p.value to significance code? for example: 0.02 --> '*' and 0.005 --> '**'?
mt1022
  • 16,834
  • 5
  • 48
  • 71
6
votes
2 answers

output p value from a t-test in R

So lets work through the example from ?t.test() We do a two-sample t-test on the data by: t.test(1:10, y = c(7:20)) Now I am only interested in saving the p-value When I input the followng code, the $p.value is also saved. t.test(1:10, y =…
lukeg
  • 1,327
  • 3
  • 10
  • 27
6
votes
3 answers

P-value, significance level and hypothesis

I am confused about the concept of p-value. In general, if the p-value is greater than alpha which is generally 0.05, we are fail to reject null hypothesis and if the p-value is less than alpha, we reject null hypothesis. As I understand, if the…
Ram
  • 359
  • 1
  • 6
  • 15
5
votes
2 answers

Chi-square test P-value from resampled method vs scipy.stats.chi2_contigency

This question references to book "O'Relly Practical Statistics for Data Scientists 2nd Edition" chapter 3, session Chi-Square Test. The book provides an example of one Chi-square test case, where it assumes a website with three different headlines…
user97662
  • 942
  • 1
  • 10
  • 29
5
votes
1 answer

Show R2 and p-value in ggplot for y~log(x) fuction

I want to make a ggplot with a log regression and want to show the R2 and p-value. I tried stat_cor, but it only shows R2 and p-value for a linear regression. I tried to incorporate "formula=y~log(x)" into stat_cor, but sais unknown parameter:…
5
votes
1 answer

How is Pr(>|t|) in a linear regression in R calculated?

What formula is used to calculate the value of Pr(>|t|) that is output when linear regression is performed by R? I understand that the value of Pr (> | t |) is a p-value, but I do not understand how the value is calculated. For example, although the…
Ryota Suzuki
  • 53
  • 1
  • 1
  • 3
5
votes
1 answer

Different p-value in ggplot2 stat_compare_means and wilcox.test

I try to add p-values to my ggplot using the stat_compare_means function. However, the p-values I get within the ggplot differs from the result of a basic wilcox.test. I used paired testing in both cases, and also used the wilcoxon test within the…
Andreas H.
  • 53
  • 1
  • 3
5
votes
2 answers

Extract p-value from gam.check in R

When I run gam.check(my_spline_gam), I get the following output. Method: GCV Optimizer: magic Smoothing parameter selection converged after 9 iterations. The RMS GCV score gradiant at convergence was 4.785628e-06 . The Hessian was positive…
a_geo
  • 157
  • 1
  • 1
  • 6
5
votes
1 answer

p-value from fisher.test() does not match phyper()

The Fisher's Exact Test is related to the hypergeometric distribution, and I would expect that these two commands would return identical pvalues. Can anyone explain what I'm doing wrong that they do not match? #data (variable names chosen to match…
R-Peys
  • 123
  • 1
  • 9
5
votes
0 answers

Calculating p-value associated with a slope in Postgres

In postgres I am calculating an R2 and a slope using the below functions: regr_r2(y,x) regr_slope(y,x) Is there any way to calculate the p-value associated to the slope within postgres?
Illya
  • 243
  • 1
  • 11
5
votes
3 answers

Is there an Anderson-Darling implementation for python that returns p-value?

I want to find the distribution that best fit some data. This would typically be some sort of measurement data, for instance force or torque. Ideally I want to run Anderson-Darling with multiple distributions and select the distribution with the…
5
votes
1 answer

ggplot2: how to add lines and p-values on a grouped barplot?

I tried unsuccessfully to solve my problem reading the answers of these posts: Indicating the statistically significant difference in bar graph USING R, How to draw the boxplot with significant level? and Put stars on ggplot barplots and boxplots -…
gmbaranzoni
  • 65
  • 1
  • 6
5
votes
2 answers

sandwich::vcovHC() and coeftest::lmtest() returning NA values

I am currently building a regression model which helps explain sales using certain factors like income, temperature etc. On checking the residual plot after regression, the residuals are heteroscedastic. To account for heteroscedasticity , I have…
Asha
  • 51
  • 1
  • 4
1
2
3
52 53