print.GenericML | R Documentation |
GenericML
objectPrints key results of the analyses conducted in GenericML()
.
## S3 method for class 'GenericML' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
An object of the class |
digits |
Number of digits to print. |
... |
Additional arguments to be passed down. |
A print to the console.
if(require("ranger")){ ## generate data set.seed(1) n <- 150 # number of observations p <- 5 # number of covariates D <- rbinom(n, 1, 0.5) # random treatment assignment Z <- matrix(runif(n*p), n, p) # design matrix Y0 <- as.numeric(Z %*% rexp(p) + rnorm(n)) # potential outcome without treatment Y1 <- 2 + Y0 # potential outcome under treatment Y <- ifelse(D == 1, Y1, Y0) # observed outcome ## specify learners learners <- c("random_forest") ## perform generic ML inference # small number of splits to keep computation time low x <- GenericML(Z, D, Y, learners, num_splits = 2, parallel = FALSE) ## print print(x) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.