[R] non-linear plot parameters

David Winsemius dwinsemius at comcast.net
Thu Aug 26 19:48:28 CEST 2010


On Aug 26, 2010, at 1:35 PM, Marlin Keith Cox wrote:

> I need the parameters estimated for a non-linear equation, an  
> example of the
> data is below.
>
>
> # rm(list=ls())    I really wish people would add comments to  
> destructive pieces of code.

> Time<-c( 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4,
> 4, 4, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8)
> Level<-c( 100, 110,  90,  95,  87,  60,  65,  61,  55,  57,  40,   
> 41,  50,
> 47,
> 44,  44,  42,  38,  40, 37,  37,  35,  40,  34,  32,  20,  22,  25,   
> 27,
> 29)
> plot(Time,Level,pch=16)

You did not say what sort of "non-linear equation" would best suit,  
nor did you offer any background regarding the domain of study. There  
must be many ways to do this. After looking at the data, a first pass  
looks like this:

 > lm(log(Level) ~Time )

Call:
lm(formula = log(Level) ~ Time)

Coefficients:
(Intercept)         Time
      4.4294      -0.1673

 > exp(4.4294)
[1] 83.88107
 > points(unique(Time), exp(4.4294 -unique(Time)*0.1673), col="red",  
pch=4)

Maybe a Weibull model would be more appropriate.


-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list