FDR cutoff keeps only the significant comparisons


Economist GGPlot Excel Paul Tol Black And White Solarized Stata Tableau Wall Street CanvasXpress
<html>

  <head>
    <!-- Include the CanvasXpress library in your HTML file -->
    <link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
    <script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
  </head>

  <body>

    <!-- Create a canvas element for the chart with the desired dimensions -->
    <div>
      <canvas id="canvasId" width="600" height="600"></canvas>
    </div>


    <!-- Create a script to initialize the chart -->
    <script>

      // Use a data frame (2D-array) for the graph
      var data = 

      // Create the configuration for the graph
      var config = {
         "graphType" : "Boxplot",
         "graphOrientation" : "vertical",
         "groupingFactors" : [
            "feed"
         ],
         "xAxis" : [
            "weight"
         ],
         "xAxisTitle" : "weight",
         "smpTitle" : "feed",
         "smpTitleFontStyle" : "bold",
         "axisTitleFontStyle" : "bold",
         "axisAlgorithm" : "rPretty",
         "smpTextRotate" : 0,
         "showLegend" : false,
         "colorBy" : "feed",
         "title" : "Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
         "showStatInference" : true,
         "statInference" : {
            "correction" : {
               "method" : "holm"
            },
            "annotate" : "stars",
            "fdrThreshold" : 0.05,
            "comparisons" : [
               {
                  "groups" : [
                     "casein",
                     "horsebean"
                  ],
                  "p" : 7.21024958119126e-07
               },
               {
                  "groups" : [
                     "casein",
                     "linseed"
                  ],
                  "p" : 0.000260621659714803
               },
               {
                  "groups" : [
                     "casein",
                     "soybean"
                  ],
                  "p" : 0.00352126345222498
               },
               {
                  "groups" : [
                     "casein",
                     "sunflower"
                  ],
                  "p" : 0.821511771366324
               },
               {
                  "groups" : [
                     "casein",
                     "meatmeal"
                  ],
                  "p" : 0.0986622155842758
               }
            ]
         },
         "colorScheme" : "Set2"
      }

      // Event used to create graph (optional)
      var events = false

      // Call the CanvasXpress function to create the graph
      var cX = new CanvasXpress("canvasId", data, config, events);

    </script>

  </body>

