问题
I'm trying to fit a x*log(x) model to the data. The fitting is performed successfully but I have difficulties in interpreting the resulting coefficients. Here a snapshot of my code.
x <- c(6, 11, 16, 21, 26, 31, 36, 41, 46, 51)
y <- c(5.485, 6.992, 7.447, 8.134, 8.524, 8.985, 9.271, 9.647, 10.561, 9.971)
fit <- lm(y ~ x*log(x))
coef(fit)
> (Intercept) x log(x) x:log(x)
3.15224227 0.10020022 1.12588040 -0.01322249
How I should interpret these coefficients? Let's call them a,b,c,d. Where I should put them in the formula "x*log(x)"?
回答1:
As written, the model you are fitting is
E(y) = a + b*x + c*log(x) + d*x*log(x)
If you really did want to fit the model a + b*x*log(c*x)
you would need to figure out that a + b*x*(log(c)+log(x)) = a + b*log(c)*x + b*x*log(x)
, fit y ~ x + x:log(x)
, and back-calculate the parameters accordingly.
Or you might be interested in y~I(x*log(x))
?
What is the model you actually want to fit?
来源:https://stackoverflow.com/questions/16695797/interpreting-regression-coefficients-in-r