Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

This isn't as easy to Google as some other things as, to be clear, I'm not talking about logistic regression in the sense of using regression to predict categorical variables.

I'm talking about fitting a logistic growth curve to given data points. To be specific, x is a given year from 1958 to 2012 and y is the estimated global CO2 ppm in November of year x.

Right now it's accelerating but it's got to level off at some point. So I want a logistic curve.

I haven't found a relatively straightforward way to do this yet.

share|improve this question
There are several ways you might do it, but the built-in nls is probably the best way. It has a built-in self start function for the logistic curve, which means you don't need good starting values (as you would for some exotic curve without one). – Glen_b Jan 16 at 0:05

1 Answer

See the nls() function. It has a self starting logistic curve model function via SSlogis(). E.g. from the ?nls help page

> library("nls")
> DNase1 <- subset(DNase, Run == 1)
>      
> ## using a selfStart model
> fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), 
+                  DNase1)

I suggest you read the help pages for these functions and probably the linked references if possible to find out more.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.