【发布时间】:2017-06-14 12:39:54
【问题描述】:
假设这个数据集(df):
Year<- c(1900, 1920,1940,1960,1980,2000, 2016)
Percent<-(0, 2, 4, 8, 10, 15, 18)
df<-cbind (Year, Percent)
df<-as.data.frame (df)
如何将这种绘制的黄土关系外推到 2040、2060、2080、2100 年。使用具有不同斜率的三种不同场景来获得 50% 的 y 值(百分比)?
ggplot(data=df, aes(x=Year, y=Percent)) +
geom_smooth(method="loess", color="#bdc9e1") +
geom_point(color="#2b8cbe", size=0.5) + theme_bw() +
scale_y_continuous (limits=c(0,60), "Percent of Area") +
scale_x_continuous (limits=c(1900,2100), "Year") +
geom_hline(aes(yintercept=50)) + geom_vline(xintercept = 2016)
【问题讨论】:
-
应避免外推平滑器。
-
@Ronald。我同意。那么我该如何反映不同的指数增长方案呢?
-
如果这是指数增长,您应该使用参数模型。
-
所以通过将我的模型更改为
lm(Percent ~ time + I(Time^2)应该可以吗?, -
这不是指数增长模型。
标签: r plot ggplot2 exponential extrapolation