R/jamovimetamdiff.h.R

Defines functions jamovimetamdiff

Documented in jamovimetamdiff

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

jamovimetamdiffOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovimetamdiffOptions",
    inherit = jmvcore::Options,
    public = list(
        initialize = function(
            switch = "from_raw",
            comparison_means = NULL,
            comparison_sds = NULL,
            comparison_ns = NULL,
            reference_means = NULL,
            reference_sds = NULL,
            reference_ns = NULL,
            r = NULL,
            labels = NULL,
            moderator = NULL,
            d = NULL,
            dcomparison_ns = NULL,
            dreference_ns = NULL,
            dr = NULL,
            dlabels = NULL,
            dmoderator = NULL,
            conf_level = 95,
            effect_label = "My effect",
            reported_effect_size = "mean_difference",
            assume_equal_variance = TRUE,
            random_effects = "random_effects",
            include_PIs = FALSE,
            show_details = FALSE,
            es_plot_width = "600",
            es_plot_height = "750",
            size_base = "2",
            size_multiplier = "3",
            axis.text.y = "14",
            report_CIs = FALSE,
            meta_diamond_height = ".25",
            xlab = "auto",
            xmin = "auto",
            xmax = "auto",
            xbreaks = "auto",
            mark_zero = TRUE,
            axis.text.x = "14",
            axis.title.x = "15",
            dlab = "auto",
            dmin = "auto",
            dmax = "auto",
            dbreaks = "auto",
            shape_raw_reference = "square filled",
            shape_raw_comparison = "square filled",
            shape_summary_difference = "triangle filled",
            shape_raw_unused = "square filled",
            color_raw_reference = "#008DF9",
            color_raw_comparison = "#009F81",
            color_raw_unused = "gray65",
            color_summary_reference = "#008DF9",
            color_summary_comparison = "#009F81",
            color_summary_unused = "gray75",
            color_summary_difference = "black",
            color_summary_overall = "black",
            fill_raw_reference = "#008DF9",
            fill_raw_comparison = "#009F81",
            fill_raw_unused = "gray65",
            fill_summary_reference = "#008DF9",
            fill_summary_comparison = "#009F81",
            fill_summary_unused = "gray75",
            fill_summary_difference = "black",
            fill_summary_overall = "black",
            alpha_raw_reference = "1",
            alpha_raw_comparison = "1",
            alpha_raw_unused = "1",
            alpha_summary_reference = "1",
            alpha_summary_comparison = "1",
            alpha_summary_unused = "1",
            alpha_summary_difference = "1",
            alpha_summary_overall = "1",
            linetype_raw_reference = "solid",
            linetype_raw_comparison = "solid",
            linetype_summary_difference = "solid",
            linetype_raw_unused = "solid",
            color_interval_reference = "black",
            color_interval_comparison = "black",
            color_interval_difference = "black",
            color_interval_unused = "black",
            size_interval_reference = ".50",
            size_interval_comparison = ".50",
            size_interval_difference = ".50",
            size_interval_unused = ".50",
            alpha_interval_reference = "1",
            alpha_interval_comparison = "1",
            alpha_interval_difference = "1",
            alpha_interval_unused = "1", ...) {

            super$initialize(
                package="esci",
                name="jamovimetamdiff",
                requiresData=TRUE,
                ...)

            private$..switch <- jmvcore::OptionList$new(
                "switch",
                switch,
                default="from_raw",
                options=list(
                    "from_raw",
                    "from_d"))
            private$..comparison_means <- jmvcore::OptionVariable$new(
                "comparison_means",
                comparison_means,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..comparison_sds <- jmvcore::OptionVariable$new(
                "comparison_sds",
                comparison_sds,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..comparison_ns <- jmvcore::OptionVariable$new(
                "comparison_ns",
                comparison_ns,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..reference_means <- jmvcore::OptionVariable$new(
                "reference_means",
                reference_means,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..reference_sds <- jmvcore::OptionVariable$new(
                "reference_sds",
                reference_sds,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..reference_ns <- jmvcore::OptionVariable$new(
                "reference_ns",
                reference_ns,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..r <- jmvcore::OptionVariable$new(
                "r",
                r,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..labels <- jmvcore::OptionVariable$new(
                "labels",
                labels,
                suggested=list(
                    "nominal",
                    "ordinal"),
                permitted=list(
                    "factor"))
            private$..moderator <- jmvcore::OptionVariable$new(
                "moderator",
                moderator,
                suggested=list(
                    "nominal",
                    "ordinal"),
                permitted=list(
                    "factor"))
            private$..d <- jmvcore::OptionVariable$new(
                "d",
                d,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..dcomparison_ns <- jmvcore::OptionVariable$new(
                "dcomparison_ns",
                dcomparison_ns,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..dreference_ns <- jmvcore::OptionVariable$new(
                "dreference_ns",
                dreference_ns,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..dr <- jmvcore::OptionVariable$new(
                "dr",
                dr,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..dlabels <- jmvcore::OptionVariable$new(
                "dlabels",
                dlabels,
                suggested=list(
                    "nominal",
                    "ordinal"),
                permitted=list(
                    "factor"))
            private$..dmoderator <- jmvcore::OptionVariable$new(
                "dmoderator",
                dmoderator,
                suggested=list(
                    "nominal",
                    "ordinal"),
                permitted=list(
                    "factor"))
            private$..conf_level <- jmvcore::OptionNumber$new(
                "conf_level",
                conf_level,
                default=95)
            private$..effect_label <- jmvcore::OptionString$new(
                "effect_label",
                effect_label,
                default="My effect")
            private$..reported_effect_size <- jmvcore::OptionList$new(
                "reported_effect_size",
                reported_effect_size,
                default="mean_difference",
                options=list(
                    "mean_difference",
                    "smd_unbiased"))
            private$..assume_equal_variance <- jmvcore::OptionBool$new(
                "assume_equal_variance",
                assume_equal_variance,
                default=TRUE)
            private$..random_effects <- jmvcore::OptionList$new(
                "random_effects",
                random_effects,
                default="random_effects",
                options=list(
                    "random_effects",
                    "fixed_effects",
                    "compare"))
            private$..include_PIs <- jmvcore::OptionBool$new(
                "include_PIs",
                include_PIs,
                default=FALSE)
            private$..show_details <- jmvcore::OptionBool$new(
                "show_details",
                show_details,
                default=FALSE)
            private$..es_plot_width <- jmvcore::OptionString$new(
                "es_plot_width",
                es_plot_width,
                default="600")
            private$..es_plot_height <- jmvcore::OptionString$new(
                "es_plot_height",
                es_plot_height,
                default="750")
            private$..size_base <- jmvcore::OptionList$new(
                "size_base",
                size_base,
                default="2",
                options=list(
                    ".25",
                    ".50",
                    ".75",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..size_multiplier <- jmvcore::OptionList$new(
                "size_multiplier",
                size_multiplier,
                default="3",
                options=list(
                    "1",
                    "1.1",
                    "1.2",
                    "1.3",
                    "1.5",
                    "1.75",
                    "2",
                    "2.5",
                    "3",
                    "3.5",
                    "4",
                    "4.5",
                    "5"))
            private$..axis.text.y <- jmvcore::OptionString$new(
                "axis.text.y",
                axis.text.y,
                default="14")
            private$..report_CIs <- jmvcore::OptionBool$new(
                "report_CIs",
                report_CIs,
                default=FALSE)
            private$..meta_diamond_height <- jmvcore::OptionString$new(
                "meta_diamond_height",
                meta_diamond_height,
                default=".25")
            private$..xlab <- jmvcore::OptionString$new(
                "xlab",
                xlab,
                default="auto")
            private$..xmin <- jmvcore::OptionString$new(
                "xmin",
                xmin,
                default="auto")
            private$..xmax <- jmvcore::OptionString$new(
                "xmax",
                xmax,
                default="auto")
            private$..xbreaks <- jmvcore::OptionString$new(
                "xbreaks",
                xbreaks,
                default="auto")
            private$..mark_zero <- jmvcore::OptionBool$new(
                "mark_zero",
                mark_zero,
                default=TRUE)
            private$..axis.text.x <- jmvcore::OptionString$new(
                "axis.text.x",
                axis.text.x,
                default="14")
            private$..axis.title.x <- jmvcore::OptionString$new(
                "axis.title.x",
                axis.title.x,
                default="15")
            private$..dlab <- jmvcore::OptionString$new(
                "dlab",
                dlab,
                default="auto")
            private$..dmin <- jmvcore::OptionString$new(
                "dmin",
                dmin,
                default="auto")
            private$..dmax <- jmvcore::OptionString$new(
                "dmax",
                dmax,
                default="auto")
            private$..dbreaks <- jmvcore::OptionString$new(
                "dbreaks",
                dbreaks,
                default="auto")
            private$..shape_raw_reference <- jmvcore::OptionList$new(
                "shape_raw_reference",
                shape_raw_reference,
                default="square filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..shape_raw_comparison <- jmvcore::OptionList$new(
                "shape_raw_comparison",
                shape_raw_comparison,
                default="square filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..shape_summary_difference <- jmvcore::OptionList$new(
                "shape_summary_difference",
                shape_summary_difference,
                default="triangle filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..shape_raw_unused <- jmvcore::OptionList$new(
                "shape_raw_unused",
                shape_raw_unused,
                default="square filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..color_raw_reference <- jmvcore::OptionList$new(
                "color_raw_reference",
                color_raw_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_raw_comparison <- jmvcore::OptionList$new(
                "color_raw_comparison",
                color_raw_comparison,
                default="#009F81",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_raw_unused <- jmvcore::OptionList$new(
                "color_raw_unused",
                color_raw_unused,
                default="gray65",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_summary_reference <- jmvcore::OptionList$new(
                "color_summary_reference",
                color_summary_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_summary_comparison <- jmvcore::OptionList$new(
                "color_summary_comparison",
                color_summary_comparison,
                default="#009F81",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_summary_unused <- jmvcore::OptionList$new(
                "color_summary_unused",
                color_summary_unused,
                default="gray75",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_summary_difference <- jmvcore::OptionList$new(
                "color_summary_difference",
                color_summary_difference,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_summary_overall <- jmvcore::OptionList$new(
                "color_summary_overall",
                color_summary_overall,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_raw_reference <- jmvcore::OptionList$new(
                "fill_raw_reference",
                fill_raw_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_raw_comparison <- jmvcore::OptionList$new(
                "fill_raw_comparison",
                fill_raw_comparison,
                default="#009F81",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_raw_unused <- jmvcore::OptionList$new(
                "fill_raw_unused",
                fill_raw_unused,
                default="gray65",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary_reference <- jmvcore::OptionList$new(
                "fill_summary_reference",
                fill_summary_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary_comparison <- jmvcore::OptionList$new(
                "fill_summary_comparison",
                fill_summary_comparison,
                default="#009F81",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary_unused <- jmvcore::OptionList$new(
                "fill_summary_unused",
                fill_summary_unused,
                default="gray75",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary_difference <- jmvcore::OptionList$new(
                "fill_summary_difference",
                fill_summary_difference,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary_overall <- jmvcore::OptionList$new(
                "fill_summary_overall",
                fill_summary_overall,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..alpha_raw_reference <- jmvcore::OptionList$new(
                "alpha_raw_reference",
                alpha_raw_reference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_raw_comparison <- jmvcore::OptionList$new(
                "alpha_raw_comparison",
                alpha_raw_comparison,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_raw_unused <- jmvcore::OptionList$new(
                "alpha_raw_unused",
                alpha_raw_unused,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_summary_reference <- jmvcore::OptionList$new(
                "alpha_summary_reference",
                alpha_summary_reference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_summary_comparison <- jmvcore::OptionList$new(
                "alpha_summary_comparison",
                alpha_summary_comparison,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_summary_unused <- jmvcore::OptionList$new(
                "alpha_summary_unused",
                alpha_summary_unused,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_summary_difference <- jmvcore::OptionList$new(
                "alpha_summary_difference",
                alpha_summary_difference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_summary_overall <- jmvcore::OptionList$new(
                "alpha_summary_overall",
                alpha_summary_overall,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..linetype_raw_reference <- jmvcore::OptionList$new(
                "linetype_raw_reference",
                linetype_raw_reference,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..linetype_raw_comparison <- jmvcore::OptionList$new(
                "linetype_raw_comparison",
                linetype_raw_comparison,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..linetype_summary_difference <- jmvcore::OptionList$new(
                "linetype_summary_difference",
                linetype_summary_difference,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..linetype_raw_unused <- jmvcore::OptionList$new(
                "linetype_raw_unused",
                linetype_raw_unused,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..color_interval_reference <- jmvcore::OptionList$new(
                "color_interval_reference",
                color_interval_reference,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_interval_comparison <- jmvcore::OptionList$new(
                "color_interval_comparison",
                color_interval_comparison,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_interval_difference <- jmvcore::OptionList$new(
                "color_interval_difference",
                color_interval_difference,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..color_interval_unused <- jmvcore::OptionList$new(
                "color_interval_unused",
                color_interval_unused,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..size_interval_reference <- jmvcore::OptionList$new(
                "size_interval_reference",
                size_interval_reference,
                default=".50",
                options=list(
                    ".25",
                    ".50",
                    ".75",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..size_interval_comparison <- jmvcore::OptionList$new(
                "size_interval_comparison",
                size_interval_comparison,
                default=".50",
                options=list(
                    ".25",
                    ".50",
                    ".75",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..size_interval_difference <- jmvcore::OptionList$new(
                "size_interval_difference",
                size_interval_difference,
                default=".50",
                options=list(
                    ".25",
                    ".50",
                    ".75",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..size_interval_unused <- jmvcore::OptionList$new(
                "size_interval_unused",
                size_interval_unused,
                default=".50",
                options=list(
                    ".25",
                    ".50",
                    ".75",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..alpha_interval_reference <- jmvcore::OptionList$new(
                "alpha_interval_reference",
                alpha_interval_reference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_interval_comparison <- jmvcore::OptionList$new(
                "alpha_interval_comparison",
                alpha_interval_comparison,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_interval_difference <- jmvcore::OptionList$new(
                "alpha_interval_difference",
                alpha_interval_difference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_interval_unused <- jmvcore::OptionList$new(
                "alpha_interval_unused",
                alpha_interval_unused,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))

            self$.addOption(private$..switch)
            self$.addOption(private$..comparison_means)
            self$.addOption(private$..comparison_sds)
            self$.addOption(private$..comparison_ns)
            self$.addOption(private$..reference_means)
            self$.addOption(private$..reference_sds)
            self$.addOption(private$..reference_ns)
            self$.addOption(private$..r)
            self$.addOption(private$..labels)
            self$.addOption(private$..moderator)
            self$.addOption(private$..d)
            self$.addOption(private$..dcomparison_ns)
            self$.addOption(private$..dreference_ns)
            self$.addOption(private$..dr)
            self$.addOption(private$..dlabels)
            self$.addOption(private$..dmoderator)
            self$.addOption(private$..conf_level)
            self$.addOption(private$..effect_label)
            self$.addOption(private$..reported_effect_size)
            self$.addOption(private$..assume_equal_variance)
            self$.addOption(private$..random_effects)
            self$.addOption(private$..include_PIs)
            self$.addOption(private$..show_details)
            self$.addOption(private$..es_plot_width)
            self$.addOption(private$..es_plot_height)
            self$.addOption(private$..size_base)
            self$.addOption(private$..size_multiplier)
            self$.addOption(private$..axis.text.y)
            self$.addOption(private$..report_CIs)
            self$.addOption(private$..meta_diamond_height)
            self$.addOption(private$..xlab)
            self$.addOption(private$..xmin)
            self$.addOption(private$..xmax)
            self$.addOption(private$..xbreaks)
            self$.addOption(private$..mark_zero)
            self$.addOption(private$..axis.text.x)
            self$.addOption(private$..axis.title.x)
            self$.addOption(private$..dlab)
            self$.addOption(private$..dmin)
            self$.addOption(private$..dmax)
            self$.addOption(private$..dbreaks)
            self$.addOption(private$..shape_raw_reference)
            self$.addOption(private$..shape_raw_comparison)
            self$.addOption(private$..shape_summary_difference)
            self$.addOption(private$..shape_raw_unused)
            self$.addOption(private$..color_raw_reference)
            self$.addOption(private$..color_raw_comparison)
            self$.addOption(private$..color_raw_unused)
            self$.addOption(private$..color_summary_reference)
            self$.addOption(private$..color_summary_comparison)
            self$.addOption(private$..color_summary_unused)
            self$.addOption(private$..color_summary_difference)
            self$.addOption(private$..color_summary_overall)
            self$.addOption(private$..fill_raw_reference)
            self$.addOption(private$..fill_raw_comparison)
            self$.addOption(private$..fill_raw_unused)
            self$.addOption(private$..fill_summary_reference)
            self$.addOption(private$..fill_summary_comparison)
            self$.addOption(private$..fill_summary_unused)
            self$.addOption(private$..fill_summary_difference)
            self$.addOption(private$..fill_summary_overall)
            self$.addOption(private$..alpha_raw_reference)
            self$.addOption(private$..alpha_raw_comparison)
            self$.addOption(private$..alpha_raw_unused)
            self$.addOption(private$..alpha_summary_reference)
            self$.addOption(private$..alpha_summary_comparison)
            self$.addOption(private$..alpha_summary_unused)
            self$.addOption(private$..alpha_summary_difference)
            self$.addOption(private$..alpha_summary_overall)
            self$.addOption(private$..linetype_raw_reference)
            self$.addOption(private$..linetype_raw_comparison)
            self$.addOption(private$..linetype_summary_difference)
            self$.addOption(private$..linetype_raw_unused)
            self$.addOption(private$..color_interval_reference)
            self$.addOption(private$..color_interval_comparison)
            self$.addOption(private$..color_interval_difference)
            self$.addOption(private$..color_interval_unused)
            self$.addOption(private$..size_interval_reference)
            self$.addOption(private$..size_interval_comparison)
            self$.addOption(private$..size_interval_difference)
            self$.addOption(private$..size_interval_unused)
            self$.addOption(private$..alpha_interval_reference)
            self$.addOption(private$..alpha_interval_comparison)
            self$.addOption(private$..alpha_interval_difference)
            self$.addOption(private$..alpha_interval_unused)
        }),
    active = list(
        switch = function() private$..switch$value,
        comparison_means = function() private$..comparison_means$value,
        comparison_sds = function() private$..comparison_sds$value,
        comparison_ns = function() private$..comparison_ns$value,
        reference_means = function() private$..reference_means$value,
        reference_sds = function() private$..reference_sds$value,
        reference_ns = function() private$..reference_ns$value,
        r = function() private$..r$value,
        labels = function() private$..labels$value,
        moderator = function() private$..moderator$value,
        d = function() private$..d$value,
        dcomparison_ns = function() private$..dcomparison_ns$value,
        dreference_ns = function() private$..dreference_ns$value,
        dr = function() private$..dr$value,
        dlabels = function() private$..dlabels$value,
        dmoderator = function() private$..dmoderator$value,
        conf_level = function() private$..conf_level$value,
        effect_label = function() private$..effect_label$value,
        reported_effect_size = function() private$..reported_effect_size$value,
        assume_equal_variance = function() private$..assume_equal_variance$value,
        random_effects = function() private$..random_effects$value,
        include_PIs = function() private$..include_PIs$value,
        show_details = function() private$..show_details$value,
        es_plot_width = function() private$..es_plot_width$value,
        es_plot_height = function() private$..es_plot_height$value,
        size_base = function() private$..size_base$value,
        size_multiplier = function() private$..size_multiplier$value,
        axis.text.y = function() private$..axis.text.y$value,
        report_CIs = function() private$..report_CIs$value,
        meta_diamond_height = function() private$..meta_diamond_height$value,
        xlab = function() private$..xlab$value,
        xmin = function() private$..xmin$value,
        xmax = function() private$..xmax$value,
        xbreaks = function() private$..xbreaks$value,
        mark_zero = function() private$..mark_zero$value,
        axis.text.x = function() private$..axis.text.x$value,
        axis.title.x = function() private$..axis.title.x$value,
        dlab = function() private$..dlab$value,
        dmin = function() private$..dmin$value,
        dmax = function() private$..dmax$value,
        dbreaks = function() private$..dbreaks$value,
        shape_raw_reference = function() private$..shape_raw_reference$value,
        shape_raw_comparison = function() private$..shape_raw_comparison$value,
        shape_summary_difference = function() private$..shape_summary_difference$value,
        shape_raw_unused = function() private$..shape_raw_unused$value,
        color_raw_reference = function() private$..color_raw_reference$value,
        color_raw_comparison = function() private$..color_raw_comparison$value,
        color_raw_unused = function() private$..color_raw_unused$value,
        color_summary_reference = function() private$..color_summary_reference$value,
        color_summary_comparison = function() private$..color_summary_comparison$value,
        color_summary_unused = function() private$..color_summary_unused$value,
        color_summary_difference = function() private$..color_summary_difference$value,
        color_summary_overall = function() private$..color_summary_overall$value,
        fill_raw_reference = function() private$..fill_raw_reference$value,
        fill_raw_comparison = function() private$..fill_raw_comparison$value,
        fill_raw_unused = function() private$..fill_raw_unused$value,
        fill_summary_reference = function() private$..fill_summary_reference$value,
        fill_summary_comparison = function() private$..fill_summary_comparison$value,
        fill_summary_unused = function() private$..fill_summary_unused$value,
        fill_summary_difference = function() private$..fill_summary_difference$value,
        fill_summary_overall = function() private$..fill_summary_overall$value,
        alpha_raw_reference = function() private$..alpha_raw_reference$value,
        alpha_raw_comparison = function() private$..alpha_raw_comparison$value,
        alpha_raw_unused = function() private$..alpha_raw_unused$value,
        alpha_summary_reference = function() private$..alpha_summary_reference$value,
        alpha_summary_comparison = function() private$..alpha_summary_comparison$value,
        alpha_summary_unused = function() private$..alpha_summary_unused$value,
        alpha_summary_difference = function() private$..alpha_summary_difference$value,
        alpha_summary_overall = function() private$..alpha_summary_overall$value,
        linetype_raw_reference = function() private$..linetype_raw_reference$value,
        linetype_raw_comparison = function() private$..linetype_raw_comparison$value,
        linetype_summary_difference = function() private$..linetype_summary_difference$value,
        linetype_raw_unused = function() private$..linetype_raw_unused$value,
        color_interval_reference = function() private$..color_interval_reference$value,
        color_interval_comparison = function() private$..color_interval_comparison$value,
        color_interval_difference = function() private$..color_interval_difference$value,
        color_interval_unused = function() private$..color_interval_unused$value,
        size_interval_reference = function() private$..size_interval_reference$value,
        size_interval_comparison = function() private$..size_interval_comparison$value,
        size_interval_difference = function() private$..size_interval_difference$value,
        size_interval_unused = function() private$..size_interval_unused$value,
        alpha_interval_reference = function() private$..alpha_interval_reference$value,
        alpha_interval_comparison = function() private$..alpha_interval_comparison$value,
        alpha_interval_difference = function() private$..alpha_interval_difference$value,
        alpha_interval_unused = function() private$..alpha_interval_unused$value),
    private = list(
        ..switch = NA,
        ..comparison_means = NA,
        ..comparison_sds = NA,
        ..comparison_ns = NA,
        ..reference_means = NA,
        ..reference_sds = NA,
        ..reference_ns = NA,
        ..r = NA,
        ..labels = NA,
        ..moderator = NA,
        ..d = NA,
        ..dcomparison_ns = NA,
        ..dreference_ns = NA,
        ..dr = NA,
        ..dlabels = NA,
        ..dmoderator = NA,
        ..conf_level = NA,
        ..effect_label = NA,
        ..reported_effect_size = NA,
        ..assume_equal_variance = NA,
        ..random_effects = NA,
        ..include_PIs = NA,
        ..show_details = NA,
        ..es_plot_width = NA,
        ..es_plot_height = NA,
        ..size_base = NA,
        ..size_multiplier = NA,
        ..axis.text.y = NA,
        ..report_CIs = NA,
        ..meta_diamond_height = NA,
        ..xlab = NA,
        ..xmin = NA,
        ..xmax = NA,
        ..xbreaks = NA,
        ..mark_zero = NA,
        ..axis.text.x = NA,
        ..axis.title.x = NA,
        ..dlab = NA,
        ..dmin = NA,
        ..dmax = NA,
        ..dbreaks = NA,
        ..shape_raw_reference = NA,
        ..shape_raw_comparison = NA,
        ..shape_summary_difference = NA,
        ..shape_raw_unused = NA,
        ..color_raw_reference = NA,
        ..color_raw_comparison = NA,
        ..color_raw_unused = NA,
        ..color_summary_reference = NA,
        ..color_summary_comparison = NA,
        ..color_summary_unused = NA,
        ..color_summary_difference = NA,
        ..color_summary_overall = NA,
        ..fill_raw_reference = NA,
        ..fill_raw_comparison = NA,
        ..fill_raw_unused = NA,
        ..fill_summary_reference = NA,
        ..fill_summary_comparison = NA,
        ..fill_summary_unused = NA,
        ..fill_summary_difference = NA,
        ..fill_summary_overall = NA,
        ..alpha_raw_reference = NA,
        ..alpha_raw_comparison = NA,
        ..alpha_raw_unused = NA,
        ..alpha_summary_reference = NA,
        ..alpha_summary_comparison = NA,
        ..alpha_summary_unused = NA,
        ..alpha_summary_difference = NA,
        ..alpha_summary_overall = NA,
        ..linetype_raw_reference = NA,
        ..linetype_raw_comparison = NA,
        ..linetype_summary_difference = NA,
        ..linetype_raw_unused = NA,
        ..color_interval_reference = NA,
        ..color_interval_comparison = NA,
        ..color_interval_difference = NA,
        ..color_interval_unused = NA,
        ..size_interval_reference = NA,
        ..size_interval_comparison = NA,
        ..size_interval_difference = NA,
        ..size_interval_unused = NA,
        ..alpha_interval_reference = NA,
        ..alpha_interval_comparison = NA,
        ..alpha_interval_difference = NA,
        ..alpha_interval_unused = NA)
)

jamovimetamdiffResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovimetamdiffResults",
    inherit = jmvcore::Group,
    active = list(
        debug = function() private$.items[["debug"]],
        help = function() private$.items[["help"]],
        raw_data = function() private$.items[["raw_data"]],
        es_meta = function() private$.items[["es_meta"]],
        es_heterogeneity = function() private$.items[["es_heterogeneity"]],
        es_meta_difference = function() private$.items[["es_meta_difference"]],
        estimation_plot_warnings = function() private$.items[["estimation_plot_warnings"]],
        estimation_plots = function() private$.items[["estimation_plots"]]),
    private = list(),
    public=list(
        initialize=function(options) {
            super$initialize(
                options=options,
                name="",
                title="Meta-Analysis: Difference in Means")
            self$add(jmvcore::Html$new(
                options=options,
                name="debug",
                visible=FALSE))
            self$add(jmvcore::Html$new(
                options=options,
                name="help",
                visible=FALSE))
            self$add(jmvcore::Table$new(
                options=options,
                name="raw_data",
                title="Table of Studies",
                rows=1,
                clearWith=list(
                    "switch",
                    "comparison_means",
                    "comparison_sds",
                    "comparison_ns",
                    "reference_means",
                    "reference_sds",
                    "reference_ns",
                    "r",
                    "labels",
                    "moderator",
                    "d",
                    "dcomparison_ns",
                    "dreference_ns",
                    "dr",
                    "dlabels",
                    "dmoderator",
                    "conf_level",
                    "effect_label",
                    "reported_effect_size",
                    "assume_equal_variance",
                    "random_effects",
                    "show_details"),
                columns=list(
                    list(
                        `name`="label", 
                        `title`="label", 
                        `type`="text"),
                    list(
                        `name`="moderator", 
                        `title`="Moderator level", 
                        `type`="text"),
                    list(
                        `name`="effect_size", 
                        `type`="number", 
                        `title`="<i>M</i><sub>diff</sub>", 
                        `visible`="(reported_effect_size == \"mean_difference\" & switch == \"from_raw\")"),
                    list(
                        `name`="effect_size_smd", 
                        `type`="number", 
                        `title`="<i>d</i><sub>avg</sub>", 
                        `visible`="(reported_effect_size == \"smd_unbiased\" | switch == \"from_d\")"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"),
                    list(
                        `name`="weight", 
                        `title`="Weight", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="SE", 
                        `title`="<i>SE</i>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="sample_variance", 
                        `title`="<i>SE</i><sup>2</sup>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="reference_mean", 
                        `title`="<i>M</i><sub>reference</sub>", 
                        `type`="number", 
                        `visible`="(show_details & switch == \"from_raw\")"),
                    list(
                        `name`="reference_sd", 
                        `title`="<i>s</i><sub>reference</sub>", 
                        `type`="number", 
                        `visible`="(show_details & switch == \"from_raw\")"),
                    list(
                        `name`="reference_n", 
                        `title`="<i>n</i><sub>reference</sub>", 
                        `type`="integer", 
                        `visible`="(show_details)"),
                    list(
                        `name`="comparison_mean", 
                        `title`="<i>M</i><sub>comparison</sub>", 
                        `type`="number", 
                        `visible`="(show_details & switch == \"from_raw\")"),
                    list(
                        `name`="comparison_sd", 
                        `title`="<i>s</i><sub>comparison</sub>", 
                        `type`="number", 
                        `visible`="(show_details & switch == \"from_raw\")"),
                    list(
                        `name`="comparison_n", 
                        `title`="<i>n</i><sub>comparison</sub>", 
                        `type`="integer", 
                        `visible`="(show_details)"),
                    list(
                        `name`="r", 
                        `title`="<i>r</i>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="df", 
                        `title`="<i>df</i>", 
                        `type`="number", 
                        `visible`="(show_details & !assume_equal_variance)"),
                    list(
                        `name`="df_i", 
                        `title`="<i>df</i>", 
                        `type`="integer", 
                        `visible`="(show_details & assume_equal_variance)"),
                    list(
                        `name`="p", 
                        `title`="<i>p</i>, two tailed", 
                        `visible`="(show_details)", 
                        `type`="number", 
                        `format`="zto,pvalue"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="es_meta",
                title="Meta-Analytic Effect Sizes",
                rows=1,
                refs="metafor",
                clearWith=list(
                    "switch",
                    "comparison_means",
                    "comparison_sds",
                    "comparison_ns",
                    "reference_means",
                    "reference_sds",
                    "reference_ns",
                    "r",
                    "labels",
                    "moderator",
                    "d",
                    "dcomparison_ns",
                    "dreference_ns",
                    "dr",
                    "dlabels",
                    "dmoderator",
                    "conf_level",
                    "effect_label",
                    "reported_effect_size",
                    "assume_equal_variance",
                    "random_effects",
                    "show_details"),
                columns=list(
                    list(
                        `name`="effect_label", 
                        `title`="Effect", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="moderator_variable_name", 
                        `title`="Moderator", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="moderator_variable_level", 
                        `title`="Level", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="effect_size", 
                        `type`="number", 
                        `title`="<i>M</i>", 
                        `visible`="(reported_effect_size == \"mean_difference\" & switch == \"from_raw\")"),
                    list(
                        `name`="effect_size_smd", 
                        `type`="number", 
                        `title`="<i>d</i><sub>1</sub>", 
                        `visible`="(reported_effect_size == \"smd_unbiased\" | switch == \"from_d\")"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"),
                    list(
                        `name`="SE", 
                        `title`="<i>SE</i>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="k", 
                        `type`="integer", 
                        `title`="<i>k</i>"),
                    list(
                        `name`="PI_LL", 
                        `title`="LL", 
                        `type`="number", 
                        `visible`="(include_PIs & random_effects == 'random_effects')"),
                    list(
                        `name`="PI_UL", 
                        `title`="UL", 
                        `type`="number", 
                        `visible`="(include_PIs & random_effects == 'random_effects')"),
                    list(
                        `name`="p", 
                        `visible`="(show_details)", 
                        `title`="<i>p</i>, two tailed", 
                        `type`="number", 
                        `format`="zto,pvalue"),
                    list(
                        `name`="FE_CI_width", 
                        `type`="number", 
                        `title`="FE CI length", 
                        `visible`="(random_effects == 'compare' | show_details)"),
                    list(
                        `name`="RE_CI_width", 
                        `type`="number", 
                        `title`="RE CI length", 
                        `visible`="(random_effects == 'compare' | show_details)"),
                    list(
                        `name`="diamond_ratio", 
                        `type`="number", 
                        `title`="Diamond ratio", 
                        `visible`=FALSE),
                    list(
                        `name`="diamond_ratio_LL", 
                        `title`="LL", 
                        `type`="number", 
                        `visible`=FALSE),
                    list(
                        `name`="diamond_ratio_UL", 
                        `type`="number", 
                        `title`="UL", 
                        `visible`=FALSE),
                    list(
                        `name`="I2", 
                        `type`="number", 
                        `title`="<i>I</i><sup>2</sup>", 
                        `visible`=FALSE),
                    list(
                        `name`="I2_LL", 
                        `type`="number", 
                        `title`="LL", 
                        `visible`=FALSE),
                    list(
                        `name`="I2_UL", 
                        `type`="number", 
                        `title`="UL", 
                        `visible`=FALSE),
                    list(
                        `name`="FE_effect_size", 
                        `type`="number", 
                        `title`="FE effect size", 
                        `visible`="(random_effects == 'compare')"),
                    list(
                        `name`="RE_effect_size", 
                        `type`="number", 
                        `title`="RE effect size", 
                        `visible`="(random_effects == 'compare')"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="es_heterogeneity",
                title="Effect Size Heterogeneity",
                rows=1,
                clearWith=list(
                    "switch",
                    "comparison_means",
                    "comparison_sds",
                    "comparison_ns",
                    "reference_means",
                    "reference_sds",
                    "reference_ns",
                    "r",
                    "labels",
                    "moderator",
                    "d",
                    "dcomparison_ns",
                    "dreference_ns",
                    "dr",
                    "dlabels",
                    "dmoderator",
                    "conf_level",
                    "effect_label",
                    "reported_effect_size",
                    "assume_equal_variance",
                    "random_effects",
                    "show_details"),
                columns=list(
                    list(
                        `name`="measure", 
                        `title`="Measure", 
                        `type`="text", 
                        `combineBelow`=TRUE, 
                        `visible`=FALSE),
                    list(
                        `name`="measure_html", 
                        `title`="Measure", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="moderator_level", 
                        `title`="Level", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="estimate", 
                        `type`="number", 
                        `title`="Estimate"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="es_meta_difference",
                title="Moderator Analysis",
                rows=3,
                clearWith=list(
                    "switch",
                    "comparison_means",
                    "comparison_sds",
                    "comparison_ns",
                    "reference_means",
                    "reference_sds",
                    "reference_ns",
                    "r",
                    "labels",
                    "moderator",
                    "d",
                    "dcomparison_ns",
                    "dreference_ns",
                    "dr",
                    "dlabels",
                    "dmoderator",
                    "conf_level",
                    "effect_label",
                    "reported_effect_size",
                    "assume_equal_variance",
                    "random_effects",
                    "show_details"),
                columns=list(
                    list(
                        `name`="effect_label", 
                        `title`="Effect", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="moderator_variable_name", 
                        `title`="Moderator", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="moderator_level", 
                        `title`="Level", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="effect_size", 
                        `type`="number", 
                        `title`="<i>M</i>", 
                        `visible`="(reported_effect_size == \"mean_difference\" & switch == \"from_raw\")"),
                    list(
                        `name`="effect_size_smd", 
                        `type`="number", 
                        `title`="<i>d</i><sub>1</sub>", 
                        `visible`="(reported_effect_size == \"smd_unbiased\" | switch == \"from_d\")"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"),
                    list(
                        `name`="SE", 
                        `title`="<i>SE</i>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="p", 
                        `visible`="(show_details)", 
                        `title`="<i>p</i>, two tailed", 
                        `type`="number", 
                        `format`="zto,pvalue"))))
            self$add(jmvcore::Html$new(
                options=options,
                name="estimation_plot_warnings",
                title="Forest Plot Warnings",
                visible=TRUE))
            self$add(jmvcore::Image$new(
                options=options,
                name="estimation_plots",
                title="Forest Plot",
                requiresData=TRUE,
                width=400,
                height=300,
                renderFun=".estimation_plots"))}))

jamovimetamdiffBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovimetamdiffBase",
    inherit = jmvcore::Analysis,
    public = list(
        initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
            super$initialize(
                package = "esci",
                name = "jamovimetamdiff",
                version = c(1,0,0),
                options = options,
                results = jamovimetamdiffResults$new(options=options),
                data = data,
                datasetId = datasetId,
                analysisId = analysisId,
                revision = revision,
                pause = NULL,
                completeWhenFilled = FALSE,
                requiresMissings = FALSE,
                weightsSupport = 'auto')
        }))

#' Meta-Analysis: Difference in Means
#'
#' 
#' @param switch .
#' @param data .
#' @param comparison_means .
#' @param comparison_sds .
#' @param comparison_ns .
#' @param reference_means .
#' @param reference_sds .
#' @param reference_ns .
#' @param r .
#' @param labels .
#' @param moderator .
#' @param d .
#' @param dcomparison_ns .
#' @param dreference_ns .
#' @param dr .
#' @param dlabels .
#' @param dmoderator .
#' @param conf_level .
#' @param effect_label .
#' @param reported_effect_size .
#' @param assume_equal_variance .
#' @param random_effects .
#' @param include_PIs .
#' @param show_details .
#' @param es_plot_width .
#' @param es_plot_height .
#' @param size_base .
#' @param size_multiplier .
#' @param axis.text.y .
#' @param report_CIs .
#' @param meta_diamond_height .
#' @param xlab .
#' @param xmin .
#' @param xmax .
#' @param xbreaks .
#' @param mark_zero .
#' @param axis.text.x .
#' @param axis.title.x .
#' @param dlab .
#' @param dmin .
#' @param dmax .
#' @param dbreaks .
#' @param shape_raw_reference .
#' @param shape_raw_comparison .
#' @param shape_summary_difference .
#' @param shape_raw_unused .
#' @param color_raw_reference .
#' @param color_raw_comparison .
#' @param color_raw_unused .
#' @param color_summary_reference .
#' @param color_summary_comparison .
#' @param color_summary_unused .
#' @param color_summary_difference .
#' @param color_summary_overall .
#' @param fill_raw_reference .
#' @param fill_raw_comparison .
#' @param fill_raw_unused .
#' @param fill_summary_reference .
#' @param fill_summary_comparison .
#' @param fill_summary_unused .
#' @param fill_summary_difference .
#' @param fill_summary_overall .
#' @param alpha_raw_reference .
#' @param alpha_raw_comparison .
#' @param alpha_raw_unused .
#' @param alpha_summary_reference .
#' @param alpha_summary_comparison .
#' @param alpha_summary_unused .
#' @param alpha_summary_difference .
#' @param alpha_summary_overall .
#' @param linetype_raw_reference .
#' @param linetype_raw_comparison .
#' @param linetype_summary_difference .
#' @param linetype_raw_unused .
#' @param color_interval_reference .
#' @param color_interval_comparison .
#' @param color_interval_difference .
#' @param color_interval_unused .
#' @param size_interval_reference .
#' @param size_interval_comparison .
#' @param size_interval_difference .
#' @param size_interval_unused .
#' @param alpha_interval_reference .
#' @param alpha_interval_comparison .
#' @param alpha_interval_difference .
#' @param alpha_interval_unused .
#' @return A results object containing:
#' \tabular{llllll}{
#'   \code{results$debug} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$help} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$raw_data} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$es_meta} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$es_heterogeneity} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$es_meta_difference} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$estimation_plot_warnings} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$estimation_plots} \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$raw_data$asDF}
#'
#' \code{as.data.frame(results$raw_data)}
#'
#' @export
jamovimetamdiff <- function(
    switch = "from_raw",
    data,
    comparison_means,
    comparison_sds,
    comparison_ns,
    reference_means,
    reference_sds,
    reference_ns,
    r,
    labels,
    moderator,
    d,
    dcomparison_ns,
    dreference_ns,
    dr,
    dlabels,
    dmoderator,
    conf_level = 95,
    effect_label = "My effect",
    reported_effect_size = "mean_difference",
    assume_equal_variance = TRUE,
    random_effects = "random_effects",
    include_PIs = FALSE,
    show_details = FALSE,
    es_plot_width = "600",
    es_plot_height = "750",
    size_base = "2",
    size_multiplier = "3",
    axis.text.y = "14",
    report_CIs = FALSE,
    meta_diamond_height = ".25",
    xlab = "auto",
    xmin = "auto",
    xmax = "auto",
    xbreaks = "auto",
    mark_zero = TRUE,
    axis.text.x = "14",
    axis.title.x = "15",
    dlab = "auto",
    dmin = "auto",
    dmax = "auto",
    dbreaks = "auto",
    shape_raw_reference = "square filled",
    shape_raw_comparison = "square filled",
    shape_summary_difference = "triangle filled",
    shape_raw_unused = "square filled",
    color_raw_reference = "#008DF9",
    color_raw_comparison = "#009F81",
    color_raw_unused = "gray65",
    color_summary_reference = "#008DF9",
    color_summary_comparison = "#009F81",
    color_summary_unused = "gray75",
    color_summary_difference = "black",
    color_summary_overall = "black",
    fill_raw_reference = "#008DF9",
    fill_raw_comparison = "#009F81",
    fill_raw_unused = "gray65",
    fill_summary_reference = "#008DF9",
    fill_summary_comparison = "#009F81",
    fill_summary_unused = "gray75",
    fill_summary_difference = "black",
    fill_summary_overall = "black",
    alpha_raw_reference = "1",
    alpha_raw_comparison = "1",
    alpha_raw_unused = "1",
    alpha_summary_reference = "1",
    alpha_summary_comparison = "1",
    alpha_summary_unused = "1",
    alpha_summary_difference = "1",
    alpha_summary_overall = "1",
    linetype_raw_reference = "solid",
    linetype_raw_comparison = "solid",
    linetype_summary_difference = "solid",
    linetype_raw_unused = "solid",
    color_interval_reference = "black",
    color_interval_comparison = "black",
    color_interval_difference = "black",
    color_interval_unused = "black",
    size_interval_reference = ".50",
    size_interval_comparison = ".50",
    size_interval_difference = ".50",
    size_interval_unused = ".50",
    alpha_interval_reference = "1",
    alpha_interval_comparison = "1",
    alpha_interval_difference = "1",
    alpha_interval_unused = "1") {

    if ( ! requireNamespace("jmvcore", quietly=TRUE))
        stop("jamovimetamdiff requires jmvcore to be installed (restart may be required)")

    if ( ! missing(comparison_means)) comparison_means <- jmvcore::resolveQuo(jmvcore::enquo(comparison_means))
    if ( ! missing(comparison_sds)) comparison_sds <- jmvcore::resolveQuo(jmvcore::enquo(comparison_sds))
    if ( ! missing(comparison_ns)) comparison_ns <- jmvcore::resolveQuo(jmvcore::enquo(comparison_ns))
    if ( ! missing(reference_means)) reference_means <- jmvcore::resolveQuo(jmvcore::enquo(reference_means))
    if ( ! missing(reference_sds)) reference_sds <- jmvcore::resolveQuo(jmvcore::enquo(reference_sds))
    if ( ! missing(reference_ns)) reference_ns <- jmvcore::resolveQuo(jmvcore::enquo(reference_ns))
    if ( ! missing(r)) r <- jmvcore::resolveQuo(jmvcore::enquo(r))
    if ( ! missing(labels)) labels <- jmvcore::resolveQuo(jmvcore::enquo(labels))
    if ( ! missing(moderator)) moderator <- jmvcore::resolveQuo(jmvcore::enquo(moderator))
    if ( ! missing(d)) d <- jmvcore::resolveQuo(jmvcore::enquo(d))
    if ( ! missing(dcomparison_ns)) dcomparison_ns <- jmvcore::resolveQuo(jmvcore::enquo(dcomparison_ns))
    if ( ! missing(dreference_ns)) dreference_ns <- jmvcore::resolveQuo(jmvcore::enquo(dreference_ns))
    if ( ! missing(dr)) dr <- jmvcore::resolveQuo(jmvcore::enquo(dr))
    if ( ! missing(dlabels)) dlabels <- jmvcore::resolveQuo(jmvcore::enquo(dlabels))
    if ( ! missing(dmoderator)) dmoderator <- jmvcore::resolveQuo(jmvcore::enquo(dmoderator))
    if (missing(data))
        data <- jmvcore::marshalData(
            parent.frame(),
            `if`( ! missing(comparison_means), comparison_means, NULL),
            `if`( ! missing(comparison_sds), comparison_sds, NULL),
            `if`( ! missing(comparison_ns), comparison_ns, NULL),
            `if`( ! missing(reference_means), reference_means, NULL),
            `if`( ! missing(reference_sds), reference_sds, NULL),
            `if`( ! missing(reference_ns), reference_ns, NULL),
            `if`( ! missing(r), r, NULL),
            `if`( ! missing(labels), labels, NULL),
            `if`( ! missing(moderator), moderator, NULL),
            `if`( ! missing(d), d, NULL),
            `if`( ! missing(dcomparison_ns), dcomparison_ns, NULL),
            `if`( ! missing(dreference_ns), dreference_ns, NULL),
            `if`( ! missing(dr), dr, NULL),
            `if`( ! missing(dlabels), dlabels, NULL),
            `if`( ! missing(dmoderator), dmoderator, NULL))

    for (v in labels) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
    for (v in moderator) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
    for (v in dlabels) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
    for (v in dmoderator) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])

    options <- jamovimetamdiffOptions$new(
        switch = switch,
        comparison_means = comparison_means,
        comparison_sds = comparison_sds,
        comparison_ns = comparison_ns,
        reference_means = reference_means,
        reference_sds = reference_sds,
        reference_ns = reference_ns,
        r = r,
        labels = labels,
        moderator = moderator,
        d = d,
        dcomparison_ns = dcomparison_ns,
        dreference_ns = dreference_ns,
        dr = dr,
        dlabels = dlabels,
        dmoderator = dmoderator,
        conf_level = conf_level,
        effect_label = effect_label,
        reported_effect_size = reported_effect_size,
        assume_equal_variance = assume_equal_variance,
        random_effects = random_effects,
        include_PIs = include_PIs,
        show_details = show_details,
        es_plot_width = es_plot_width,
        es_plot_height = es_plot_height,
        size_base = size_base,
        size_multiplier = size_multiplier,
        axis.text.y = axis.text.y,
        report_CIs = report_CIs,
        meta_diamond_height = meta_diamond_height,
        xlab = xlab,
        xmin = xmin,
        xmax = xmax,
        xbreaks = xbreaks,
        mark_zero = mark_zero,
        axis.text.x = axis.text.x,
        axis.title.x = axis.title.x,
        dlab = dlab,
        dmin = dmin,
        dmax = dmax,
        dbreaks = dbreaks,
        shape_raw_reference = shape_raw_reference,
        shape_raw_comparison = shape_raw_comparison,
        shape_summary_difference = shape_summary_difference,
        shape_raw_unused = shape_raw_unused,
        color_raw_reference = color_raw_reference,
        color_raw_comparison = color_raw_comparison,
        color_raw_unused = color_raw_unused,
        color_summary_reference = color_summary_reference,
        color_summary_comparison = color_summary_comparison,
        color_summary_unused = color_summary_unused,
        color_summary_difference = color_summary_difference,
        color_summary_overall = color_summary_overall,
        fill_raw_reference = fill_raw_reference,
        fill_raw_comparison = fill_raw_comparison,
        fill_raw_unused = fill_raw_unused,
        fill_summary_reference = fill_summary_reference,
        fill_summary_comparison = fill_summary_comparison,
        fill_summary_unused = fill_summary_unused,
        fill_summary_difference = fill_summary_difference,
        fill_summary_overall = fill_summary_overall,
        alpha_raw_reference = alpha_raw_reference,
        alpha_raw_comparison = alpha_raw_comparison,
        alpha_raw_unused = alpha_raw_unused,
        alpha_summary_reference = alpha_summary_reference,
        alpha_summary_comparison = alpha_summary_comparison,
        alpha_summary_unused = alpha_summary_unused,
        alpha_summary_difference = alpha_summary_difference,
        alpha_summary_overall = alpha_summary_overall,
        linetype_raw_reference = linetype_raw_reference,
        linetype_raw_comparison = linetype_raw_comparison,
        linetype_summary_difference = linetype_summary_difference,
        linetype_raw_unused = linetype_raw_unused,
        color_interval_reference = color_interval_reference,
        color_interval_comparison = color_interval_comparison,
        color_interval_difference = color_interval_difference,
        color_interval_unused = color_interval_unused,
        size_interval_reference = size_interval_reference,
        size_interval_comparison = size_interval_comparison,
        size_interval_difference = size_interval_difference,
        size_interval_unused = size_interval_unused,
        alpha_interval_reference = alpha_interval_reference,
        alpha_interval_comparison = alpha_interval_comparison,
        alpha_interval_difference = alpha_interval_difference,
        alpha_interval_unused = alpha_interval_unused)

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

    analysis$run()

    analysis$results
}
rcalinjageman/esci documentation built on March 29, 2024, 7:30 p.m.