{"size":{"Width":576,"Height":216},"appearance":{"background":null,"padding":14,"font":{"family":"Courier New","size":10.0,"bold":false,"italic":false,"underline":false,"strikeout":false,"color":"rgb(0,72,168)"},"border":{"on":true,"size":0.0,"style":"solid","color":"#666"},"text":{"wrap":false,"hAlign":"left","vAlign":"top"}},"outputType":"WIDGET","widgetState":null,"outputs":{"console":"<pre class='debug-source'>>library(flipFormat)\n</pre>\n<pre class='debug-source'>>library(flipTransformations)\n</pre>\n<pre class='debug-source'>>dat <- ProcessQVariables(data.frame(formVariable1, formVariable2))\n</pre>\n<pre class='debug-source'>>for (i in 1:2)\n if (is.factor(dat[[i]]))\n dat[[i]] <- unclass(dat[[i]])\n</pre>\n<pre class='debug-source'>>dat$subset <- QFilter\n</pre>\n<pre class='debug-source'>>if (!is.null(QCalibratedWeight))\n dat <- AdjustDataToReflectWeights(dat, QCalibratedWeight)\n</pre>\n<pre class='debug-source'>>method <- switch(formType, "Pearson product-moment" = "pearson", "Spearman rank-order" = "spearman", "Kendall's Tau-b" = "kendall")\n</pre>\n<pre class='debug-source'>>cor.name <- switch(formType,\n "Pearson product-moment" = "Pearson's product-moment correlation",\n "Spearman rank-order" = "Spearman's rank correlation rho",\n "Kendall's Tau-b" = "Kendall's rank correlation tau")\n</pre>\n<pre class='debug-source'>>alternative.hypothesis <- switch(formHypothesis, "Two-sided" = "two.sided", "Correlation < 0" = "less", "Correlation > 0" = "greater")\n</pre>\n<pre class='debug-source'>>test.output <- cor.test( ~ formVariable1 + formVariable2, data = dat, method = method, alternative = alternative.hypothesis, subset = subset, na.action = "na.omit")\n</pre>\n<pre class='debug-source'>>correlation.test <- if (formOutput == "Summary") {\n decimal.places <- if (formDecimals) 8 else NULL\n SignificanceTest(test.output, cor.name, list(formVariable1, formVariable2), filter = QFilter,\n weight = QCalibratedWeight,\n p.value.method = alternative.hypothesis,\n show.labels = !formNames, decimal.places = decimal.places, resample = TRUE)\n} else\n test.output\n</pre>\r\n<div class=\"debug-summarystatistics\"><table>\r\n<tr><th>Started:</th><td class=utc-time>2018-08-28T06:59:17.462Z</td></tr>\r\n<tr><th>Finished:</th><td class=utc-time>2018-08-28T06:59:17.462Z</td></tr>\r\n<tr><th>Total time:</th><td>0.54s</td></tr>\r\n<tr><th>Time executing code:</th><td title=\"0.07s\">0.48s</td></tr>\r\n<tr><th>Other overhead on R server:</th><td>0.30s</td></tr>\r\n<tr><th>Time spent transferring data:</th><td>0.07s</td></tr>\r\n<tr><th>Data sent to R server:</th><td>3.5KB</td></tr>\r\n<tr><th>Data received from R server:</th><td>8.2KB</td></tr>\r\n</table></div>","htmlwidgets":"<div id=\"htmlwidget_container\">\n <div id=\"htmlwidget-91c1e1d572dfee1b2da1\" class=\"formattable_widget html-widget\" style=\"width:100%;height:500px;\" width=\"100%\" height=\"500\"></div>\n</div>\n<script type=\"application/json\" data-for=\"htmlwidget-91c1e1d572dfee1b2da1\">{\"x\":{\"html\":\"<table class = \\\"table table-condensed\\\"style = \\\"margin:0; border-bottom: 2px solid; border-top: 2px solid; font-size:90%;\\\">\\n<h3 class=\\\".h3\\\" style=\\\"color:#3E7DCC; text-align:left; margin-top:0px; margin-bottom:0\\\">Pearson's product-moment correlation<\\/h3>\\n<h4 class=\\\".h4\\\" style=\\\"color:#3E7DCC; text-align:left; margin-top:5px; margin-bottom:0\\\">Significant: p-value = 0.0000004<\\/h4>\\n<h5 class=\\\".h5\\\" style=\\\"color:#888888; text-align:left; margin-top:5px; margin-bottom:0\\\">Sales (M USD)<\\/h5>\\n<h5 class=\\\".h5\\\" style=\\\"color:#888888; text-align:left; margin-top:5px; margin-bottom:0\\\">by Advertising (M USD) <\\/h5>\\n<caption style=\\\"caption-side:bottom;font-style:italic; font-size:90%;\\\">n = 9 cases used in estimation; null hypothesis: true correlation is equal to 0;<\\/caption>\\n <thead>\\n <tr>\\n <th style=\\\"text-align:right;\\\"> cor <\\/th>\\n <th style=\\\"text-align:right;\\\"> t <\\/th>\\n <th style=\\\"text-align:right;\\\"> Degrees of freedom <\\/th>\\n <th style=\\\"text-align:right;\\\"> p-value <\\/th>\\n <th style=\\\"text-align:right;\\\"> Lower 95%<br>conf. int. <\\/th>\\n <th style=\\\"text-align:right;\\\"> Upper 95%<br>conf. int. <\\/th>\\n <\\/tr>\\n <\\/thead>\\n<tbody>\\n <tr>\\n <td style=\\\"text-align:right;\\\"> 0.99 <\\/td>\\n <td style=\\\"text-align:right;\\\"> 17.89 <\\/td>\\n <td style=\\\"text-align:right;\\\"> 7 <\\/td>\\n <td style=\\\"text-align:right;\\\"> 0.0000004 <\\/td>\\n <td style=\\\"text-align:right;\\\"> 0.95 <\\/td>\\n <td style=\\\"text-align:right;\\\"> 1.00 <\\/td>\\n <\\/tr>\\n<\\/tbody>\\n<\\/table>\"},\"evals\":[],\"jsHooks\":[]}</script>\n<script type=\"application/htmlwidget-sizing\" data-for=\"htmlwidget-91c1e1d572dfee1b2da1\">{\"viewer\":{\"width\":\"100%\",\"height\":350,\"padding\":15,\"fill\":false},\"browser\":{\"width\":\"100%\",\"height\":500,\"padding\":0,\"fill\":false}}</script>","htmlwidget-head":"{\"stylesheets\":[\"https://rserverhtmlwidgetasset.azureedge.net/bootstrap.min-63e52244789ab8f6e3a78818886e7085.css\"],\"javascript\":[\"https://rserverhtmlwidgetasset.azureedge.net/jquery.min-91a24ea414e8c447d647cecab86866c2.js\",\"https://rserverhtmlwidgetasset.azureedge.net/bootstrap.min-326d184c3c13feede563e4adcb5ff2a0.js\",\"https://rserverhtmlwidgetasset.azureedge.net/html5shiv.min-e70767555a95c48c08833356d362ccef.js\",\"https://rserverhtmlwidgetasset.azureedge.net/respond.min-4255ee1a060b15cb2432d0a497a6d510.js\",\"https://rserverhtmlwidgetasset.azureedge.net/htmlwidgets-917a66c6e5036eb1bfd1fb672a82635a.js\",\"https://rserverhtmlwidgetasset.azureedge.net/formattable_widget-d2927ec9dec4a568bd3f4a62041c0ddb.js\"],\"attachments\":[],\"widget-cannot-re-render\":true}","message":"","warning":""},"secondsTaken":0.54465740000000007,"updated":"2018-08-28T06:59:17.4627796Z","lastUpdatedMessage":null,"executedCode":"library(flipFormat)\nlibrary(flipTransformations)\ndat <- ProcessQVariables(data.frame(formVariable1, formVariable2))\nfor (i in 1:2)\n if (is.factor(dat[[i]]))\n dat[[i]] <- unclass(dat[[i]])\ndat$subset <- QFilter\nif (!is.null(QCalibratedWeight))\n dat <- AdjustDataToReflectWeights(dat, QCalibratedWeight)\nmethod <- switch(formType, \"Pearson product-moment\" = \"pearson\", \"Spearman rank-order\" = \"spearman\", \"Kendall's Tau-b\" = \"kendall\")\ncor.name <- switch(formType,\n \"Pearson product-moment\" = \"Pearson's product-moment correlation\",\n \"Spearman rank-order\" = \"Spearman's rank correlation rho\",\n \"Kendall's Tau-b\" = \"Kendall's rank correlation tau\")\nalternative.hypothesis <- switch(formHypothesis, \"Two-sided\" = \"two.sided\", \"Correlation < 0\" = \"less\", \"Correlation > 0\" = \"greater\")\ntest.output <- cor.test( ~ formVariable1 + formVariable2, data = dat, method = method, alternative = alternative.hypothesis, subset = subset, na.action = \"na.omit\")\ncorrelation.test <- if (formOutput == \"Summary\") {\n decimal.places <- if (formDecimals) 8 else NULL\n SignificanceTest(test.output, cor.name, list(formVariable1, formVariable2), filter = QFilter,\n weight = QCalibratedWeight,\n p.value.method = alternative.hypothesis,\n show.labels = !formNames, decimal.places = decimal.places, resample = TRUE)\n} else\n test.output","lastSavedCode":"library(flipFormat)\nlibrary(flipTransformations)\ndat <- ProcessQVariables(data.frame(formVariable1, formVariable2))\nfor (i in 1:2)\n if (is.factor(dat[[i]]))\n dat[[i]] <- unclass(dat[[i]])\ndat$subset <- QFilter\nif (!is.null(QCalibratedWeight))\n dat <- AdjustDataToReflectWeights(dat, QCalibratedWeight)\nmethod <- switch(formType, \"Pearson product-moment\" = \"pearson\", \"Spearman rank-order\" = \"spearman\", \"Kendall's Tau-b\" = \"kendall\")\ncor.name <- switch(formType,\n \"Pearson product-moment\" = \"Pearson's product-moment correlation\",\n \"Spearman rank-order\" = \"Spearman's rank correlation rho\",\n \"Kendall's Tau-b\" = \"Kendall's rank correlation tau\")\nalternative.hypothesis <- switch(formHypothesis, \"Two-sided\" = \"two.sided\", \"Correlation < 0\" = \"less\", \"Correlation > 0\" = \"greater\")\ntest.output <- cor.test( ~ formVariable1 + formVariable2, data = dat, method = method, alternative = alternative.hypothesis, subset = subset, na.action = \"na.omit\")\ncorrelation.test <- if (formOutput == \"Summary\") {\n decimal.places <- if (formDecimals) 8 else NULL\n SignificanceTest(test.output, cor.name, list(formVariable1, formVariable2), filter = QFilter,\n weight = QCalibratedWeight,\n p.value.method = alternative.hypothesis,\n show.labels = !formNames, decimal.places = decimal.places, resample = TRUE)\n} else\n test.output","highlightedCodeSpans":[{"start":85,"length":13,"index":4},{"start":100,"length":13,"index":4},{"start":212,"length":7,"index":6},{"start":233,"length":17,"index":6},{"start":296,"length":17,"index":6},{"start":332,"length":8,"index":4},{"start":466,"length":8,"index":4},{"start":746,"length":14,"index":4},{"start":877,"length":13,"index":4},{"start":893,"length":13,"index":4},{"start":1039,"length":10,"index":4},{"start":1092,"length":12,"index":4},{"start":1167,"length":13,"index":4},{"start":1182,"length":13,"index":4},{"start":1207,"length":7,"index":6},{"start":1246,"length":17,"index":6},{"start":1363,"length":9,"index":4}],"tableTransformations":"<TabularTransformer>\r\n <TabularTransform type=\"Truncation\" truncationHeaderType=\"Column\" />\r\n <TabularTransform />\r\n</TabularTransformer>","tabularFilteringOptions":null,"hasGuiControls":true,"guiControls":{"Code":"form.setHeading(\"Correlation Test\")\nform.dropBox({label: \"Variable 1\", \n types:[\"Variable: Numeric, Date, Money, Categorical, OrderedCategorical\"], \n name: \"formVariable1\"})\nform.dropBox({label: \"Variable 2\",\n types:[\"Variable: Numeric, Date, Money, Categorical, OrderedCategorical\"], \n name: \"formVariable2\"})\nform.comboBox({label: \"Type of correlation\", \n alternatives: [\"Pearson product-moment\", \"Spearman rank-order\", \"Kendall's Tau-b\"], \n name: \"formType\", default_value: \"Pearson product-moment\"})\nform.comboBox({label: \"Alternative hypothesis\", \n alternatives: [\"Two-sided\", \"Correlation < 0\", \"Correlation > 0\"], \n name: \"formHypothesis\", default_value: \"Two-sided\"})\nvar formOutput = form.comboBox({label: \"Output\", \n alternatives: [\"Summary\", \"R\"], \n name: \"formOutput\", default_value: \"Summary\"});\nif (formOutput.getValue() == \"Summary\")\n{\n form.checkBox({label: \"Variable names\", name: \"formNames\", default_value: false});\n form.checkBox({label: \"More decimal places\", name: \"formDecimals\", default_value: false});\n}","JSError":null,"JSErrorDetails":null,"ControlDefinitionErrors":null,"InputValidationErrors":null,"Controls":[{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":null,"Page":null,"Group":null,"Type":"Heading","Label":null,"LabelEmphasised":false,"Value":null,"Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":false,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":null,"CheckAlign":null,"Text":"Correlation Test","Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formVariable1","Page":null,"Group":null,"Type":"DropBox","Label":"Variable 1","LabelEmphasised":false,"Value":"5303760d-7dad-4402-9007-aef0aca880c3","Allowed":null,"Multi":false,"Prompt":"Select an input which is of type Variable (Numeric, Date, Money, Categorical or Orderedcategorical).","ErrorMessage":"Variable 1: Variable 1 accepts only one input which is of type Variable (Numeric, Date, Money, Categorical or Orderedcategorical).","Invalid":null,"Required":true,"AllowedTypes":["Variable: Numeric, Date, Money, Categorical, OrderedCategorical"],"OwnerRItemGuid":"464af20e-04e9-4162-ab66-4abb5ae7f2bf","MinInputs":1,"MaxInputs":1,"Height":1,"Duplicates":false,"Values":null,"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formVariable2","Page":null,"Group":null,"Type":"DropBox","Label":"Variable 2","LabelEmphasised":false,"Value":"0b236ae3-f9ea-4f79-8cdc-4588d286317b","Allowed":null,"Multi":false,"Prompt":"Select an input which is of type Variable (Numeric, Date, Money, Categorical or Orderedcategorical).","ErrorMessage":"Variable 2: Variable 2 accepts only one input which is of type Variable (Numeric, Date, Money, Categorical or Orderedcategorical).","Invalid":null,"Required":true,"AllowedTypes":["Variable: Numeric, Date, Money, Categorical, OrderedCategorical"],"OwnerRItemGuid":"464af20e-04e9-4162-ab66-4abb5ae7f2bf","MinInputs":1,"MaxInputs":1,"Height":1,"Duplicates":false,"Values":null,"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formType","Page":null,"Group":null,"Type":"ComboBox","Label":"Type of correlation","LabelEmphasised":false,"Value":"Pearson product-moment","Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":true,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":["Pearson product-moment","Spearman rank-order","Kendall's Tau-b"],"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formHypothesis","Page":null,"Group":null,"Type":"ComboBox","Label":"Alternative hypothesis","LabelEmphasised":false,"Value":"Two-sided","Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":true,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":["Two-sided","Correlation < 0","Correlation > 0"],"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formOutput","Page":null,"Group":null,"Type":"ComboBox","Label":"Output","LabelEmphasised":false,"Value":"Summary","Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":true,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":["Summary","R"],"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formNames","Page":null,"Group":null,"Type":"CheckBox","Label":"Variable names","LabelEmphasised":false,"Value":false,"Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":false,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":null,"CheckAlign":"left","Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":"formDecimals","Page":null,"Group":null,"Type":"CheckBox","Label":"More decimal places","LabelEmphasised":false,"Value":false,"Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":false,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":null,"CheckAlign":"left","Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":null},{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":null,"Page":null,"Group":null,"Type":null,"Label":null,"LabelEmphasised":false,"Value":null,"Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":false,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":null,"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":true}]},"calculating":"Idle","showDebug":false,"layout":"OutputOnly","vSplit":0.25,"hSplit":0.45,"updateWarnings":true,"updateMode":"Manual","warnSlow":false,"Options":{"debugconsole":false,"codeposition":"OutputOnly","splitH":0.45,"splitV":0.25,"update warnings":true,"updating":"Manual","warn slow":false}}