R/metaanalysiscorr.h.R

Defines functions metaAnalysisCorr

# This file is automatically generated, you probably don't want to edit this

metaAnalysisCorrOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
    "metaAnalysisCorrOptions",
    inherit = jmvcore::Options,
    public = list(
        initialize = function(
            rcor = NULL,
            samplesize = NULL,
            slab = NULL,
            moderatorcor = NULL,
            methodmetacor = "REML",
            cormeasure = "ZCOR",
            moderatorType = "NON",
            testType = "z",
            level = 95,
            showModelFit = FALSE,
            addcred = FALSE,
            addfit = TRUE,
            showweights = FALSE,
            steps = 5,
            xAxisTitle = NULL,
            forestPlotSize = "SMALL",
            funnelPlotSize = "SMALL",
            pchForest = "15",
            forestOrder = "fit",
            fsntype = "Rosenthal",
            tesAlternative = "two.sided",
            tesAlpha = 0.5,
            tesH0 = 0,
            showTes = FALSE,
            puniformSide = "right",
            selModelType = "none",
            yaxis = "sei",
            yaxisInv = FALSE,
            enhanceFunnel = FALSE,
            showInfPlot = FALSE,
            showLL = FALSE,
            showPuniform = FALSE,
            showSelmodel = FALSE,
            showPcurve = FALSE, ...) {

            super$initialize(
                package='MAJOR',
                name='metaAnalysisCorr',
                requiresData=TRUE,
                ...)

            private$..rcor <- jmvcore::OptionVariable$new(
                "rcor",
                rcor,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..samplesize <- jmvcore::OptionVariable$new(
                "samplesize",
                samplesize,
                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(
                    "COR",
                    "UCOR",
                    "ZCOR"),
                default="ZCOR")
            private$..moderatorType <- jmvcore::OptionList$new(
                "moderatorType",
                moderatorType,
                options=list(
                    "NON",
                    "CAT",
                    "CON"),
                default="NON")
            private$..testType <- jmvcore::OptionList$new(
                "testType",
                testType,
                options=list(
                    "z",
                    "t",
                    "knha"),
                default="z")
            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$..forestPlotSize <- jmvcore::OptionList$new(
                "forestPlotSize",
                forestPlotSize,
                options=list(
                    "SMALL",
                    "MEDIUM",
                    "LARGE",
                    "SMALLWIDE",
                    "MEDIUMWIDE",
                    "LARGEWIDE"),
                default="SMALL")
            private$..funnelPlotSize <- jmvcore::OptionList$new(
                "funnelPlotSize",
                funnelPlotSize,
                options=list(
                    "SMALL",
                    "MEDIUM",
                    "LARGE"),
                default="SMALL")
            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$..tesAlternative <- jmvcore::OptionList$new(
                "tesAlternative",
                tesAlternative,
                options=list(
                    "two.sided",
                    "less",
                    "greater"),
                default="two.sided")
            private$..tesAlpha <- jmvcore::OptionNumber$new(
                "tesAlpha",
                tesAlpha,
                min=0.000001,
                max=1,
                default=0.5)
            private$..tesH0 <- jmvcore::OptionNumber$new(
                "tesH0",
                tesH0,
                min=-9999,
                max=9999,
                default=0)
            private$..showTes <- jmvcore::OptionBool$new(
                "showTes",
                showTes,
                default=FALSE)
            private$..puniformSide <- jmvcore::OptionList$new(
                "puniformSide",
                puniformSide,
                options=list(
                    "right",
                    "left"),
                default="right")
            private$..selModelType <- jmvcore::OptionList$new(
                "selModelType",
                selModelType,
                options=list(
                    "none",
                    "beta",
                    "halfnorm",
                    "negexp",
                    "logistic",
                    "power",
                    "stepfun"),
                default="none")
            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)
            private$..showLL <- jmvcore::OptionBool$new(
                "showLL",
                showLL,
                default=FALSE)
            private$..showPuniform <- jmvcore::OptionBool$new(
                "showPuniform",
                showPuniform,
                default=FALSE)
            private$..showSelmodel <- jmvcore::OptionBool$new(
                "showSelmodel",
                showSelmodel,
                default=FALSE)
            private$..showPcurve <- jmvcore::OptionBool$new(
                "showPcurve",
                showPcurve,
                default=FALSE)

            self$.addOption(private$..rcor)
            self$.addOption(private$..samplesize)
            self$.addOption(private$..slab)
            self$.addOption(private$..moderatorcor)
            self$.addOption(private$..methodmetacor)
            self$.addOption(private$..cormeasure)
            self$.addOption(private$..moderatorType)
            self$.addOption(private$..testType)
            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$..forestPlotSize)
            self$.addOption(private$..funnelPlotSize)
            self$.addOption(private$..pchForest)
            self$.addOption(private$..forestOrder)
            self$.addOption(private$..fsntype)
            self$.addOption(private$..tesAlternative)
            self$.addOption(private$..tesAlpha)
            self$.addOption(private$..tesH0)
            self$.addOption(private$..showTes)
            self$.addOption(private$..puniformSide)
            self$.addOption(private$..selModelType)
            self$.addOption(private$..yaxis)
            self$.addOption(private$..yaxisInv)
            self$.addOption(private$..enhanceFunnel)
            self$.addOption(private$..showInfPlot)
            self$.addOption(private$..showLL)
            self$.addOption(private$..showPuniform)
            self$.addOption(private$..showSelmodel)
            self$.addOption(private$..showPcurve)
        }),
    active = list(
        rcor = function() private$..rcor$value,
        samplesize = function() private$..samplesize$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,
        testType = function() private$..testType$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,
        forestPlotSize = function() private$..forestPlotSize$value,
        funnelPlotSize = function() private$..funnelPlotSize$value,
        pchForest = function() private$..pchForest$value,
        forestOrder = function() private$..forestOrder$value,
        fsntype = function() private$..fsntype$value,
        tesAlternative = function() private$..tesAlternative$value,
        tesAlpha = function() private$..tesAlpha$value,
        tesH0 = function() private$..tesH0$value,
        showTes = function() private$..showTes$value,
        puniformSide = function() private$..puniformSide$value,
        selModelType = function() private$..selModelType$value,
        yaxis = function() private$..yaxis$value,
        yaxisInv = function() private$..yaxisInv$value,
        enhanceFunnel = function() private$..enhanceFunnel$value,
        showInfPlot = function() private$..showInfPlot$value,
        showLL = function() private$..showLL$value,
        showPuniform = function() private$..showPuniform$value,
        showSelmodel = function() private$..showSelmodel$value,
        showPcurve = function() private$..showPcurve$value),
    private = list(
        ..rcor = NA,
        ..samplesize = NA,
        ..slab = NA,
        ..moderatorcor = NA,
        ..methodmetacor = NA,
        ..cormeasure = NA,
        ..moderatorType = NA,
        ..testType = NA,
        ..level = NA,
        ..showModelFit = NA,
        ..addcred = NA,
        ..addfit = NA,
        ..showweights = NA,
        ..steps = NA,
        ..xAxisTitle = NA,
        ..forestPlotSize = NA,
        ..funnelPlotSize = NA,
        ..pchForest = NA,
        ..forestOrder = NA,
        ..fsntype = NA,
        ..tesAlternative = NA,
        ..tesAlpha = NA,
        ..tesH0 = NA,
        ..showTes = NA,
        ..puniformSide = NA,
        ..selModelType = NA,
        ..yaxis = NA,
        ..yaxisInv = NA,
        ..enhanceFunnel = NA,
        ..showInfPlot = NA,
        ..showLL = NA,
        ..showPuniform = NA,
        ..showSelmodel = NA,
        ..showPcurve = NA)
)

