Hi all, I have a number of bacterial growth curves I would like to find the equations for these and then integrate them to find the area under the curves for me to do stats on later. Is there any way I can do this in R? Thanks, Frances [[alternative HTML version deleted]]
Hi Frances The short answer is YES, you can do anything in R if you bother. Do you have any figures of the growth curves (something close to exponential growth until they suddenly commit suicide or the environment kills)?. We NEED more information, thank you please. Yours sincerely / Med venlig hilsen Frede Aakmann T?gersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 frtog at vestas.com http://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender.> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of Frances Cheesman > Sent: 3. april 2014 17:26 > To: R-help at r-project.org > Subject: [R] Equation of a curve > > Hi all, > > I have a number of bacterial growth curves I would like to find the > equations for these and then integrate them to find the area under the > curves for me to do stats on later. > > Is there any way I can do this in R? > > Thanks, > > Frances > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
You may have a different use in mind, but I think integration does not make sense for growth curves. And there is no simple, general equation that I'm aware of: When you determine the area under the curve (integration), you are essentially multiplying bacterial mass by time. Imagine that you would kill your bacteria and continue observing. Then the integral would just grow, and grow ... that's possibly not what you want. Bacterial growth parameters are often characterized by *doubling times*, or *growth rate* and these are essentially derived from *differentiating* the observed concentration (or absorbance) with respect to time - relative mass-increase per time unit. That said, you will usually observe non ideal behaviour at the start of growth (lag phase), a phase of rapid growth (exponential phase) and slowing of growth as the culture conditions become nutrient limited (stationary phase) - possibly followed by a drop of absorbance when your bacteria die off. Modelling this with equations is not trivial, and the parameters you are fitting are usually not of interest anyway. Probably the best approach is to focus on that part of your growth curve that actually shows the expected exponential growth. This part should be linear if you plot the log of your measurement. 1: Take the log of your measurement; 2: plot it and determine the time interval you should analyze; 3: perform a simple linear regression on the data points in that interval. See: ?lm in R. 4: Calculate your doubling time (or whatever number you need) from the slope. Hope this helps, B. On 2014-04-03, at 11:26 AM, Frances Cheesman wrote:> Hi all, > > I have a number of bacterial growth curves I would like to find the > equations for these and then integrate them to find the area under the > curves for me to do stats on later. > > Is there any way I can do this in R? > > Thanks, > > Frances > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
The mean value theorem of integration (I have a cross-stitch of this theorem hanging on my wall (between cross-stitches of the central limit theorem and Bayes theorem)) tells us that the area under a curve is equal to the width of the area of interest times the average height of the curve. Often when we want to use the area under a curve in statistics we can just use the average of the y-values generating the curve and it is much simpler. If the x-coordinates of your points are evenly spaced or are random with a fairly uniform distribution then the mean height of the points will probably be as useful as any curve that you computed and then integrated. If the x-coordinates are not uniformly spread then you may benefit from a weighted average. One option for estimating the integral is to use the trapezoidal rule or Simpson's rule, but if you look at those formulas, they are just a weighted average of the heights again. So, while Yes, R can estimate curves and compute numerical integrals of the curves, there is a good chance that you don't really need to do either. On Thu, Apr 3, 2014 at 9:26 AM, Frances Cheesman <fcheesman.fc at gmail.com> wrote:> Hi all, > > I have a number of bacterial growth curves I would like to find the > equations for these and then integrate them to find the area under the > curves for me to do stats on later. > > Is there any way I can do this in R? > > Thanks, > > Frances > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
On 03/04/2014 16:26, Frances Cheesman wrote:> Hi all, > > I have a number of bacterial growth curves I would like to find the > equations for these and then integrate them to find the area under the > curves for me to do stats on later. > > Is there any way I can do this in R? > > Thanks, > > Frances > > [[alternative HTML version deleted]] >Responding to the curve fitting question and passing over the integration issue... It is quite common to use nls to fit equations to log(count) v time data. You'll have to choose an appropriate model, ideally as a self starting nls model. Of those included in the stats package you might consider SSfpl, SSgompertz, SSlogis and SSweibull. But choice of a model is really a microbiological issue and all those models might be considered a little passe. Fitting this kind of sigmoidal model can be difficult unless the data is good.