0
$\begingroup$

I am simulating a simple unimodal response Variable Y which is determined by X. $y = c \times exp (- \frac{(x-u)^2}{2t^2} )$.

x <- 1:100
y <- 50 * exp(-((x-50)^2)/(2*10^2))

In this equation, u determines the position of the mode along x If I now run a negative binomial GLM on these data

library(MASS)
g <- glm.nb(y~x)

x is not statistically significant Pr(>|z|) = 0.505. When I move the position of the mode from the middle of x just two units to the left.

y <- 50 * exp(-((x-48)^2)/(2*10^2))

the p-value of x drops to Pr(>|z|) = 0.00106. Why does the position of the mode have such a strong influence?

$\endgroup$
0

1 Answer 1

0
$\begingroup$

This happens because you're fitting an inappropriate model (it's linear in x on the scale of the linear predictor when it should be quadratic). The slope coefficient should be close to 0 when you make the center at 50 because its symmetric about 50.5, but when you shift further down the relationship becomes asymmetric (more of it is in one arm of the parabola).

If you fit a more suitable model you should see a much better fit on both.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.