08.10.2015 Views

Package ‘MuMIn’

Package 'MuMIn'

Package 'MuMIn'

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

subset.model.selection 55<br />

## S3 method for class model.selection<br />

x[[..., exact = TRUE]]<br />

Arguments<br />

x<br />

subset,select<br />

i,j<br />

a model.selection object to be subsetted.<br />

logical expressions indicating columns and rows to keep. See subset.<br />

indices specifying elements to extract.<br />

recalc.weights logical value specyfying whether Akaike weights should be normalized across<br />

the new set of models to sum to one.<br />

recalc.delta<br />

exact logical, see [.<br />

logical value specyfying whether ∆ IC should be calculated for the new set of<br />

models (not done by default).<br />

... further arguments passed to [.data.frame (drop).<br />

Details<br />

Unlike the method for data.frame, single bracket extraction with only one index x[i] selects rows<br />

(models) rather than columns.<br />

To select rows according to presence or absence of the variables (rather than their value), a pseudofunction<br />

has may be used with subset, e.g. subset(x, has(a, !b)) will select rows with a and<br />

without b (this is equivalent to !is.na(a) & is.na(b)). has can take any number of arguments.<br />

Complex model terms need to be enclosed within curly brackets (e.g {s(a,k=2)}), except for<br />

within has. Backticks-quoting is also possible, but then the name must match exactly (including<br />

whitespace) the term name as returned by getAllTerms.<br />

To select rows where one variable can be present conditional on the presence of other variable(s),<br />

the function dc (dependency chain) can be used. dc takes any number of variables as arguments,<br />

and allows a variable to be included only if all the preceding arguments are also included (e.g.<br />

subset = dc(a, b, c) allows for models of form a, a+b and a+b+c but not b, c, b+c or a+c).<br />

Value<br />

A model.selection object containing only the selected models (rows). If columns are selected<br />

(via argument select or second index x[, j]) and not all if not all essential columns (i.e. all<br />

except "varying" and "extra") are present in the result, a plain data.frame is returned. Similarly,<br />

modifying values in the essential columns with [

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!