Skip to content

Commit

Permalink
#102 #97 replace md equation syntax with roxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
egouldo committed Aug 12, 2024
1 parent 1dcc028 commit 657eed7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions R/back_transformations.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#'
#' @details We assume analysts' estimates are normally distributed. Each function uses a normal distribution to simulate the a distribution of effect-sizes and their standard errors. Next this distribution is back-transformed to the desired response scale. The mean `m_est`, standard error `se_est`, and quantiles (`lower` and `upper`) of the back-transformed distribution are returned within a dataframe.
#' @param beta Analyst beta estimate
#' @param se Standard error of analyst's effect size estimate $\\beta$
#' or out-of-sample prediction estimate $y\\_i$.
#' @param se Standard error of analyst's effect size estimate \eqn{\beta}
#' or out-of-sample prediction estimate \eqn{y_i}.
#' @param sim numeric vector of length 1. number of simulations.
#' @return data frame containing the mean estimate, its standard error, and quantiles.
#' @family back transformation
Expand Down Expand Up @@ -71,7 +71,7 @@ probit_back <- function(beta, se, sim) {
return(set)
}

#' @describeIn back Back transform beta estimates for models with $1/x$ link
#' @describeIn back Back transform beta estimates for models with \eqn{1/x} link
#' @export
inverse_back <- function(beta, se, sim) {
simulated <- rnorm(sim, beta, se)
Expand All @@ -90,7 +90,7 @@ inverse_back <- function(beta, se, sim) {
return(set)
}

#' @describeIn back Back transform beta estimates for models with $x^2$-link
#' @describeIn back Back transform beta estimates for models with \eqn{x^2}-link
#' @export
square_back <- function(beta, se, sim) {
simulated <- rnorm(sim, beta, se)
Expand All @@ -109,7 +109,7 @@ square_back <- function(beta, se, sim) {
return(set)
}

#' @describeIn back Back transform beta estimates for models with $x^3$-link
#' @describeIn back Back transform beta estimates for models with \eqn{x^3}-link
#' @export
cube_back <- function(beta, se, sim) {
simulated <- rnorm(sim, beta, se)
Expand Down
2 changes: 1 addition & 1 deletion R/get_MA_fit_stats.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Extract meta-analytic statistics like \eqn{I^2}, etc.
#' @param MA_mod a fitted model of class rma.mv
#' @return A tidy tibble with \eqn{\sigma^2} and \eqn{I^2} estimates for \code{MA_mod}
#' @return A tidy tibble with \eqn{\sigma^2} and \eqn{I^2} estimates for `MA_mod`
#' @export
get_MA_fit_stats <- function(MA_mod) {
stopifnot("MA_mod must be an object of class rma.mv" = "rma.mv" %in% class(MA_mod))
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ capwords <- function(s, strict = FALSE) {
#' Removes infinite and NA values from a dataframe of standardised effects
#'
#' @param effects_analysis A dataframe containing the standardised effects
#' @param Z_colname unquoted or bare column name with the $Z$ or $Z_r$ estimates
#' @param VZ_colname unquoted or bare column name containing the $VZ$ or $\\text{VZ}_r$ estimates
#' @param Z_colname unquoted or bare column name with the \eqn{Z} or \eqn{Z_r} estimates
#' @param VZ_colname unquoted or bare column name containing the \eqn{VZ} or \eqn{\text{VZ}_r} estimates
#'
#' @return a dataframe without
#' @export
Expand Down

0 comments on commit 657eed7

Please sign in to comment.