</html>
<html>

  <head>
    <!-- Include the CanvasXpress library in your HTML file -->
    <link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
    <script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
  </head>

  <body>

    <!-- Create a canvas element for the chart with the desired dimensions -->
    <div>
      <canvas id="canvasId" width="600" height="600"></canvas>
    </div>


    <!-- Create a script to initialize the chart -->
    <script>

      // Create the data for the graph
      var data = {
         "y" : {
            "vars" : [
               "weight"
            ],
            "smps" : [
               "Obs1",
               "Obs2",
               "Obs3",
               "Obs4",
               "Obs5",
               "Obs6",
               "Obs7",
               "Obs8",
               "Obs9",
               "Obs10",
               "Obs11",
               "Obs12",
               "Obs13",
               "Obs14",
               "Obs15",
               "Obs16",
               "Obs17",
               "Obs18",
               "Obs19",
               "Obs20",
               "Obs21",
               "Obs22",
               "Obs23",
               "Obs24",
               "Obs25",
               "Obs26",
               "Obs27",
               "Obs28",
               "Obs29",
               "Obs30",
               "Obs31",
               "Obs32",
               "Obs33",
               "Obs34",
               "Obs35",
               "Obs36",
               "Obs37",
               "Obs38",
               "Obs39",
               "Obs40",
               "Obs41",
               "Obs42",
               "Obs43",
               "Obs44",
               "Obs45",
               "Obs46",
               "Obs47",
               "Obs48",
               "Obs49",
               "Obs50",
               "Obs51",
               "Obs52",
               "Obs53",
               "Obs54",
               "Obs55",
               "Obs56",
               "Obs57",
               "Obs58",
               "Obs59",
               "Obs60",
               "Obs61",
               "Obs62",
               "Obs63",
               "Obs64",
               "Obs65",
               "Obs66",
               "Obs67",
               "Obs68",
               "Obs69",
               "Obs70",
               "Obs71"
            ],
            "data" : [
               [
                  368,
                  390,
                  379,
                  260,
                  404,
                  318,
                  352,
                  359,
                  216,
                  222,
                  283,
                  332,
                  179,
                  160,
                  136,
                  227,
                  217,
                  168,
                  108,
                  124,
                  143,
                  140,
                  309,
                  229,
                  181,
                  141,
                  260,
                  203,
                  148,
                  169,
                  213,
                  257,
                  244,
                  271,
                  243,
                  230,
                  248,
                  327,
                  329,
                  250,
                  193,
                  271,
                  316,
                  267,
                  199,
                  171,
                  158,
                  248,
                  423,
                  340,
                  392,
                  339,
                  341,
                  226,
                  320,
                  295,
                  334,
                  322,
                  297,
                  318,
                  325,
                  257,
                  303,
                  315,
                  380,
                  153,
                  263,
                  242,
                  206,
                  344,
                  258
               ]
            ]
         },
         "x" : {
            "feed" : [
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "casein",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "horsebean",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "linseed",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "soybean",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "sunflower",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal",
               "meatmeal"
            ]
         }
      }

      // Create the configuration for the graph
      var config = {
         "graphType" : "Boxplot",
         "graphOrientation" : "vertical",
         "groupingFactors" : [
            "feed"
         ],
         "xAxis" : [
            "weight"
         ],
         "xAxisTitle" : "weight",
         "smpTitle" : "feed",
         "smpTitleFontStyle" : "bold",
         "axisTitleFontStyle" : "bold",
         "axisAlgorithm" : "rPretty",
         "smpTextRotate" : 0,
         "showLegend" : false,
         "colorBy" : "feed",
         "title" : "Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
         "showStatInference" : true,
         "statInference" : {
            "correction" : {
               "method" : "holm"
            },
            "annotate" : "stars",
            "fdrThreshold" : 0.05,
            "comparisons" : [
               {
                  "groups" : [
                     "casein",
                     "horsebean"
                  ],
                  "p" : 7.21024958119126e-07
               },
               {
                  "groups" : [
                     "casein",
                     "linseed"
                  ],
                  "p" : 0.000260621659714803
               },
               {
                  "groups" : [
                     "casein",
                     "soybean"
                  ],
                  "p" : 0.00352126345222498
               },
               {
                  "groups" : [
                     "casein",
                     "sunflower"
                  ],
                  "p" : 0.821511771366324
               },
               {
                  "groups" : [
                     "casein",
                     "meatmeal"
                  ],
                  "p" : 0.0986622155842758
               }
            ]
         },
         "colorScheme" : "Set2"
      }

      // Event used to create graph (optional)
      var events = false

            // Call the CanvasXpress function to create the graph
      var cX = new CanvasXpress("canvasId", data, config, events);

    </script>

  </body>

</html>
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/r/cX-statistics4-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
x=read.table("https://www.canvasxpress.org/data/r/cX-statistics4-smp.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
data=y,
smpAnnot=x,
axisAlgorithm="rPretty",
axisTitleFontStyle="bold",
colorBy="feed",
colorScheme="Set2",
graphOrientation="vertical",
graphType="Boxplot",
groupingFactors=list("feed"),
showLegend=FALSE,
showStatInference=TRUE,
smpTextRotate=0,
smpTitle="feed",
smpTitleFontStyle="bold",
statInference=list(annotate="stars", comparisons=list(list(groups=list("casein", "horsebean"), p=7.21024958119126e-07), list(groups=list("casein", "linseed"), p=0.000260621659714803), list(groups=list("casein", "soybean"), p=0.00352126345222498), list(groups=list("casein", "sunflower"), p=0.821511771366324), list(groups=list("casein", "meatmeal"), p=0.0986622155842758)), correction=list(method="holm"), fdrThreshold=0.05),
title="Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
xAxis=list("weight"),
xAxisTitle="weight"
)
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import show_in_browser

