merge.model.selection: Combine model selection tables

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Combine two or more model selection tables.

Usage

1
2
3
4
5
## S3 method for class 'model.selection'
merge(x, y, suffixes = c(".x", ".y"), ...)

## S3 method for class 'model.selection'
rbind(..., deparse.level = 1, make.row.names = TRUE)

Arguments

x, y, ...

model.selection objects to be combined. (... ignored in merge)

suffixes

a character vector with two elements that are appended respectively to row names of the combined tables.

make.row.names

logical indicating if unique and valid row.names should be constructed from the arguments.

deparse.level

ignored.

Value

A "model.selection" object containing models (rows) from all provided tables.

Note

Both Δ_IC values and Akaike weights are recalculated in the resulting tables.

Models in the combined model selection tables must be comparable, i.e. fitted to the same data, however only very basic checking is done to verify that. The models must also be ranked by the same information criterion.

Unlike the merge method for data.frame, this method appends second table to the first (similarly to rbind).

Author(s)

Kamil Bartoń

See Also

dredge, model.sel, merge, rbind.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
require(mgcv)

ms1 <- dredge(glm(Prop ~ dose + I(dose^2) + log(dose) + I(log(dose)^2),
    data = Beetle, family = binomial, na.action = na.fail))
	
fm2 <- gam(Prop ~ s(dose, k = 3), data = Beetle, family = binomial)

merge(ms1, model.sel(fm2))

## End(Not run)

Example output

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-20. For overview type 'help("mgcv-package")'.
Fixed term is "(Intercept)"
Model selection table 
           (Int)     dos     dos^2 log(dos) log(dos)^2 s(dos,3) df   logLik
3.x      -7.2540          0.002037                               2  -15.888
fm2.y     1.1420                                              +  2  -14.587
4.x      11.4600 -0.6286  0.007263                               3  -14.454
11.x     25.5600          0.005003             -2.6050           3  -14.454
7.x      59.5600          0.004636  -18.650                      3  -14.455
10.x     56.6300  1.3890                       -8.3560           3  -14.465
6.x     144.0000  1.1070            -51.430                      3  -14.470
13.x    486.5000                   -252.900    32.7500           3  -14.499
2.x     -14.5800  0.2455                                         2  -17.306
9.x     -29.9100                                1.7970           2  -18.734
5.x     -59.9100                     14.690                      2  -19.261
14.x   -404.5000  2.8720            271.100   -52.3700           4  -14.452
15.x    -57.3000          0.005895   45.430    -8.9500           4  -14.453
12.x     13.7200 -0.5280  0.006902             -0.4172           4  -14.454
8.x      16.1500 -0.5674  0.007008   -1.817                      4  -14.454
16.x  -4215.0000 34.9200 -0.066470 2754.000  -532.0000           5  -14.447
1.x       0.4804                                                 1 -146.919
       AICc  delta weight
3.x    38.2   0.00  0.306
fm2.y  40.0   1.79  0.125
4.x    40.9   2.73  0.078
11.x   40.9   2.73  0.078
7.x    40.9   2.73  0.078
10.x   40.9   2.75  0.077
6.x    40.9   2.76  0.077
13.x   41.0   2.82  0.075
2.x    41.0   2.84  0.074
9.x    43.9   5.69  0.018
5.x    44.9   6.75  0.011
14.x   50.2  12.06  0.001
15.x   50.2  12.06  0.001
12.x   50.2  12.06  0.001
8.x    50.2  12.06  0.001
16.x   68.9  30.72  0.000
1.x   296.5 258.33  0.000
Models ranked by AICc(x) 

MuMIn documentation built on April 17, 2020, 1:14 a.m.