I have two datasets of a given variable
x that have the same length, let's say 14600 values in total each one.
I need to extract the extreme observations within each dataset, where extremes means values > 99th percentile.
I do this by using the R function
quantile as follows, where
df_2 are the two datasets:
df_1_q99 = quantile(df_1$x, probs = 0.99) df_1_extr = subset(df_1, x > df_1_q99[]) df_2_q99 = quantile(df_2$x, probs = 0.99) df_2_extr = subset(df_2, x > df_2_q99[])
The issue, which does not make sense to me, is that for
df_1 I obtain
n=84 and for
n=126 extreme values.
Shouldn't the number of extremes be the same since the two datasets have the same length?