if __name__ == "__main__":
  # Define the chart with its data and configuration
  chart: CanvasXpress = CanvasXpress(
    render_to = "statistics4",
    data = {
      "y": {
        "vars": ["weight"],
        "smps": ["Obs1", "Obs2", "Obs3", "Obs4", "Obs5", "Obs6", "Obs7", "Obs8", "Obs9", "Obs10", "Obs11", "Obs12", "Obs13", "Obs14", "Obs15", "Obs16", "Obs17", "Obs18", "Obs19", "Obs20", "Obs21", "Obs22", "Obs23", "Obs24", "Obs25", "Obs26", "Obs27", "Obs28", "Obs29", "Obs30", "Obs31", "Obs32", "Obs33", "Obs34", "Obs35", "Obs36", "Obs37", "Obs38", "Obs39", "Obs40", "Obs41", "Obs42", "Obs43", "Obs44", "Obs45", "Obs46", "Obs47", "Obs48", "Obs49", "Obs50", "Obs51", "Obs52", "Obs53", "Obs54", "Obs55", "Obs56", "Obs57", "Obs58", "Obs59", "Obs60", "Obs61", "Obs62", "Obs63", "Obs64", "Obs65", "Obs66", "Obs67", "Obs68", "Obs69", "Obs70", "Obs71"],
        "data": [
          [368, 390, 379, 260, 404, 318, 352, 359, 216, 222, 283, 332, 179, 160, 136, 227, 217, 168, 108, 124, 143, 140, 309, 229, 181, 141, 260, 203, 148, 169, 213, 257, 244, 271, 243, 230, 248, 327, 329, 250, 193, 271, 316, 267, 199, 171, 158, 248, 423, 340, 392, 339, 341, 226, 320, 295, 334, 322, 297, 318, 325, 257, 303, 315, 380, 153, 263, 242, 206, 344, 258]
        ]
      },
      "x": {
        "feed": ["casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal"]
      }
    },
    config = {
      "graphType": "Boxplot",
      "graphOrientation": "vertical",
      "groupingFactors": ["feed"],
      "xAxis": ["weight"],
      "xAxisTitle": "weight",
      "smpTitle": "feed",
      "smpTitleFontStyle": "bold",
      "axisTitleFontStyle": "bold",
      "axisAlgorithm": "rPretty",
      "smpTextRotate": 0,
      "showLegend": False,
      "colorBy": "feed",
      "title": "Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
      "showStatInference": True,
      "statInference": {
        "correction": {
          "method": "holm"
        },
        "annotate": "stars",
        "fdrThreshold": 0.05,
        "comparisons": [
          {
            "groups": ["casein", "horsebean"],
            "p": 7.21024958119126e-07
          },
          {
            "groups": ["casein", "linseed"],
            "p": 0.000260621659714803
          },
          {
            "groups": ["casein", "soybean"],
            "p": 0.00352126345222498
          },
          {
            "groups": ["casein", "sunflower"],
            "p": 0.821511771366324
          },
          {
            "groups": ["casein", "meatmeal"],
            "p": 0.0986622155842758
          }
        ]
      },
      "colorScheme": "Set2"
    },
    width = 600,
    height = 600
  )

  # Display the chart in its own Web page
  show_in_browser(chart)
Run this notebook: Open in Binder
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import graph

graph(
  CanvasXpress(
    render_to = "statistics4",
    data = {
      "y": {
        "vars": ["weight"],
        "smps": ["Obs1", "Obs2", "Obs3", "Obs4", "Obs5", "Obs6", "Obs7", "Obs8", "Obs9", "Obs10", "Obs11", "Obs12", "Obs13", "Obs14", "Obs15", "Obs16", "Obs17", "Obs18", "Obs19", "Obs20", "Obs21", "Obs22", "Obs23", "Obs24", "Obs25", "Obs26", "Obs27", "Obs28", "Obs29", "Obs30", "Obs31", "Obs32", "Obs33", "Obs34", "Obs35", "Obs36", "Obs37", "Obs38", "Obs39", "Obs40", "Obs41", "Obs42", "Obs43", "Obs44", "Obs45", "Obs46", "Obs47", "Obs48", "Obs49", "Obs50", "Obs51", "Obs52", "Obs53", "Obs54", "Obs55", "Obs56", "Obs57", "Obs58", "Obs59", "Obs60", "Obs61", "Obs62", "Obs63", "Obs64", "Obs65", "Obs66", "Obs67", "Obs68", "Obs69", "Obs70", "Obs71"],
        "data": [
          [368, 390, 379, 260, 404, 318, 352, 359, 216, 222, 283, 332, 179, 160, 136, 227, 217, 168, 108, 124, 143, 140, 309, 229, 181, 141, 260, 203, 148, 169, 213, 257, 244, 271, 243, 230, 248, 327, 329, 250, 193, 271, 316, 267, 199, 171, 158, 248, 423, 340, 392, 339, 341, 226, 320, 295, 334, 322, 297, 318, 325, 257, 303, 315, 380, 153, 263, 242, 206, 344, 258]
        ]
      },
      "x": {
        "feed": ["casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal"]
      }
    },
    config = {
      "graphType": "Boxplot",
      "graphOrientation": "vertical",
      "groupingFactors": ["feed"],
      "xAxis": ["weight"],
      "xAxisTitle": "weight",
      "smpTitle": "feed",
      "smpTitleFontStyle": "bold",
      "axisTitleFontStyle": "bold",
      "axisAlgorithm": "rPretty",
      "smpTextRotate": 0,
      "showLegend": False,
      "colorBy": "feed",
      "title": "Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
      "showStatInference": True,
      "statInference": {
        "correction": {
          "method": "holm"
        },
        "annotate": "stars",
        "fdrThreshold": 0.05,
        "comparisons": [
          {
            "groups": ["casein", "horsebean"],
            "p": 7.21024958119126e-07
          },
          {
            "groups": ["casein", "linseed"],
            "p": 0.000260621659714803
          },
          {
            "groups": ["casein", "soybean"],
            "p": 0.00352126345222498
          },
          {
            "groups": ["casein", "sunflower"],
            "p": 0.821511771366324
          },
          {
            "groups": ["casein", "meatmeal"],
            "p": 0.0986622155842758
          }
        ]
      },
      "colorScheme": "Set2"
    },
    width = 600,
    height = 600
  )
)
using CanvasXpress

