我目前正在尝试将黄土回归拟合到我的数据集(生物质的纬度分布)。我使用了以下代码:
ggplot(data=test)+
geom_point(aes(y=log10(value+1), x=lat, colour=variable), alpha=0.5)+
stat_smooth(aes(y=log10(value+1), x=lat, colour=variable, fill=variable), size=1, alpha=0.1)+
scale_y_continuous("Depth-integrated biomass (mgC.m-2)")+
scale_x_continuous("Latitude", limits=c(-70, 80), breaks=seq(-70, 80, 10))+
coord_flip()+
theme_bw()+
theme(legend.background = element_rect(colour = "black"))
问题是回归低于 0 而我没有低于 0 的值...有没有办法强制回归不超过 0 ?我尝试改变“跨度”值,它会更好,但黄土曲线的某些部分仍然是负数。Xlim=c(0, X) 不好,因为它切断了曲线。
谢谢。