Statistical summaries of the homogenized data

Share:

Description

Listing of means, standard deviations, quantiles or trends for a specified period, from data generated by homogen.

Usage

1
2
3
dahstat(varcli, anyi, anyf, anyip=anyi, anyfp=anyf, stat="me", ndc=1, vala=2,
cod=NULL, mnpd=0, mxsh=0, prob=.5, last=FALSE, long=FALSE, mh=FALSE,
pernys=100, ini=NA, estcol=4, sep=',', dec='.', eol='\n')

Arguments

varcli

Acronym of the name of the studied climatic variable, as in the data file name.

anyi

Initial year of the homogenized period.

anyf

Final year of the homogenized period.

anyip

First year of the period to analyze. (Defaults to anyi).

anyfp

Last year of the period to analyze. (Defaults to anyf).

stat

Statistical parameter to compute for the selected period:

"me":

Means (default),

"mdn"

Medians,

"max"

Maxima,

"min"

Minima,

"std"

Standard deviations,

"q"

Quantiles (see the prob parameter),

"tnd"

Trends,

"series"

Do not compute any statistics; only output all homogenized series in individual *.csv files.

ndc

Number of decimal places to be saved in the output file (1 by default).

vala

Annual values to compute from the sub-annual data:

0:

None,

1:

Sums,

2:

Means (default),

3:

Maxima,

4:

Minima.

cod

Optional vector of codes of the stations to be processed.

mnpd

Minimum percentage of original data. (0 = no limit).

mxsh

Maximum SNHT. (0 = no limit).

prob

Probability for the computation of quantiles (0.5 by default, i.e., medians).

last

Logical value to compute statistics only for stations working at the end of the period of study. (FALSE by default).

long

Logical value to compute statistics only for series built from the longest homogeneous sub-period. (FALSE by default).

mh

If TRUE, read monthly data computed from daily adjusted series. (FALSE by default).

pernys

Number of years on which to compute trends. (Defaults to 100).

ini

First date of the series, with format "YYYY-MM-DD". (Only used if mh=TRUE. If not set, the first day of the study period will be assumed).

estcol

Columns of the homogenized stations file to be included in the output file. (Defaults to 4, the column of station codes).

sep

String to use for separating the output data. (' ').

dec

Character to use as decimal point in the output data. ('.').

eol

Line termination style. ('\n').

Details

Homogenized data are read from the file ‘VAR_ANYI-ANYF.rda’ saved by homogen, while this function saves the computed data for the specified period in ‘VAR_ANYIP-ANYFP.STAT’, where STAT is substituted by the stat requested statistic. An exception is when stat="q", since then the extension of the output file will be qPP, where PP stands for the specified prob probability (in percent). The output period ANYIP-ANYFP must of course be comprised within the period of the input data, ANYI-ANYF.

Parameters mnpd, mxsh and last act as filters to produce results only for series that have those minimum percentages of original data and maximum SNHT values, or to select only those stations working at the end of the period studied. No selection is performed by default, listing the desired statistic for all the reconstructed series (from every homogeneous sub-period).

stat='tnd' computes trends by OLS linear regression on time, listing them in a CSV file ‘*_tnd.csv’ and their p-values in ‘*_pval.csv

If stat='series' is chosen, two text files in CSV format will be produced for every station, one with the data and another with their flags: 0 for original, 1 for infilled and 2 for corrected data.

Value

This function does not return any value, since outputs are saved to files.

See Also

homogen, dahgrid.

Examples

1
2
3
4
5
6
## Not run: 
# After having run the example of the homogen function, you can do:
dahstat("Ptest", 1951, 2010, stat='tnd')
# and check the new files Ptest_1951-2010_tnd.csv and Ptest_1951-2010_pval.csv

## End(Not run)