canvasxpress(Dict(
  "y" => Dict(
    "vars" => ["weight"],
    "smps" => ["Obs1", "Obs2", "Obs3", "Obs4", "Obs5", "Obs6", "Obs7", "Obs8", "Obs9", "Obs10", "Obs11", "Obs12", "Obs13", "Obs14", "Obs15", "Obs16", "Obs17", "Obs18", "Obs19", "Obs20", "Obs21", "Obs22", "Obs23", "Obs24", "Obs25", "Obs26", "Obs27", "Obs28", "Obs29", "Obs30", "Obs31", "Obs32", "Obs33", "Obs34", "Obs35", "Obs36", "Obs37", "Obs38", "Obs39", "Obs40", "Obs41", "Obs42", "Obs43", "Obs44", "Obs45", "Obs46", "Obs47", "Obs48", "Obs49", "Obs50", "Obs51", "Obs52", "Obs53", "Obs54", "Obs55", "Obs56", "Obs57", "Obs58", "Obs59", "Obs60", "Obs61", "Obs62", "Obs63", "Obs64", "Obs65", "Obs66", "Obs67", "Obs68", "Obs69", "Obs70", "Obs71"],
    "data" => [
      [368, 390, 379, 260, 404, 318, 352, 359, 216, 222, 283, 332, 179, 160, 136, 227, 217, 168, 108, 124, 143, 140, 309, 229, 181, 141, 260, 203, 148, 169, 213, 257, 244, 271, 243, 230, 248, 327, 329, 250, 193, 271, 316, 267, 199, 171, 158, 248, 423, 340, 392, 339, 341, 226, 320, 295, 334, 322, 297, 318, 325, 257, 303, 315, 380, 153, 263, 242, 206, 344, 258]
    ]
  ),
  "x" => Dict(
    "feed" => ["casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "casein", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "horsebean", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "linseed", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "soybean", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "sunflower", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal", "meatmeal"]
  )
);
  graphType = "Boxplot",
  graphOrientation = "vertical",
  groupingFactors = ["feed"],
  xAxis = ["weight"],
  xAxisTitle = "weight",
  smpTitle = "feed",
  smpTitleFontStyle = "bold",
  axisTitleFontStyle = "bold",
  axisAlgorithm = "rPretty",
  smpTextRotate = 0,
  showLegend = false,
  colorBy = "feed",
  title = "Chick weight by feed vs casein (Holm, FDR cutoff 0.05)",
  showStatInference = true,
  statInference = Dict(
    "correction" => Dict(
      "method" => "holm"
    ),
    "annotate" => "stars",
    "fdrThreshold" => 0.05,
    "comparisons" => [
      Dict(
        "groups" => ["casein", "horsebean"],
        "p" => 7.21024958119126e-07
      ),
      Dict(
        "groups" => ["casein", "linseed"],
        "p" => 0.000260621659714803
      ),
      Dict(
        "groups" => ["casein", "soybean"],
        "p" => 0.00352126345222498
      ),
      Dict(
        "groups" => ["casein", "sunflower"],
        "p" => 0.821511771366324
      ),
      Dict(
        "groups" => ["casein", "meatmeal"],
        "p" => 0.0986622155842758
      )
    ]
  ),
  colorScheme = "Set2"
)
⇧