Dear member list, In many experimental sciences, there is a lower detection limit (LDL) when a dosage of a product is done. Then some samples are evaluated to be below this limit. I search for the best way to indicate in a data.frame that some values are such LDL. Ideally, an equivalent of NA would be the best. Until now I manage by indicating all the column in characters. So the question is: is it possible to define a value that could be named LDL and that could take place in vectors or data.frame such as: v <- c(0.2, 0.28, LDL, 0.9) is the same way that NA can be used. with of course a function is.ldl(v) that would return F F T F Thanks a lot for any direction to solve this Marc
> LDL <- NA_real_> is.LDL <- is.na > v <- c(0.2, 0.28, LDL, 0.9) > v [1] 0.20 0.28 NA 0.90 > is.LDL(v) [1] FALSE FALSE TRUE FALSE > Hope this helps. Chel Hee Lee On 11/9/2014 12:07 PM, Marc Girondot wrote:> Dear member list, > > In many experimental sciences, there is a lower detection limit (LDL) > when a dosage of a product is done. Then some samples are evaluated to > be below this limit. > I search for the best way to indicate in a data.frame that some values > are such LDL. Ideally, an equivalent of NA would be the best. > Until now I manage by indicating all the column in characters. > So the question is: is it possible to define a value that could be > named LDL and that could take place in vectors or data.frame such as: > v <- c(0.2, 0.28, LDL, 0.9) is the same way that NA can be used. > with of course a function is.ldl(v) that would return F F T F > > Thanks a lot for any direction to solve this > > Marc > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi Marc, This may be a helpful link: http://stackoverflow.com/questions/16074384/specify-different-types-of-missing-values-nas> On Nov 9, 2014, at 1:07 PM, Marc Girondot <marc_grt at yahoo.fr> wrote: > > Dear member list, > > In many experimental sciences, there is a lower detection limit (LDL) when a dosage of a product is done. Then some samples are evaluated to be below this limit. > I search for the best way to indicate in a data.frame that some values are such LDL. Ideally, an equivalent of NA would be the best. > Until now I manage by indicating all the column in characters. > So the question is: is it possible to define a value that could be named LDL and that could take place in vectors or data.frame such as: > v <- c(0.2, 0.28, LDL, 0.9) is the same way that NA can be used. > with of course a function is.ldl(v) that would return F F T F > > Thanks a lot for any direction to solve this > > Marc > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Along the lines of what Bert Gunter said, the ideal way to represent <LDL results depends on the functions used later to analyze them. I deal with such data on a daily basis and have never found it necessary to incorporate that information in the same variable as the results. What would you do if data were censored at both ends, both low and high? Anyway, the functions I use mostly incorporate that information in a second variable, a ?detection indicator? variable, and that?s what I do. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/9/14, 10:07 AM, "Marc Girondot" <marc_grt at yahoo.fr> wrote:>Dear member list, > >In many experimental sciences, there is a lower detection limit (LDL) >when a dosage of a product is done. Then some samples are evaluated to >be below this limit. >I search for the best way to indicate in a data.frame that some values >are such LDL. Ideally, an equivalent of NA would be the best. >Until now I manage by indicating all the column in characters. >So the question is: is it possible to define a value that could be named >LDL and that could take place in vectors or data.frame such as: >v <- c(0.2, 0.28, LDL, 0.9) is the same way that NA can be used. >with of course a function is.ldl(v) that would return F F T F > >Thanks a lot for any direction to solve this > >Marc > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.