1

To explain my problem , i have this simulated data using R.

require(splines)
x=rnorm(20 ,0,1)
y=rep(c(0,1),times=10)

First i fitted a regular (linear effects) logistic regression model.

fit1=glm(y~x ,family = "binomial")

Then to check the non linear effects, i fitted this natural spline model .

  fit2=glm(y~ns(x,df=2) ,family = "binomial")

Based on my thinking models , i believe these 2 models are non nested models.

Next i wanted check whether the non linear model (fit2) has any significant effects compared to the regular logistic model (fit1).

Is there any way to compare this two models? I believe i cannot use the lrtest function in lmtest package, because these two models are not nested models.

Any suggestion will be highly appreciated

Thank you.

Oliver
  • 8,169
  • 3
  • 15
  • 37
student_R123
  • 962
  • 11
  • 30
  • 1
    Methods and theory questions belong on CrossValidated.com – IRTFM May 18 '19 at 06:19
  • This seems like the case of a simple `anova(fit1, fit2, type = 'Rao')`. This will give you a p-value whether the two models explanatory power are significantly different. Based on the result, you could then continue to check your model assumptions, (`cumplots`, etc. for distributional assumptions) and choose the model which performs the best while not breaking the model assumptions. – Oliver May 18 '19 at 11:01

0 Answers0