将多元回归方程添加到分段图

Add the multiple regression equation to a segmented graph

我发现 RDocumentation 中的这个示例很有用,我想进一步探索它。下面的代码改编自 https://www.rdocumentation.org/packages/segmented/versions/0.5-2.1/topics/plot.segmented

GDD<- c(221.2765957446810000,
    309.2198581560280000,
    431.2056737588650000,
    483.6879432624110000,
    553.1914893617020000)

biom<-c(0.0000000001000000,
        0.8510638297872340,
        5.9574468085106400,
        15.3191489361702000,
        22.1276595744681000)
o<- glm(biom~GDD, family = gaussian); o
o.seg<-segmented(o, ~GDD) #single segmented covariate and one breakpoint:'psi' can be omitted
par(mfrow=c(2,1))
plot(o.seg, conf.level=0.95, shade=TRUE)
points(o.seg, link=FALSE, col=2)

我想找到创建黑色分段线的方程式并找到关节点(红色)。请看看我该怎么做。非常感谢任何帮助。

o.seg告诉你你想知道的一切。 "Estimated Break-Point(s):" 告诉你断点(红点)的 x 值(GDD 值)。它是 psi1.GDD = 391.3。

o.seg$coefficients告诉你线方程,大致就是-2.14 + 0.0097*GDD*(GDD < psi1.GDD) + 0.12*GDD*(GDD >= psi1.GDD).