Description Usage Arguments Value Author(s) Examples
View source: R/PopulationFit.R
Fits a population nlme
model to multiple breath test PDR records.
First, separate nls fits are done to determine those records that do not give
a valid fit. Technically it would be possible to fit these outliers with
a population fit, but this leads to failure of the method quite often, so
the simple outlier removal method was chosen.
#' @name BreathTestPopulationFit
1 |
x |
data frame with columns |
data frame with columns BreathTestRecordID, m, k,beta
of the population fit. Use function SavePopulationFit
to save to database.
Dieter Menne, dieter.menne@menne-biomed.de
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(14024)
sqliteFile = CreateSimulatedBreathTestDatabase()
con = OpenSqliteConnection(sqliteFile)
pd = GetPopulationData(con)
# Make one stupid outlier
pp = pd$PDR[pd$BreathTestRecordID=="1"]
pp = pp+(1:length(pp))*0.5
pd$PDR[pd$BreathTestRecordID==1] = pp
head(pd)
# This gives a "did not converge" error
cf = try(BreathTestPopulationFit(pd))
print(cf)
dbDisconnect(con)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.