Description Usage Arguments Details Examples
Adjusting data below the MDL
1 2 3 4 5 6 7 8 9 |
data |
data frame of daily constituent concentrations with date as first column |
mdl |
vector or matrix of MDLs for each variable of data |
adjust |
one of three methods. 'substitute' substitutes all censored constant proportion of the mdl (sub * mdl). 'exclude' excludes constituents with more than experc censored data. 'likelihood' multiply imputes censored data with a likelihood-based method. |
sub |
proportion of MDL to substitute censored concentrations. Default is 0.5. |
experc |
If a constituent exceeds this value, using the exclude method, the constituent will be dropped from the analysis. |
N |
number of draws from posterior for likelihood-based method |
burnin |
number of samples to discard for likelihood-based method |
dattype |
Only needed for model-based imputation approach. Specify lognormal if data should be logged before imputation. |
guess1 |
Can specify guessvec for starting MCMC |
adjust
adjusts censored concentrations below the MDL
These are functions to create complete PM2.5 constitutent concentrations by substituting, excluding, or imputing censored data. Works on dataframe where the first column is date and all subsequent columns are concentrations of chemical constituents.
1 2 3 4 5 6 7 8 9 10 11 | data(nycdat)
data(nycmdl)
#fix data totals
pm <- nycdat$PM25
whPM <- which(colnames(nycdat) == "PM25")
nycdat <- nycdat[, -whPM]
whPM <- which(colnames(nycmdl) == "PM25")
nycmdl <- nycmdl[, -whPM]
adjust(nycdat, mdl = nycmdl, adjust = "substitute", sub = 1/sqrt(2))
adjust(nycdat, mdl = nycmdl, adjust = "exclude", experc = 0.2)
adjust(nycdat, mdl = nycmdl, adjust = "likelihood", dattype = "lognormal")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.