Do we have to know the distribution in order to calculate p-value? I am studying statistics. I know that to calculate the p-value, we usually take the area under the curve for the left/right/two tail based on the observation and null hypothesis, but this is for a known distribution.
My question is, what if we only have the samples and do not know the distribution? Do we just calculate the percentage of the equally or more extreme events (comparing to the oberservation) within the sample?
Do we need to do bootstrapping?
Thanks!

To get the p-value, we have to either know or estimate/approximate the null distribution of the test statistic.  Different types of hypothesis tests use different test statistics and have different null distributions for these statistics, but there are broad classes of tests where the null distribution is either known, or approximately known.  (The latter case often occurs when we use large-sample theory to get the asymptotic distribution of the test statistic, and we use this as an approximating distribution.)  If we do not have an approximation or an exact distribution, we can fall back on simulation methods like the bootstrap to estimate the null distribution of the test statistic.
