我符合以下回归模型:

mod <- betareg(connectance ~ fc * size, data = net.land.3000, link = "logit")

summary(mod)

Call:
betareg(formula = connectance ~ fc * size, data = net.land.3000, link = "logit")

Standardized weighted residuals 2:
    Min      1Q  Median      3Q     Max 
-2.4777 -0.1919 -0.0185  0.1435  2.6781 

Coefficients (mean model with logit link):
         Estimate Std. Error z value Pr(>|z|)  
(Intercept) -2.160853   0.939846  -2.299   0.0215 *
fc           0.062797   0.027081   2.319   0.0204 *
size         0.109050   0.101085   1.079   0.2807  
fc:size     -0.005822   0.003427  -1.699   0.0894 .

Phi coefficients (precision model with identity link):
        Estimate Std. Error z value Pr(>|z|)  
(phi)    85.06      42.32    2.01   0.0445 *

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Type of estimator: ML (maximum likelihood)
Log-likelihood: 12.88 on 5 Df
Pseudo R-squared: 0.6826
Number of iterations: 35 (BFGS) + 3 (Fisher scoring)

我试图绘制 fcconnectance 之间的关系,考虑到 sizefc * size 相互作用的影响,以及95%的置信区间 . 据我所知,这是一个局部残差(或边际效应)图 .

如果我有多个自变量,一个交互和一个非线性回归,我如何在R中创建一个?我知道标准方法是回归(y~我的其他自变量)与(我感兴趣的变量〜其他自变量)的残差,但我不确定如何处理与交互和非线性关系 .

我使用 plot_model() 函数给了它一个镜头,得到了以下内容:

plot_model(mod, type = "pred", terms = "fc")

Marginal effects plot of fc

但是,我期望我的部分残差图中的回归线的斜率等于 fc (0.06)的模型估计值,并且截距等于我的模型输出中的截距(-2.16),但它没有 .

总结一下我的问题:

  • 我想要一个局部残差图吗?

  • 如果是,那么这与我的模型输出中感兴趣的变量的斜率有什么关系呢?

  • plot_model 给我正确的结果,还是我可以用另一个函数来计算回归线和置信区间?

对不起,如果这非常令人困惑,我是统计数据的初学者并且非常困惑 . 我将不胜感激任何帮助,并乐意提供更多有用的信息!

作为参考,这是我的数据:

connectance       fc size
1    0.3333333 37.96319    8
3    0.2500000 11.33780    8
5    0.3809524 18.16915   13
6    0.5000000 47.88571    5
8    0.2500000 14.02959   10
9    0.1904762 17.87691   13
11   0.2777778 19.11214    9
12   0.2291667 29.03701   14