programming languages - How to add a trendline (exponential) in R? -


okay, working daily closings of dow jones industrial average (djia) index january 1979 december 1989. have plotted time-evolution of index, stumped how add trendline (specifically, exponential). can data here:

http://research.stlouisfed.org/fred2/series/djia/downloaddata

i downloaded excel , imported r csv file , plotted it.

in addition that, how can add trendline @ specific place? say, wanted trendline year 1985 1988?

if that's literally want (i suspect isn't), have plot , add curve specified function of x:

plot(y~x) par(new=true) curve(0.0629*exp(0.0003*x)) 

if want fit curve based on in r, you'll have generate kind of model , plot fitted values using same thing instead of curve use lines.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -