[R] NADA and cenmle
Rich Shepard
rshepard at appl-ecosys.com
Thu Mar 14 15:57:26 CET 2013
On Thu, 14 Mar 2013, Shane Carey wrote:
> I am using the cenmle function from the NADA package and some of my data
> are negative values. As a result the cenmle function will not work and
> NaN's are produced. I try to change the distribution to Gaussian, but it
> still will not run.
>
> Could somebody please help me with this?
Possibly.
What do your negative values represent? If they are 'less-thans', that is,
censored as below the method detection limit or laboratory reporting limit,
then you need to transform them to absolute values and set a flag indicating
their status. For example, your data frame should have a column named 'flag'
or (the lable I use) 'ceneq1' which contains a Boolean value: zero if the
value is measured and one if it is censored.
Then write the function call similar to this:
cenmle(dataframe$value, dataframe$ceneq1, dist='lognormal')
Works as advertised.
Rich
More information about the R-help
mailing list