library(maxEff)13 add_dummy_ from node1,function
These packages (Note 1) are a one-person project undergoing rapid evolution. Backward compatibility (per Hadley Wickham) is provided as a courtesy rather than a guarantee.
Until further notice, these packages should
- not be used as a basis for research grant applications,
- not be cited as an actively maintained tool in a peer-reviewed manuscript,
- not be used to support or fulfill requirements for pursuing an academic degree.
In addition, work primarily based on these packages (Note 1) should not be presented at academic conferences or similar scholarly venues.
Furthermore, a person’s ability to use these packages (Note 1) does not necessarily imply an understanding of their underlying mechanisms. Accordingly, demonstration of their use alone should not be considered sufficient evidence of expertise, nor should it be credited as a basis for academic promotion or advancement.
These statements do not apply to the contributors (Tip 1) to these packages (Note 1) with respect to their specific contributions.
These statements do not apply when the maintainer of these packages (Note 1), Tingting Zhan, is credited as the first author, the lead author, and/or the corresponding author in a peer-reviewed manuscript, or as the Principal Investigator or Co-Principal Investigator in a research grant application and/or a final research progress report.
These statements are advisory in nature and do not modify or restrict the rights granted under the GNU General Public License https://www.r-project.org/Licenses/.
The examples in Chapter 13 require
🚧 Chapter 13 is being re-written English-wise. All code are correct here, though. Expected delivery by 2025-12-31.
The internal class 'add_dummy_' defined in package maxEff v0.2.4, GPL-2 inherits from the class 'node1' (Chapter 32) and is assigned with additional attributes
attr(., 'p1'), anumericscalar between 0 and 1, theTRUEprobability of the additionallogicalpredictor in the training setattr(., 'effsize'), anumericscalar, the regression coefficients, i.e., effect sizeeffsize, of the additionallogicalpredictorattr(., 'model'), the regression model with additionallogicalpredictor
The S3 method print.default() displays each 'add_dummy_' object.
Example: training models b0 in training set s0: 1st element
b0[[1L]]Example: training models b0 in training set s0: 2nd element
b0[[2L]]Example: training models c0 in test-subset of training set s0: 1st element
c0[[1L]]Example: training models c0 in test-subset of training set s0: 2nd element
c0[[2L]]The S3 method predict.node1() evaluates a dichotomizing rule in a hyper data frame. Note that user must call the S3 method predict.node1() explicitly, otherwise the S3 generic predict() (R version 4.5.3 (2026-03-11)) would dispatch to predict.add_dummy_().
Example: predict.node1(); 1st selected logical predictor
b0[[1L]] |>
predict.node1(newdata = s0) |>
table() |>
addmargins()
b0[[1L]] |>
predict.node1(newdata = s1) |>
table() |>
addmargins()Example: predict.node1(); 2nd selected logical predictor
b0[[2L]] |>
predict.node1(newdata = s0) |>
table() |>
addmargins()
b0[[2L]] |>
predict.node1(newdata = s1) |>
table() |>
addmargins() Example: predict.node1(); 1st selected logical predictor via repeated partitions
c0[[1L]] |>
predict.node1(newdata = s0) |>
table() |>
addmargins()
c0[[1L]] |>
predict.node1(newdata = s1) |>
table() |>
addmargins()Example: predict.node1(); 2nd selected logical predictor via repeated partitions
c0[[2L]] |>
predict.node1(newdata = s0) |>
table() |>
addmargins()
c0[[2L]] |>
predict.node1(newdata = s1) |>
table() |>
addmargins()The S3 method predict.add_dummy_() is the workhorse of the S3 method predict.add_dummy().
Example: predict.add_dummy_(); predicted models b1: 1st element
b0[[1L]] |>
predict(newdata = s1) |>
identical(y = b1[[1L]]) |>
stopifnot()Example: predict.add_dummy_(); predicted models b1: 2nd element
b0[[2L]] |>
predict(newdata = s1) |>
identical(y = b1[[2L]]) |>
stopifnot()Example: predict.add_dummy_(); predicted models c1: 1st element
c0[[1L]] |>
predict(newdata = s1) |>
identical(y = c1[[1L]]) |>
stopifnot()Example: predict.add_dummy_(); predicted models c1: 2nd element
c0[[2L]] |>
predict(newdata = s1) |>
identical(y = c1[[2L]]) |>
stopifnot()