我有一个线性模型(lm
对象)并用于margins
计算回归量的边际效应。据我了解,如果回归量在模型中只有一次,这相当于部分效果。这对“孩子”来说是正确的。
library("car")
library("plm")
data("LaborSupply", package = "plm")
# Regression
lm1 <- lm(lnwg ~ kids + age + I(age^2), data = LaborSupply)
# kids is once in the model
summary(lm1) # partial effect of kids -2.182e-02
summary(margins(lm1)) # equals marginal effect -0.0218
输出:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.218e+00 1.228e-01 9.921 < 2e-16 ***
kids -2.182e-02 5.398e-03 -4.043 5.36e-05 ***
age 6.704e-02 6.392e-03 10.488 < 2e-16 ***
I(age^2) -7.465e-04 7.936e-05 -9.406 < 2e-16 ***
factor AME SE z p lower upper
age 0.0089 0.0007 12.0683 0.0000 0.0075 0.0104
kids -0.0218 0.0054 -4.0426 0.0001 -0.0324 -0.0112
但是为什么年龄的边际效应不等于:
6.704e-02 + 2*-7.465e-04 = 0.065547
我的意思是,它不应该等于我的模型公式中的偏导数吗?