英文原页:peak_trend()
说明
该函数针对总渔获量以及主要物种、国家或渔区,找出峰值渔获量出现的年份和数值、最后一年渔获量占峰值的百分比,以及最近recent_years年的趋势:年均增长率,以及Mann-Kendall趋势检验(年份与渔获量之间的Kendall
τ)。
English
This function finds, for the total catch and for the main species,
countries or fishing areas, the year and size of the peak catch, the
catch in the last year as a percentage of the peak, and the trend over
the last recent_years years: the average annual growth
rate, and a Mann-Kendall trend test (Kendall’s tau between year and
catch).
用法
peak_trend(
area_data,
by = c("species", "country", "area"),
top_n = 10,
recent_years = 10,
plot = TRUE,
table = TRUE,
lang = NULL,
pptx = getOption("faofishingreport.pptx", FALSE),
plot_show = fao_setting("plot_show"),
label = NULL
)参数
area_data-
FAO渔获数据:
fishing_area_data()$area_data,或load_fao_data()的任意子集(例如一个国家,或几个渔区)。English
FAO catch data:fishing_area_data()$area_data, or any subset ofload_fao_data()(e.g. one country, or several fishing areas). by-
比较的对象:“species”(物种,默认)、“country”(国家)或”area”(渔区)。
English
What to compare: “species” (default), “country” or “area”. top_n-
纳入总渔获量最大的物种、国家或渔区的个数。默认为10;用
Inf表示全部。English
The number of species, countries or areas with the largest total catch to include. Default is 10; useInffor all. recent_years-
计算趋势所用的最近年数。默认为10。
English
The number of most recent years used for the trend. Default is 10. plot-
逻辑值。为TRUE(默认)时,图表保存在figures/png/summary/。
English
A logical value. If TRUE (default), charts are saved infigures/png/summary/. table-
逻辑值。为TRUE(默认)时,表格保存在tables/。
English
A logical value. If TRUE (default), tables are saved intables/. lang-
图表文字和名称的语言:“en”(英文)、“zh”(中文)或”both”(中英双语)。默认为NULL,即使用
fao_settings()设置的语言(未更改时为”en”)。English
The language of the chart text and names: “en” (English), “zh” (Chinese) or “both” (Chinese and English). Default is NULL, which uses the language set withfao_settings()(“en” unless changed). pptx-
逻辑值。为TRUE时,图表还另存为可编辑的PowerPoint文件,保存在figures/pptx/summary/。默认为FALSE,可以用
fao_settings(pptx = TRUE)为所有函数统一更改。English
A logical value. If TRUE, charts are also saved as editable PowerPoint files infigures/pptx/summary/. Default is FALSE, which can be changed for all functions withfao_settings(pptx = TRUE). plot_show-
逻辑值。为TRUE时,每张图在保存的同时也画在绘图窗口中(例如RStudio的Plots窗格),便于立即查看。默认为FALSE,可以用
fao_settings(plot_show = TRUE)为所有函数统一更改。无论是否显示,图表都会保存为文件(plot = TRUE)。English
A logical value. If TRUE, each chart is also drawn in the plot window (e.g. the Plots pane of RStudio) as it is saved, to look at it at once. Default is FALSE, which can be changed for all functions withfao_settings(plot_show = TRUE). The charts are saved as files (plot = TRUE) either way. label-
输出文件名中使用的名称。默认为数据所属的渔区(或国家)。
English
The name used in the output file names. Default is the fishing area (or the country) of the data.
返回值
以不可见方式返回一个数据框,每个序列一行(第一行为总渔获量)。
English
Invisibly, a data frame with one row per series (the first row is the total).
详细说明
渔获量序列存在自相关,会使常规的Mann-Kendall检验发现过多的趋势,因此用AR(1)过程的有效样本量校正检验的方差(Yue和Wang,2004);所用的自相关是去趋势序列的滞后1期自相关,并校正了其小样本偏差(Kendall,1954;lag1_autocorrelation)。p_value_iid是常规检验的p值,供比较。只有十年数据时,自相关难以估计准确,校正也只是部分的:自相关很强的序列仍然会过于频繁地显示出趋势。trend对每条序列单独检验(p_value
<
0.05):序列很多时,有些趋势是偶然发现的,q_value给出按结果中的序列数(总量除外)校正后的p值(Benjamini和Hochberg,1995)。应把p_value
< 0.05的趋势视为探索性结果,把q_value <
0.05的趋势作为显著趋势报告,fao_report()对主要物种和国家就是这样做的。
English
Catch series are autocorrelated, which makes the usual Mann-Kendall
test find too many trends, so the variance of the test is corrected with
the effective sample size of an AR(1) process (Yue and Wang 2004), from
the lag-1 autocorrelation of the detrended series corrected for its
small-sample bias (Kendall 1954; lag1_autocorrelation);
p_value_iid is the p value of the usual test, for
comparison. Over ten years the autocorrelation is poorly known and the
correction is only partial: strongly autocorrelated series still show
trends too often. trend tests each series on its own
(p_value < 0.05): with many series, some trends are
found by chance, and q_value gives the p values adjusted
for the number of series in the result, the total excepted (Benjamini
and Hochberg 1995). Read trends with p_value < 0.05 as
exploratory, and give as significant the trends with
q_value < 0.05, as fao_report() does for
the main species and countries.
参考文献
Benjamini, Y. and Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B 57: 289-300. doi:10.1111/j.2517-6161.1995.tb02031.x
Kendall, M.G. (1954). Note on bias in the estimation of autocorrelation. Biometrika 41: 403-404. doi:10.1093/biomet/41.3-4.403
Yue, S. and Wang, C.Y. (2004). The Mann-Kendall test modified by effective sample size to detect trend in serially correlated hydrological series. Water Resources Management 18: 201-218. doi:10.1023/B:WARM.0000043140.61082.60
另请参阅
Other summary analyses: area_overview(),
coastal_distant(), country_group_summary(),
data_quality(), diversity_concentration(),
regime_shift(), species_group_composition(),
stock_status()
示例
FAO27 <- fishing_area_data("Atlantic, Northeast", plot = FALSE)
peak_trend(FAO27$area_data, by = "species", lang = "zh")
peak_trend(FAO27$area_data, by = "country", lang = "zh")