slr_change_comp: Place recent rate of sea level change into historical context

Description Usage Arguments Details See Also

View source: R/slr_change_comp.R

Description

Compares the recent rate of sea level rise to rates for all prior periods of the same length.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
slr_change_comp(
  .data,
  .sl,
  .dt,
  .span = 20L,
  .interval = if (.mode == "year") 1L else NULL,
  .mode = c("year", "duration", "count"),
  .threshold = 0.75,
  t_fit = FALSE
)

Arguments

.data

Source data frame for data. Use NULL if no data frame is used and all data is passed from the enclosing environment.

.sl

The data variable (usually found in the data frame) showing sea level or mean sea level. Must be a named variable, not an expression.

.dt

Data variable containing corresponding midpoint dates for the period of averaging used to calculate .sl. Must be a named variable, not an expression. Midpoint dates for a given month can be approximated with as.Date(paste(year, month, 15, sep = '-').

.span

Span defining the "recent" period for fitting the model. integer or difftime object. Interpretation of .span depends on the value of the by_year. If by_year == TRUE, .span must be an integer, and is interpreted as the number of years included in the "recent" period for fitting the model. If by_year == FALSE, and .span is an integer, it is interpreted as the number of records to include in the 'recent' period.

.interval

Integer. Spacing of the start of time periods on which to calculate slopes. For .mode == 'year', defaults to 1. Otherwise, must be provided.

.mode

one of c('year', 'duration', 'count') indicating whether the .span is expressed in years, time coordinates, or number of observations. If .mode == 'year', slopes are scaled to be expressed on a per year basis. Scaling requires the time coordinate to inherit from R Date or POSIXt objects. Rates based on Dates are converted to annual values by multiplying by 365.2422 days / year. Rates based on POSIXt objects are converted to annual values by multiplying slope estimates by multiplying by 31556926 seconds / year (with a warning about rounding error). No scaling is done for .mode == 'duration' or .mode == 'count'.

.threshold

Default = 0.75. Real number specifying how strict the function should be in estimating slopes for periods with missing values. Slopes will only be estimated for time periods with at least .threshold times the number of non-missing data points in the time period examined that has the most data points. A .threshold of 1.0 means any period with missing values will be excluded. A .threshold of 0 implies that all periods with at least two dates and water level values (so a slope can be estimated) will be retained. Function output includes information on the number of samples on which each slope is based, so it is possible to set .threshold = 0 and filter the results intelligently.

t_fit

Should the underlying generalized linear model's correlation structure be fit based on the time coordinate (.dt), or only on the sequence of observations in the data? Setting this to TRUE is safer if you are uncertain of the sequence of observations in the source data, or significant missing values in the data, but it significantly slows model fitting. Results tend to be very similar for complete or near complete data.

Details

A frequent question raised in analysis of recent sea level records is whether the rate of sea level rise is increasing, as predicted by numerous climate models over the years. This is a simple question that is rather more complex to answer statistically than it at first appears.

This function compares the rate of sea level rise in the most recent period (defined by .span) to the rate of sea level rise in prior periods of the same length in the historic record.

This function returns a probability that corresponds to the percentage of prior evaluates periods with a slope equal to or greater than the most recent slope.

While conceptually, this is akin to a p-value, with the null hypothesis that the current period is drawn from the same distribution as all prior slopes, it should not be interpreted strictly. Consecutive slopes are strongly auto-correlated. This analysis makes no effort to account for that autocorrelation.

See Also

Other sea level rate functions: get_sl_trend(), slr_change(), slr_slope()


ccb60/SLRSIM documentation built on Jan. 21, 2022, 1:31 a.m.