An alternative to consider would be to use the censored quantile
regression option available in the quantreg package.? This handles
left or right censoring with or without multiple censoring values.?
You could just estimate the censored conditional median (0.50
quantile) to provide an estimate similar to Mann-Kendall trend test,
but have the option of estimating censored estimates for other
quantiles that may provide additional insight to relationships if
there is substantial heterogeneity.? You would have to include the
necessary predictors and functions to handle the seasonal adjustments
but that should be quite doable.? The censored quantile regression
approach has much greater modeling flexibility (inclusion of other
predictors, splines on predictors, etc) than the Mann-Kendall testing
approach.
Brian
?
Brian S. Cade, PhD
U. S. Geological SurveyFort Collins Science Center2150 Centre Ave.,
Bldg. CFort Collins, CO ?80526-8818
email: ?cadebtel: ?970 226-9326
On Mon, Jan 28, 2019 at 1:00 PM wrote:
?
? ? ? ? ?BODY { font-family:Arial, Helvetica,
sans-serif;font-size:12px; }
?Hi everyone,
?I am working on a project where I need to conduct non-seasonal and
seasonal trend tests of multiply censored data (i.e., data with
multiple detection
?limits).
?An old thread on this mailing list
(http://r-sig-ecology.471788.n2.nabble.com/Seasonal-Mann-Kendall-with-multi
ple-detection-limits-td7578991.html[3]
[1])
?suggests that it is possible to perform these types of trend tests
in
R using functions from USGS packages:
? ? ? ? 1.? USGSwsQW package has a function called
kendallATS.test
that performs a non-seasonal Mann-Kendall trend test;
? ? ? ? 2.? restrend package has a function called censSeaken
that
performs a seasonal Kendall trend test.
?Now, I looked for the USGSwsQW package and couldn't find it.
Instead, I found the USGS package smwrQW
(https://rdrr.io/github/USGS-R/smwrQW/ [4]), [2] which
?includes the function kendallATS.test.? The restrend package I
could
find and it does include the censSeaken function.
?The syntax of the kendallATS.test function is kendallATS.test(x, y,
na.rm = TRUE), where in my case x will stand for year and y will be a
concentration
?subjected to multiple detection limits.? According to the help
file,
y needs to be 'any data that can be converted to a left-censored
data
object'.
?The USGS packages seem to have an as.lcens() function which would
enable me to specify y as a left-censored vector of concentration
values subjected to
?a single censoring limit.? But they also have an as.mcens()
function
which would accept multiple censoring/detection limits.?
?Initially, I thought that kendallATS.test would accept both lcens
and
mcens data values.? But it only accepts lcens data values, so I am
not
sure
?whether we are supposed to somehow convert mcens to lcens data
values
prior to feeding them to kendallATS.test?? If we are supposed to do
this
?conversion, I am also not sure how the conversion should work as
far
as as.lcens is concerned.
?As an example, if y consists of the values "
Links:
------
[1]
http://r-sig-ecology.471788.n2.nabble.com/Seasonal-Mann-Kendall-with-multip
le-detection-limits-td7578991.html[5]
[2] https://rdrr.io/github/USGS-R/smwrQW/ [6]),
[3] mailto:
[4] http://sitemail.wvthosting.com/ [8]
Links:
------
[3]
http://r-sig-ecology.471788.n2.nabble.com/Seasonal-Mann-Kendall-with-multip
le-detection-limits-td7578991.html[4] https://rdrr.io/github/USGS-R/smwrQW/
[5]
http://r-sig-ecology.471788.n2.nabble.com/Seasonal-Mann-Kendall-with-multip
le-detection-limits-td7578991.html[6] https://rdrr.io/github/USGS-R/smwrQW/
[8] http://sitemail.wvthosting.com/
[10] https://stat.ethz.ch/mailman/listinfo/r-sig-ecology