# Monte Carlo test for statistical significance of typhoon passage frequency

This question is related to this post: https://stackoverflow.com/q/56288002/6638232

Basically, I am trying to perform a significance test using Monte Carlo simulation but I am having a problem in interpreting the given steps.

Details

This is based on the following papers: https://journals.ametsoc.org/doi/full/10.1175/JCLI4217.1

The above paper calculates the significance of the difference in means between two periods :1961-1983 and 1984-2000 of tropical cyclone passage frequency (not-normally distributed) using Monte Carlo simulation.

Two-tailed test

Null hypothesis: There is no difference in the means between 1984-2000 and 1961-1983

I am using R for this

The following steps are given:

1). First, 9999 randomly sorted 40-yr time series of the typhoon passage frequency are prepared.

2). Averages of the former 23-yr values (1961-1983) minus those of the latter 17-yr values are calculated.

3). From the rank of the original difference value among 10000 samples, the significance level is estimated.

Problems

I am confused about the third step. How does one estimate a p-value by comparing the ranks of the original difference from the resampled data set?

I'll appreciate any help.