R/RcppExports.R

Defines functions .ReplaceNA .PredY .ComputeY .partition .compute_re_Q_ .compute_tau_

Documented in .compute_re_Q_ .compute_tau_ .ComputeY .partition .PredY .ReplaceNA

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Compute tau2 
#' 
#' @param x1 the effect size g in the unsplit leaves
#' @param x2 the sampling variance vi in the unsplit leaves
#' @param x3 the lable of the unsplit leaves
#' @param x4 the sorted effect size in the parent leaf
#' @param x5 the sorted sampling variance in the parent leaf
#' @param xuni the unique labels in the unsplit leaves
#' @keywords internal
.compute_tau_ <- function(x1, x2, x3, xuni, x4, x5) {
    .Call('_metacart_compute_tau_', PACKAGE = 'metacart', x1, x2, x3, xuni, x4, x5)
}

#' Compute re Q for different values of tau2
#' 
#' @param x1 the effect size g in the unsplit leaves
#' @param x2 the sampling variance vi in the unsplit leaves
#' @param x3 the labels of nodes in the unsplit leaves
#' @param x4 tau2
#' @param x5 the effect size g in the parent leaf
#' @param x6 the sampling variance vi in the parent leaf
#' @param xuni the unique labels in the unsplit leaves
#' @keywords internal
.compute_re_Q_ <- function(x1, x2, x3, x4, xuni, x5, x6) {
    .Call('_metacart_compute_re_Q_', PACKAGE = 'metacart', x1, x2, x3, x4, xuni, x5, x6)
}

#' Partition the test set based on a trained tree
#' 
#' @param x1 the tree component of the REmrt object
#' @param x2 the moderators in the test set
#' @param x3 indicates whether a moderator is numeric or not
#' @param x4 the index vector of the spliting moderators
#' @param x5 the list of split points
#' @param x6 the moderators in the training set
#' @keywords internal
.partition <- function(x1, x2, x3, x4, x5, x6) {
    .Call('_metacart_partition', PACKAGE = 'metacart', x1, x2, x3, x4, x5, x6)
}

#' Compute the subgroup effect sizes
#' 
#' @param x1 the node labels for each study
#' @param y  the effect size
#' @param vi the sampling variance
#' @param tau2 the residual heterogeneity
#' @keywords internal
.ComputeY <- function(x1, y, vi, tau2) {
    .Call('_metacart_ComputeY', PACKAGE = 'metacart', x1, y, vi, tau2)
}

#' Predict effect size for the test set
#' 
#' @param x1 the list of subgroup means
#' @param x2 predicted subgroup membership for the test set
#' @keywords internal
.PredY <- function(x1, x2) {
    .Call('_metacart_PredY', PACKAGE = 'metacart', x1, x2)
}

#' Replace missing values by the overall weighted mean
#' 
#' @param x1 the two-column matrix of the indices of missing values
#' @param x2 the matrix of predicted y with missing values
#' @param y  the effect size
#' @param vi the sampling variance
#' @param tau2 the residual heterogeneity
#' @keywords internal
.ReplaceNA <- function(x1, x2, y, vi, tau2) {
    .Call('_metacart_ReplaceNA', PACKAGE = 'metacart', x1, x2, y, vi, tau2)
}

Try the metacart package in your browser

Any scripts or data that you put into this service are public.

metacart documentation built on July 10, 2020, 5:06 p.m.