# This file is automatically generated, you probably don't want to edit this
metaAlphaOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
"metaAlphaOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
ai = NULL,
mi = NULL,
ni = NULL,
slab = NULL,
moderatorcor = NULL,
methodmetacor = "REML",
cormeasure = "ARAW",
moderatorType = "NON",
level = 95,
showModelFit = FALSE,
addcred = FALSE,
addfit = TRUE,
showweights = FALSE,
steps = 5,
xAxisTitle = NULL,
pchForest = "15",
forestOrder = "fit",
fsntype = "Rosenthal",
yaxis = "sei",
yaxisInv = FALSE,
enhanceFunnel = FALSE,
showInfPlot = FALSE, ...) {
super$initialize(
package='MAJOR',
name='metaAlpha',
requiresData=TRUE,
...)
private$..ai <- jmvcore::OptionVariable$new(
"ai",
ai,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..mi <- jmvcore::OptionVariable$new(
"mi",
mi,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..ni <- jmvcore::OptionVariable$new(
"ni",
ni,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..slab <- jmvcore::OptionVariable$new(
"slab",
slab,
suggested=list(
"nominal"))
private$..moderatorcor <- jmvcore::OptionVariable$new(
"moderatorcor",
moderatorcor,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..methodmetacor <- jmvcore::OptionList$new(
"methodmetacor",
methodmetacor,
options=list(
"DL",
"HE",
"HS",
"SJ",
"ML",
"REML",
"EB",
"PM",
"FE"),
default="REML")
private$..cormeasure <- jmvcore::OptionList$new(
"cormeasure",
cormeasure,
options=list(
"ARAW",
"AHW",
"ABT",
"ROM"),
default="ARAW")
private$..moderatorType <- jmvcore::OptionList$new(
"moderatorType",
moderatorType,
options=list(
"NON",
"CAT",
"CON"),
default="NON")
private$..level <- jmvcore::OptionNumber$new(
"level",
level,
min=50,
max=99.9,
default=95)
private$..showModelFit <- jmvcore::OptionBool$new(
"showModelFit",
showModelFit,
default=FALSE)
private$..addcred <- jmvcore::OptionBool$new(
"addcred",
addcred,
default=FALSE)
private$..addfit <- jmvcore::OptionBool$new(
"addfit",
addfit,
default=TRUE)
private$..showweights <- jmvcore::OptionBool$new(
"showweights",
showweights,
default=FALSE)
private$..steps <- jmvcore::OptionNumber$new(
"steps",
steps,
min=1,
max=999,
default=5)
private$..xAxisTitle <- jmvcore::OptionString$new(
"xAxisTitle",
xAxisTitle)
private$..pchForest <- jmvcore::OptionList$new(
"pchForest",
pchForest,
options=list(
"16",
"18",
"15",
"17",
"1",
"5",
"0",
"2",
"8"),
default="15")
private$..forestOrder <- jmvcore::OptionList$new(
"forestOrder",
forestOrder,
options=list(
"obs",
"fit",
"prec",
"resid",
"abs.resid"),
default="fit")
private$..fsntype <- jmvcore::OptionList$new(
"fsntype",
fsntype,
options=list(
"Rosenthal",
"Orwin",
"Rosenberg"),
default="Rosenthal")
private$..yaxis <- jmvcore::OptionList$new(
"yaxis",
yaxis,
options=list(
"sei",
"vi",
"ni",
"sqrtni",
"lni"),
default="sei")
private$..yaxisInv <- jmvcore::OptionBool$new(
"yaxisInv",
yaxisInv,
default=FALSE)
private$..enhanceFunnel <- jmvcore::OptionBool$new(
"enhanceFunnel",
enhanceFunnel,
default=FALSE)
private$..showInfPlot <- jmvcore::OptionBool$new(
"showInfPlot",
showInfPlot,
default=FALSE)
self$.addOption(private$..ai)
self$.addOption(private$..mi)
self$.addOption(private$..ni)
self$.addOption(private$..slab)
self$.addOption(private$..moderatorcor)
self$.addOption(private$..methodmetacor)
self$.addOption(private$..cormeasure)
self$.addOption(private$..moderatorType)
self$.addOption(private$..level)
self$.addOption(private$..showModelFit)
self$.addOption(private$..addcred)
self$.addOption(private$..addfit)
self$.addOption(private$..showweights)
self$.addOption(private$..steps)
self$.addOption(private$..xAxisTitle)
self$.addOption(private$..pchForest)
self$.addOption(private$..forestOrder)
self$.addOption(private$..fsntype)
self$.addOption(private$..yaxis)
self$.addOption(private$..yaxisInv)
self$.addOption(private$..enhanceFunnel)
self$.addOption(private$..showInfPlot)
}),
active = list(
ai = function() private$..ai$value,
mi = function() private$..mi$value,
ni = function() private$..ni$value,
slab = function() private$..slab$value,
moderatorcor = function() private$..moderatorcor$value,
methodmetacor = function() private$..methodmetacor$value,
cormeasure = function() private$..cormeasure$value,
moderatorType = function() private$..moderatorType$value,
level = function() private$..level$value,
showModelFit = function() private$..showModelFit$value,
addcred = function() private$..addcred$value,
addfit = function() private$..addfit$value,
showweights = function() private$..showweights$value,
steps = function() private$..steps$value,
xAxisTitle = function() private$..xAxisTitle$value,
pchForest = function() private$..pchForest$value,
forestOrder = function() private$..forestOrder$value,
fsntype = function() private$..fsntype$value,
yaxis = function() private$..yaxis$value,
yaxisInv = function() private$..yaxisInv$value,
enhanceFunnel = function() private$..enhanceFunnel$value,
showInfPlot = function() private$..showInfPlot$value),
private = list(
..ai = NA,
..mi = NA,
..ni = NA,
..slab = NA,
..moderatorcor = NA,
..methodmetacor = NA,
..cormeasure = NA,
..moderatorType = NA,
..level = NA,
..showModelFit = NA,
..addcred = NA,
..addfit = NA,
..showweights = NA,
..steps = NA,
..xAxisTitle = NA,
..pchForest = NA,
..forestOrder = NA,
..fsntype = NA,
..yaxis = NA,
..yaxisInv = NA,
..enhanceFunnel = NA,
..showInfPlot = NA)
)
metaAlphaResults <- if (requireNamespace('jmvcore')) R6::R6Class(
inherit = jmvcore::Group,
active = list(
textRICH = function() private$.items[["textRICH"]],
tableTauSqaured = function() private$.items[["tableTauSqaured"]],
modelFitRICH = function() private$.items[["modelFitRICH"]],
plot = function() private$.items[["plot"]],
fsnRICH = function() private$.items[["fsnRICH"]],
funplot = function() private$.items[["funplot"]],
diagPlotAll = function() private$.items[["diagPlotAll"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="Reliability Generalization")
self$add(jmvcore::Table$new(
options=options,
name="textRICH",
refs=list(
"metafor"),
title="Random-Effects Model",
rows=2,
columns=list(
list(
`name`="Intercept",
`title`="",
`type`="text"),
list(
`name`="Estimate",
`type`="number"),
list(
`name`="se",
`type`="number"),
list(
`name`="Z",
`type`="number"),
list(
`name`="p",
`type`="number",
`format`="zto,pvalue"),
list(
`name`="CILow",
`title`="CI Lower Bound",
`type`="number",
`format`="zto"),
list(
`name`="CIHigh",
`title`="CI Upper Bound",
`type`="number",
`format`="zto"))))
self$add(jmvcore::Table$new(
options=options,
name="tableTauSqaured",
title="Heterogeneity Statistics",
rows=1,
columns=list(
list(
`name`="tauSQRT",
`title`="Tau",
`type`="number",
`format`="zto"),
list(
`name`="tauSqComb",
`title`="Tau\u00B2",
`type`="number",
`format`="zto"),
list(
`name`="ISqu",
`title`="I\u00B2",
`type`="text"),
list(
`name`="HSqu",
`title`="H\u00B2",
`type`="number",
`format`="zto"),
list(
`name`="RSqu",
`title`="R\u00B2",
`type`="text"),
list(
`name`="QallDF",
`title`="df",
`type`="integer",
`format`="zto"),
list(
`name`="Qall",
`title`="Q",
`type`="number",
`format`="zto"),
list(
`name`="QallPval",
`title`="p",
`type`="number",
`format`="zto,pvalue"))))
self$add(jmvcore::Table$new(
options=options,
name="modelFitRICH",
title="Model Fit Statistics and Information Criteria",
rows=2,
columns=list(
list(
`name`="label",
`title`="",
`type`="text"),
list(
`name`="loglikelihood",
`title`="log-likelihood",
`type`="number",
`format`="zto"),
list(
`name`="deviance",
`title`="Deviance",
`type`="number",
`format`="zto"),
list(
`name`="AIC",
`type`="number",
`format`="zto"),
list(
`name`="BIC",
`type`="number",
`format`="zto"),
list(
`name`="AICc",
`type`="number",
`format`="zto"))))
self$add(jmvcore::Image$new(
options=options,
name="plot",
title="Forest Plot",
width=600,
height=450,
renderFun=".plot",
refs=list(
"metafor")))
self$add(jmvcore::Table$new(
options=options,
name="fsnRICH",
title="",
rows=3,
columns=list(
list(
`name`="label",
`title`="Test Name",
`type`="text"),
list(
`name`="failSafeNumber",
`title`="value",
`type`="integer",
`format`="zto"),
list(
`name`="p",
`type`="number",
`format`="zto,pvalue"))))
self$add(jmvcore::Image$new(
options=options,
name="funplot",
title="Funnel Plot",
width=600,
height=450,
renderFun=".funplot",
refs=list(
"metafor")))
self$add(R6::R6Class(
inherit = jmvcore::Group,
active = list(
diagplot1 = function() private$.items[["diagplot1"]],
diagplot2 = function() private$.items[["diagplot2"]],
diagplot3 = function() private$.items[["diagplot3"]],
diagplot4 = function() private$.items[["diagplot4"]],
diagplot5 = function() private$.items[["diagplot5"]],
diagplot6 = function() private$.items[["diagplot6"]],
diagplot7 = function() private$.items[["diagplot7"]],
diagplot8 = function() private$.items[["diagplot8"]],
diagplot9 = function() private$.items[["diagplot9"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="diagPlotAll",
title="Outlier and Influential Case Diagnostics")
self$add(jmvcore::Image$new(
options=options,
name="diagplot1",
title="Externally Standardized Residual",
width=750,
height=300,
renderFun=".influDiagPlot1"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot2",
title="DFFITS Values",
width=750,
height=300,
renderFun=".influDiagPlot2"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot3",
title="Cook's Distances",
width=750,
height=300,
renderFun=".influDiagPlot3"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot4",
title="Covariance Ratios",
width=750,
height=300,
renderFun=".influDiagPlot4"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot5",
title="Leave-one-out Tau Estimates",
width=750,
height=300,
renderFun=".influDiagPlot5"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot6",
title="Leave-one-out (residual) Heterogeneity Test Statistics",
width=750,
height=300,
renderFun=".influDiagPlot6"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot7",
title="Hat Values",
width=750,
height=300,
renderFun=".influDiagPlot7"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot8",
title="Weights",
width=750,
height=300,
renderFun=".influDiagPlot8"))
self$add(jmvcore::Image$new(
options=options,
name="diagplot9",
title="Q-Q Plot",
width=700,
height=700,
renderFun=".influDiagPlot9"))}))$new(options=options))}))
metaAlphaBase <- if (requireNamespace('jmvcore')) R6::R6Class(
"metaAlphaBase",
inherit = jmvcore::Analysis,
public = list(
initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
super$initialize(
package = 'MAJOR',
name = 'metaAlpha',
version = c(1,0,0),
options = options,
results = metaAlphaResults$new(options=options),
data = data,
datasetId = datasetId,
analysisId = analysisId,
revision = revision,
pause = NULL,
completeWhenFilled = FALSE,
requiresMissings = FALSE)
}))
#' Reliability Generalization
#'
#'
#' @param data .
#' @param ai .
#' @param mi .
#' @param ni .
#' @param slab .
#' @param moderatorcor .
#' @param methodmetacor .
#' @param cormeasure .
#' @param moderatorType .
#' @param level .
#' @param showModelFit .
#' @param addcred .
#' @param addfit .
#' @param showweights .
#' @param steps .
#' @param xAxisTitle .
#' @param pchForest .
#' @param forestOrder .
#' @param fsntype .
#' @param yaxis .
#' @param yaxisInv .
#' @param enhanceFunnel .
#' @param showInfPlot .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$textRICH} \tab \tab \tab \tab \tab a table \cr
#' \code{results$tableTauSqaured} \tab \tab \tab \tab \tab a table \cr
#' \code{results$modelFitRICH} \tab \tab \tab \tab \tab a table \cr
#' \code{results$plot} \tab \tab \tab \tab \tab an image \cr
#' \code{results$fsnRICH} \tab \tab \tab \tab \tab a table \cr
#' \code{results$funplot} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot1} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot2} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot3} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot4} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot5} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot6} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot7} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot8} \tab \tab \tab \tab \tab an image \cr
#' \code{results$diagPlotAll$diagplot9} \tab \tab \tab \tab \tab an image \cr
#' }
#'
#' Tables can be converted to data frames with \code{asDF} or \code{\link{as.data.frame}}. For example:
#'
#' \code{results$textRICH$asDF}
#'
#' \code{as.data.frame(results$textRICH)}
#'
#' @export
metaAlpha <- function(
data,
ai,
mi,
ni,
slab,
moderatorcor,
methodmetacor = "REML",
cormeasure = "ARAW",
moderatorType = "NON",
level = 95,
showModelFit = FALSE,
addcred = FALSE,
addfit = TRUE,
showweights = FALSE,
steps = 5,
xAxisTitle,
pchForest = "15",
forestOrder = "fit",
fsntype = "Rosenthal",
yaxis = "sei",
yaxisInv = FALSE,
enhanceFunnel = FALSE,
showInfPlot = FALSE) {
if ( ! requireNamespace('jmvcore'))
stop('metaAlpha requires jmvcore to be installed (restart may be required)')
if ( ! missing(ai)) ai <- jmvcore::resolveQuo(jmvcore::enquo(ai))
if ( ! missing(mi)) mi <- jmvcore::resolveQuo(jmvcore::enquo(mi))
if ( ! missing(ni)) ni <- jmvcore::resolveQuo(jmvcore::enquo(ni))
if ( ! missing(slab)) slab <- jmvcore::resolveQuo(jmvcore::enquo(slab))
if ( ! missing(moderatorcor)) moderatorcor <- jmvcore::resolveQuo(jmvcore::enquo(moderatorcor))
if (missing(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(ai), ai, NULL),
`if`( ! missing(mi), mi, NULL),
`if`( ! missing(ni), ni, NULL),
`if`( ! missing(slab), slab, NULL),
`if`( ! missing(moderatorcor), moderatorcor, NULL))
options <- metaAlphaOptions$new(
ai = ai,
mi = mi,
ni = ni,
slab = slab,
moderatorcor = moderatorcor,
methodmetacor = methodmetacor,
cormeasure = cormeasure,
moderatorType = moderatorType,
level = level,
showModelFit = showModelFit,
addcred = addcred,
addfit = addfit,
showweights = showweights,
steps = steps,
xAxisTitle = xAxisTitle,
pchForest = pchForest,
forestOrder = forestOrder,
fsntype = fsntype,
yaxis = yaxis,
yaxisInv = yaxisInv,
enhanceFunnel = enhanceFunnel,
showInfPlot = showInfPlot)
analysis <- metaAlphaClass$new(
options = options,
data = data)
analysis$run()
analysis$results
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.