0

Using R, I want to compare two coefficients, V1 and V2, from the same regression. I check several posts, but no one answered this issue.

What test can I use to compare slopes from two or more regression models?

Can I compare two regression coefficients

What test can I use to compare slopes from two or more regression models?

Here are some simulated data.

library('MASS')

mu <- c(0,0,0)

Sigma <- matrix(.5, nrow=3, ncol=3) + diag(3)*0.3

MyData <- mvrnorm(n=10000, mu=mu, Sigma=Sigma) %>% 
  as.data.frame()

names(MyData) = c('v1', 'v2', 'y')

MyModel = lm(y ~ v1 * v2, data = MyData)

summary(MyModel)

I want to compare the estimate of V1 to the one of V2. So that if V1 and V2 are manipulated, I would like to tell something like "the influence of V1 on Y, is significantly higher than the influence of V2 on Y"

Nick Cox
  • 48,377
  • 8
  • 110
  • 156
Rtist
  • 223
  • 1
  • 5
  • I'm not sure, but it appears you want to do a sensitivity analysis. Maybe partial correlation coefficients would be useful? – Roland Dec 16 '19 at 12:00
  • If your question is about how to do something in R then it is off topic here. But there is clearly a statistical issue here as well. I am voting to leave it open, for now, but others might disagree. If you remove the requirement to use R, then it will clearly be on topic. – Peter Flom Dec 17 '19 at 11:36

0 Answers0