cnaOpt (version 0.1.0)

selectMax: Select the con-cov optimum from a 'conCovOpt' object that is best according to a specified optimality criterion

Description

selectMax selects a con-cov optimum from a 'conCovOpt' object that is best according to some specified optimality criterion. multipleMax checks a 'selectMax' object for multiple solutions with identical values in the optimality criterion.

Usage

selectMax(x, crit = quote(con * cov), cond = quote(TRUE))
multipleMax(x, outcome)

Arguments

x

In selectMax: an object output by conCovOpt. In multipleMax: an object output by selectMax.

crit

A quoted expression specifying the optimality criterion (see examples).

cond

A quoted expression specifying additional constraints imposed on the optimality criterion (see examples).

outcome

A character string specifying a single outcome in the original data.

Value

selectMax returns an object of class 'selectMax'.

multipleMax returns a data.frame.

Details

While conCovOpt identifies all con-cov optima in an analyzed data set, selectMax selects one con-cov optimum from a 'conCovOpt' object that is best according to the optimality criterion specified in the argument crit. The default is to select a con-cov maximum: An ordered pair (con, cov) of consistency and coverage scores is a con-cov maximum for outcome Y=k in data \(\delta\) iff (con, cov) is a con-cov optimum for Y=k in \(\delta\) with highest product of consistency and coverage (con-cov product). However, the argument crit allows for specifying any other optimality criterion, e.g. pmin(con, cov), pmax(con, cov), etc. If the 'conCovOpt' object contains multiple outcomes, the selection of a best con-cov optimum is done separately for each outcome.

Whereas selectMax selects only one con-cov optimum satisfying crit, multipleMax selects all elements in an allConCov list contained in the 'conCovOpt' object reaching identical scores on the optimality criterion. It is executed for one outcome only (see the examples below).

Via the column id in the output of selectMax it is possible to select one among many equally good maxima, for instance, by means of reprodAssign (see the examples below).

See Also

conCovOpt, reprodAssign

See also examples in conCovOpt.

Examples

Run this code
# NOT RUN {
dat1 <- d.autonomy[15:30, c("EM","SP","CO","AU")]
(cco1 <- conCovOpt(dat1, type = "fs", outcome = "AU"))
selectMax(cco1)
selectMax(cco1, cond = quote(con > 0.95))
selectMax(cco1, cond = quote(cov > 0.98))
selectMax(cco1, crit = quote(pmin(con, cov)))
selectMax(cco1, crit = quote(pmax(con, cov)), cond = quote(cov > 0.9))


# Multiple equally good maxima.
(cco2 <- conCovOpt(dat1, type = "fs", outcome = "AU", allConCov = TRUE)) 
(sm2 <- selectMax(cco2, cond = quote(con > 0.93)))
multipleMax(sm2, "AU")
# Each maximum corresponds to a different rep-assignment, which can be selected
# using the id argument.
reprodAssign(sm2, "AU", id = 10)
reprodAssign(sm2, "AU", id = 11)
reprodAssign(sm2, "AU", id = 13)


# }

Run the code above in your browser using DataCamp Workspace