Skip to content

Is there any function can be used to compare two probit models made from same data?

5 messages · jingjiang yan, Ben Bolker, David Freedman +2 more

#
jingjiang yan <jingjiangyan <at> gmail.com> writes:
You can use a likelihood ratio test (i.e.
anova(model1,model0) to compare either model
to the null model (blindness is independent of
both age and height).  The age model and height
model are non-nested, and of equal complexity.
You can tell which one is *better* by comparing
log-likelihoods/deviances, but cannot test
a null hypothesis of significance. Most (but
not all) statisticians would say you can compare 
non-nested models by using AIC, but you don't
get a hypothesis-test/p-value in this way.


  Ben Bolker
#
Hi - wouldn't it be possible to bootstrap the difference between the fit of
the 2 models?  For example, if one had a *linear* regression problem, the
following script could be used (although I'm sure that it could be
improved):

library(MASS); library(boot)
#create intercorrelated data
Sigma <- matrix(c(1,.5,.4,  .5,1,.8,  .4,.8,1),3,3)
Sigma
dframe<-as.data.frame(mvrnorm(n<-200, rep(0, 3), Sigma))
names(dframe)<-c('disease','age','ht') #age and ht are predictors of
'disease'
head(dframe); cor(dframe)

#bootstrap the difference between models containing the 2 predictors
model.fun <- function(data, indices) {
     dsub<-dframe[indices,]
     m1se<-summary(lm(disease~age,data=dsub))$sigma; 
     m2se<-summary(lm(disease~ht,da=dsub))$sigma; 
     diff<-m1se-m2se;  #diff is the difference in the SEs of the 2 models
     }
eye <- boot(dframe,model.fun, R=200);  class(eye); names(eye);
des(an(eye$t))
boot.ci(eye,conf=c(.95,.99),type=c('norm'))
Ben Bolker wrote:

  
    
#
On Friday 23 January 2009, David Freedman wrote:
This may be a naive question, but could this be used to test two models based 
on difference transformations of the dependent variable?

[...]
m1se<-summary(lm(disease ~ age, data=dsub))$sigma
m2se<-summary(lm(log(disease) ~ age, da=dsub))$sigma
[...]

or would the differences in scales render meaningless results?

Cheers,

Dylan
1 day later
#
At 14:55 23/01/2009, David Freedman wrote:

            
There are a number of methods for comparing non-nested models in the 
lmtest package.
Michael Dewey
http://www.aghmed.fsnet.co.uk