Hi Brian, 

Thank you very much for your response.  I haven't tried the approach you 
suggested yet, but it seems it does offer a great deal of flexibility.  

So far, I looked into censored (MLE) regression as implemented via the function 
cenreg in the NADA package.  

Do you have any examples of R code that you would be able to point me to for 
the quantreg() approach? Or know of any articles where this approach was used?  
If yes, I would love to read up more on it.  

I always get frustrated when I have to apply statistical methods originally 
developed in the context of assessing trends in water quality parameters.  
Their implementation in R 
seems to be patchy and often reduced to cases where either no censoring is 
present or there is a single censoring limit.  If we start throwing in things 
like seasonality, ties 
within a season, temporal/seasonal correlation, data missigness, etc., things 
get even more frustrating.  I would imagine quantreg() itself may struggle with 
correlation issues, for 
example.  There are some useful USGS packages out there, but many of them seem 
to be "orphaned" so one feels a bit unsure about how reliable they are if they 
are no longer 
maintained.   
  
Thank you again, 

Isabella 

Isabella R. Ghement, Ph.D.
Ghement Statistical Consulting Company Ltd.
301-7031 Blundell Road, Richmond, B.C., Canada, V6Y 1J5
Tel: 604-767-1250
E-mail: isabe...@ghement.ca
Web: www.ghement.ca



On Mon 28/01/19  2:50 PM , "Cade, Brian" ca...@usgs.gov sent:
> 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
> 
> 

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to