R中预测函数公式的显式形式是什么

R中预测函数公式的显式形式是什么,r,regression,R,Regression,我适合我的数据框,g ` Day V` 1 13 211.45 2 15 274.40 3 18 381.15 4 21 499.80 5 26 614.65 6 29 723.75 7 33 931.70 8 36 996.35 9 40 1037.40 10 43 1277.75 通过使用以下步骤 fit <- glm(V ~ Day, data

我适合我的数据框,g

`     Day  V`       
1      13  211.45
2      15  274.40
3      18  381.15
4      21  499.80
5      26  614.65
6      29  723.75
7      33  931.70
8      36  996.35
9      40 1037.40
10     43 1277.75
通过使用以下步骤

fit <- glm(V ~ Day, data = g, family = gaussian(link = "log"))
pred <- predict(fit, type = "response")

# get Intercept from glm
intercept<-fit$coefficients[[1]]

# Get Slope from glm
slope<-fit$coefficients[[2]]
在哪里

 Vo is the intercept 
 m is the slope the fit
然后,特定V=800.0的日期可通过以下公式计算:

 t(V) = log(V/intercept)/slope
我不知道predict函数使用什么公式来计算基于拟合的预测值。我试着做下面的事情

new<-data.frame(V=c(800.00))
p<-predict(fit,newdata=new, type=response")
这是因为,这个函数的目的是从新的一天开始计算V,而不是相反


但是我如何使用R来实现这一点呢

我认为OP只是需要一点理论上的修正,而不是使用uniroot。OP,链接转换了方程的整个右侧,因此,虽然可以简化为
V=Vo*exp(m*t)
,但R拟合的方程是
V=exp(coef[1]+coef[2]*Day)
。所以
Vo=exp(coef[1])
。谢谢李哲源. 我想我有办法了,格雷戈。您的解决方案不完整。它没有结束。请你把它做完好吗?谢谢,谢谢李哲源. 这就是我用的。Gregor,为了找出时间,V变成2xVo(V倍增时间,VDT),我用V=Vo*exp(m*t)公式来拟合。那么VDT是t(V=2Vo)=log(2)/m。但在这种情况下,公式是V=exp(a+m*t)。在这种情况下,如何计算VDT?
new<-data.frame(V=c(800.00))
p<-predict(fit,newdata=new, type=response")
Error in eval(predvars, data, env) : object 'Day' not found