1
$\begingroup$

I have two models:

mod1 <- glm(y ~ A + CONTROL1 + CONTROL2, data = dat,family=binomial(link="logit"))
mod2 <- glm(y ~ B + CONTROL1 + CONTROL2, data = dat,family=binomial(link="logit"))

I'm trying to determine if slope A in mod1 is significantly different from slope B in mod2.

I'll give a reproducible example here:

mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
mydata$sat<-rnorm(400, mean=1350, sd=100) # randomly generate SAT scores
m1 <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")
m2 <- glm(admit ~ sat + gpa + rank, data = mydata, family = "binomial")

I am interested in finding out if the slope associated with gre in m1 is significantly different from the slope associated with sat in m2.

What are some tests in R that can help me get there?

Thanks in advance!

$\endgroup$
10
  • $\begingroup$ Possible duplicate of stats.stackexchange.com/questions/252325/…. Especially the first comment and the corresponding link. $\endgroup$ Commented Feb 19, 2019 at 19:08
  • $\begingroup$ I'm not sure if it's a duplicate. The questions in the two threads are quite a bit different. I'm not asking about how slopes might vary by subgroups. $\endgroup$
    – Quan Mai
    Commented Feb 19, 2019 at 19:13
  • $\begingroup$ That's why I indicated they are possible -- admittedly they may not apply -- I just scanned them because I remember a similar question before. I guess one question I'd have is why are you fitting separate models? Can you update the question a bit to tell us why you are doing separate models as opposed to fitting a single model with an interaction term? $\endgroup$ Commented Feb 19, 2019 at 19:17
  • $\begingroup$ Thanks for your follow up. I'm not fitting a single model with an interaction term because there's no theoretical reason for doing so. In the example, there's no reason to think that the effect of "gre" on the likelihood of admittance varies by "sat" scores. I'm only trying to see if there's a different effect between "gre" and "sat" on the outcome variable. m1 and m2 aren't nested models. $\endgroup$
    – Quan Mai
    Commented Feb 19, 2019 at 19:21
  • $\begingroup$ Have you tested that theory? Couldn't you just include gre and sat in the same model and test contrasts? It seems you'd want to account for both of these since both influence admission. I'm not sure you can have one without the other in any admission process that I know of. $\endgroup$ Commented Feb 19, 2019 at 19:25

1 Answer 1

1
$\begingroup$

You mentioned in the comments that your goal is to determine if GRE or SAT does better at predicting. Given that this is your goal, and that all other variables in your model appear to be identical, I'd suggest the following approach.

Simply test your GRE model on a hold-out sample of data and compute the mean squared predicted error (MSPE). Do the same thing with the SAT model. Then, select the model that has the lowest mean squared predicted error as this model does the best job of predicting. You could even perform cross-validation or jackknife estimates with these methods and compare the averaged MSPEs.

That being said, in the real world, rarely do school admissions offices receive only a GRE or only and SAT (I believe). As you've provided in your example, both factors likely contribute to the admission decision. As a result, I think you are better off creating a composite index of both GRE and SAT (perhaps by using a PCA score of GRE and SAT) and placing it in your model.

$\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.