This seems like it might be helpful when models are numerous and complex and parameterizations
differ only slightly. I think I figured out a way, using the code below.
However, my approach intuitively does not appear to be very efficient. I also wonder a
little how general or robust it is.
Does anyone know of an easier way?
The only other way I have thought of so far would be to modify the model.table() function
itself and I have not yet figured out how to do that.
Here is how I am adding the model names to the AICc table:
- Code: Select all
###################################################################################
p = list(formula =~ -1 + stratum + session)
Delta = list(formula =~ 1 )
Phi0 = list(formula =~ -1 + stratum )
Psi = list(formula =~ -1 + stratum + time )
R = list(formula =~ -1 + stratum + time )
model.A = mark(rd.processed, rd.ddl,
model.parameters = list( p = p ,
Delta = Delta,
Phi0 = Phi0 ,
Psi = Psi ,
R = R ))
model.A
###################################################################################
p = list(formula =~ 1 )
Delta = list(formula =~ 1 )
Phi0 = list(formula =~ -1 + stratum )
Psi = list(formula =~ -1 + stratum + time )
R = list(formula =~ -1 + stratum + time )
model.B = mark(rd.processed, rd.ddl,
model.parameters = list( p = p ,
Delta = Delta,
Phi0 = Phi0 ,
Psi = Psi ,
R = R ))
model.B
###################################################################################
my.table <- collect.models(, adjust = FALSE, table = TRUE)
my.names <- collect.model.names( lx=ls())
names.in.table <- as.numeric(row.names(model.table(my.table, adjust = FALSE)))
my.model.names <- my.names[names.in.table]
my.table.with.model.names <- cbind(my.model.names, my.table$model.table)
my.table.with.model.names
###################################################################################