metaAnalysisCorrResults <- 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"]],
        summaryOutputText = function() private$.items[["summaryOutputText"]],
        summaryOutputText2 = function() private$.items[["summaryOutputText2"]],
        plot = function() private$.items[["plot"]],
        plotMed = function() private$.items[["plotMed"]],
        plotLarge = function() private$.items[["plotLarge"]],
        plotSmallWide = function() private$.items[["plotSmallWide"]],
        plotMedWide = function() private$.items[["plotMedWide"]],
        plotLargeWide = function() private$.items[["plotLargeWide"]],
        selModelOutput = function() private$.items[["selModelOutput"]],
        fsnRICH = function() private$.items[["fsnRICH"]],
        funplot = function() private$.items[["funplot"]],
        funplotMed = function() private$.items[["funplotMed"]],
        funplotLarge = function() private$.items[["funplotLarge"]],
        resultsTES = function() private$.items[["resultsTES"]],
        resultsTES2 = function() private$.items[["resultsTES2"]],
        tesOutput3 = function() private$.items[["tesOutput3"]],
        pCurvePlot = function() private$.items[["pCurvePlot"]],
        puniformModelOutput = function() private$.items[["puniformModelOutput"]],
        puniformModelOutput2 = function() private$.items[["puniformModelOutput2"]],
        likelihoodPlot = function() private$.items[["likelihoodPlot"]],
        diagPlotAll = function() private$.items[["diagPlotAll"]]),
    private = list(),
    public=list(
        initialize=function(options) {
            super$initialize(
                options=options,
                name="",
                title="Correlation Coefficients")
            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`="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::Html$new(
                options=options,
                name="summaryOutputText",
                title="Model Summary"))
            self$add(jmvcore::Html$new(
                options=options,
                name="summaryOutputText2",
                title="Model Summary"))
            self$add(jmvcore::Image$new(
                options=options,
                name="plot",
                title="Forest Plot",
                width=600,
                height=450,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="plotMed",
                title="Forest Plot",
                width=600,
                height=625,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="plotLarge",
                title="Forest Plot",
                width=600,
                height=900,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="plotSmallWide",
                title="Forest Plot",
                width=900,
                height=450,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="plotMedWide",
                title="Forest Plot",
                width=900,
                height=625,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="plotLargeWide",
                title="Forest Plot",
                width=900,
                height=900,
                renderFun=".plot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Table$new(
                options=options,
                name="selModelOutput",
                title="Selection Model Results",
                refs=list(
                    "metafor"),
                rows=1,
                columns=list(
                    list(
                        `name`="deltaEstimate", 
                        `title`="Estimate", 
                        `type`="number"),
                    list(
                        `name`="deltaSE", 
                        `title`="SE", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="deltaPVAL", 
                        `title`="p-value", 
                        `type`="number", 
                        `format`="pval"),
                    list(
                        `name`="deltaCILB", 
                        `title`="CI Lower Bound", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="deltaCIUB", 
                        `title`="CI Upper Bound", 
                        `type`="number", 
                        `format`="zto"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="fsnRICH",
                title="",
                rows=4,
                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(jmvcore::Image$new(
                options=options,
                name="funplotMed",
                title="Funnel Plot",
                width=750,
                height=563,
                renderFun=".funplot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Image$new(
                options=options,
                name="funplotLarge",
                title="Funnel Plot",
                width=900,
                height=675,
                renderFun=".funplot",
                refs=list(
                    "metafor")))
            self$add(jmvcore::Table$new(
                options=options,
                name="resultsTES",
                title="Test of Excess Significance | Significant Findings",
                rows=3,
                refs=list(
                    "tes"),
                columns=list(
                    list(
                        `name`="label", 
                        `title`="", 
                        `type`="text"),
                    list(
                        `name`="tesNumberOutput", 
                        `title`="", 
                        `type`="number", 
                        `format`="zto"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="resultsTES2",
                title="Test of Excess Significance | Estimated Power of Tests",
                rows=1,
                refs=list(
                    "tes"),
                columns=list(
                    list(
                        `name`="tesOutputMin", 
                        `title`="Min", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="tesOutputQ1", 
                        `title`="Q1", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="tesOutputMed", 
                        `title`="Median", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="tesOutputQ3", 
                        `title`="Q3", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="tesOutputMax", 
                        `title`="Max", 
                        `type`="number", 
                        `format`="zto"))))
            self$add(jmvcore::Html$new(
                options=options,
                name="tesOutput3",
                title="Test of Excess Significance | Results"))
            self$add(jmvcore::Image$new(
                options=options,
                name="pCurvePlot",
                title="p Curve Plot",
                width=900,
                height=675,
                renderFun=".pcurveplot"))
            self$add(jmvcore::Table$new(
                options=options,
                name="puniformModelOutput",
                title="Publication bias test p-uniform",
                rows=1,
                columns=list(
                    list(
                        `name`="Lpb", 
                        `title`="Test Statistic", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="pval", 
                        `title`="p-value", 
                        `type`="number", 
                        `format`="pvalue"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="puniformModelOutput2",
                title="Effect size estimation p-uniform",
                rows=1,
                columns=list(
                    list(
                        `name`="est", 
                        `title`="Effect Size Estimate", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="cilb", 
                        `title`="CI Lower Bound", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="ciub", 
                        `title`="CI upper Bound", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="lzero", 
                        `title`="Z", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="pval", 
                        `title`="p-value", 
                        `type`="number", 
                        `format`="zto"),
                    list(
                        `name`="ksig", 
                        `title`="Number of Significant Studies", 
                        `type`="number", 
                        `format`="zto"))))
            self$add(jmvcore::Image$new(
                options=options,
                name="likelihoodPlot",
                title="Likelihood Plot",
                width=600,
                height=450,
                renderFun=".likelihoodPlot",
                refs=list(
                    "llplot")))
            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))}))

metaAnalysisCorrBase <- if (requireNamespace('jmvcore')) R6::R6Class(
    "metaAnalysisCorrBase",
    inherit = jmvcore::Analysis,
    public = list(
        initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
            super$initialize(
                package = 'MAJOR',
                name = 'metaAnalysisCorr',
                version = c(1,0,0),
                options = options,
                results = metaAnalysisCorrResults$new(options=options),
                data = data,
                datasetId = datasetId,
                analysisId = analysisId,
                revision = revision,
                pause = NULL,
                completeWhenFilled = FALSE,
                requiresMissings = FALSE)
        }))

#' Correlation Coefficients (r, N)
#'
#' 
#' @param data .
#' @param rcor .
#' @param samplesize .
#' @param slab .
#' @param moderatorcor .
#' @param methodmetacor .
#' @param cormeasure .
#' @param moderatorType .
#' @param testType .
#' @param level .
#' @param showModelFit .
#' @param addcred .
#' @param addfit .
#' @param showweights .
#' @param steps .
#' @param xAxisTitle .
#' @param forestPlotSize .
#' @param funnelPlotSize .
#' @param pchForest .
#' @param forestOrder .
#' @param fsntype .
#' @param tesAlternative .
#' @param tesAlpha .
#' @param tesH0 .
#' @param showTes .
#' @param puniformSide .
#' @param selModelType .
#' @param yaxis .
#' @param yaxisInv .
#' @param enhanceFunnel .
#' @param showInfPlot .
#' @param showLL .
#' @param showPuniform .
#' @param showSelmodel .
#' @param showPcurve .
#' @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$summaryOutputText} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$summaryOutputText2} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$plot} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$plotMed} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$plotLarge} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$plotSmallWide} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$plotMedWide} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$plotLargeWide} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$selModelOutput} \tab \tab \tab \tab \tab a table \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$funplotMed} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$funplotLarge} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$resultsTES} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$resultsTES2} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$tesOutput3} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$pCurvePlot} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$puniformModelOutput} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$puniformModelOutput2} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$likelihoodPlot} \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
metaAnalysisCorr <- function(
    data,
    rcor,
    samplesize,
    slab,
    moderatorcor,
    methodmetacor = "REML",
    cormeasure = "ZCOR",
    moderatorType = "NON",
    testType = "z",
    level = 95,
    showModelFit = FALSE,
    addcred = FALSE,
    addfit = TRUE,
    showweights = FALSE,
    steps = 5,
    xAxisTitle,
    forestPlotSize = "SMALL",
    funnelPlotSize = "SMALL",
    pchForest = "15",
    forestOrder = "fit",
    fsntype = "Rosenthal",
    tesAlternative = "two.sided",
    tesAlpha = 0.5,
    tesH0 = 0,
    showTes = FALSE,
    puniformSide = "right",
    selModelType = "none",
    yaxis = "sei",
    yaxisInv = FALSE,
    enhanceFunnel = FALSE,
    showInfPlot = FALSE,
    showLL = FALSE,
    showPuniform = FALSE,
    showSelmodel = FALSE,
    showPcurve = FALSE) {

    if ( ! requireNamespace('jmvcore'))
        stop('metaAnalysisCorr requires jmvcore to be installed (restart may be required)')

    if ( ! missing(rcor)) rcor <- jmvcore::resolveQuo(jmvcore::enquo(rcor))
    if ( ! missing(samplesize)) samplesize <- jmvcore::resolveQuo(jmvcore::enquo(samplesize))
    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(rcor), rcor, NULL),
            `if`( ! missing(samplesize), samplesize, NULL),
            `if`( ! missing(slab), slab, NULL),
            `if`( ! missing(moderatorcor), moderatorcor, NULL))


    options <- metaAnalysisCorrOptions$new(
        rcor = rcor,
        samplesize = samplesize,
        slab = slab,
        moderatorcor = moderatorcor,
        methodmetacor = methodmetacor,
        cormeasure = cormeasure,
        moderatorType = moderatorType,
        testType = testType,
        level = level,
        showModelFit = showModelFit,
        addcred = addcred,
        addfit = addfit,
        showweights = showweights,
        steps = steps,
        xAxisTitle = xAxisTitle,
        forestPlotSize = forestPlotSize,
        funnelPlotSize = funnelPlotSize,
        pchForest = pchForest,
        forestOrder = forestOrder,
        fsntype = fsntype,
        tesAlternative = tesAlternative,
        tesAlpha = tesAlpha,
        tesH0 = tesH0,
        showTes = showTes,
        puniformSide = puniformSide,
        selModelType = selModelType,
        yaxis = yaxis,
        yaxisInv = yaxisInv,
        enhanceFunnel = enhanceFunnel,
        showInfPlot = showInfPlot,
        showLL = showLL,
        showPuniform = showPuniform,
        showSelmodel = showSelmodel,
        showPcurve = showPcurve)

    analysis <- metaAnalysisCorrClass$new(
        options = options,
        data = data)

    analysis$run()

    analysis$results
}
kylehamilton/MAJOR documentation built on May 27, 2021, 5:48 a.m.