
Probability-paper data for examining a similar exposure group (UNE-EN 689)
Source:R/une689_probability.R
une689_probability_data.RdComputes the quantities needed to draw the graphical validation of a
similar exposure group (SEG, "GES" in Spanish) on probability paper:
the daily exposure values are ranked in ascending order and each rank
k is assigned the plotting position
\(P_k = (k - 3/8) / (n + 1/4)\). If the data follow the assumed
distribution, the points fall approximately on a straight line when
plotted against \(P_k\) on log-normal paper (lognormal data) or on
normal paper (normal data).
Usage
une689_probability_data(
ed,
distribution = c("auto", "lognormal", "normal"),
alpha = 0.05
)Arguments
- ed
Numeric vector. Daily exposure (ED) values, all strictly positive; between 3 and 5000 values.
- distribution
Character.
"lognormal","normal", or"auto"(default). With"auto"the lognormal distribution is used if the Shapiro-Wilk test onlog(ED)does not reject it at levelalpha; otherwise the normal distribution is used if the test onEDdoes not reject it; if both are rejected, an error is raised. The labels returned byune689_distribution_type()(English or Spanish) are also accepted.- alpha
Numeric. Significance level of the Shapiro-Wilk tests used by
distribution = "auto"(default 0.05).
Value
A list with elements:
dataA
data.framewith one row per observation and columnsk(rank),ed(sorted values),pk(plotting position),pk_percent(100 * pk),z(standard normal quantile ofpk),y(log(ed)for lognormal,edfor normal),fittedandresidualof the straight-line fit.distribution"lognormal"or"normal".nNumber of observations.
intercept,slopeCoefficients of the straight line
y = intercept + slope * z.r_squaredCoefficient of determination of the fit.
W,p_valueShapiro-Wilk statistic and p-value for the chosen distribution (on
log(ed)for lognormal, onedfor normal).alphaThe significance level used.
Details
The vertical coordinate used for the fit is the standard normal quantile
\(z_k = \Phi^{-1}(P_k)\), which is what the probability scale of the
paper represents. The straight line is the least-squares regression of
log(ED) (lognormal) or ED (normal) on \(z_k\). For lognormal data
the intercept and slope estimate log(MG) and log(DSG), and for normal
data they estimate MA and DS; these are regression-based graphical
estimates and do not replace une689_statistics().
The coefficient of determination returned in r_squared is purely
descriptive. The graphical check is a visual one: the group is
considered consistent when all points lie close to a straight line and
none is exceptionally separated from the rest. This function does not
apply any numerical cut-off to that judgement.
Note that stats::ppoints() uses the same plotting positions only for
n <= 10; this function always uses \((k - 3/8)/(n + 1/4)\).