Commit 62e46a77 authored by Yong Liu's avatar Yong Liu

Refs #5757, add methods in cor.test gui

parent e2ec8906
......@@ -5377,7 +5377,7 @@ compareDataExport <- function(comparedScript, len, ...){
if(existd("sdcObject") == FALSE){
gmessage("There is no dataset loaded for Spearman Test!", "No Dataset!",icon="warning")
} else{
lrDialog <- gwindow("Spearman Test", parent=window, width=600, height=400)
lrDialog <- gwindow("Test for Association", parent=window, width=600, height=400)
lTOr <- function(h, left, right, ...) {
if( length(h)>0 ) {
......@@ -5440,8 +5440,9 @@ compareDataExport <- function(comparedScript, len, ...){
x <- l$x
.insertHelpPage(t, x)
svalue(nb) <- 1
methodSel = gcombobox(c("pearson", "kendall", "spearman"), container=p1_windowGroup)
mainframe = gframe('', container=p1_windowGroup, horizontal=TRUE)
tmp = gframe('<span weight="bold" size="medium">Dependent Variable Selection</span>',
tmp = gframe('<span weight="bold" size="medium">Variable Selection</span>',
container=mainframe, horizontal=TRUE,markup=TRUE, expand=TRUE)
sdcObject = ActiveSdcObject()
data <- extractManipData(sdcObject)
......@@ -5467,9 +5468,9 @@ compareDataExport <- function(comparedScript, len, ...){
gmessage("You have to select only one variable!", title="Information", icon="info", parent=lrDialog)
} else {
tryCatch({
cor.S = cor.test(sdcObject@origData[,selTab[]], data[,selTab[]], method = "spearman")
cor.S = cor.test(sdcObject@origData[,selTab[]], data[,selTab[]], method = svalue(methodSel))
rho= cor.S$estimate
svalue(outputlabel) <- paste("The rho is: ", rho, sep="")}
svalue(outputlabel) <- paste(c("The cor is:", "The tau is:", "The rho is:")[grep(svalue(methodSel), c("pearson", "kendall", "spearman"))], rho, sep="")}
,
error=function(e){
svalue(outputlabel) <- paste("error:\n", e, "")
......@@ -5586,7 +5587,7 @@ compareDataExport <- function(comparedScript, len, ...){
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"PRAM output"$handler = viewpram1
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"Linear Regression"$handler= function(...) linearRegression()
mbar$"Disclosure Risks and Data Utility"$"Continuous Key Variables"$"Linear Regression"$handler= function(...) linearRegression()
mbar$"Disclosure Risks and Data Utility"$"Continuous Key Variables"$"Spearman Test"$handler= function(...) spearmanTest()
mbar$"Disclosure Risks and Data Utility"$"Continuous Key Variables"$"Test for Association"$handler= function(...) spearmanTest()
mbar$"Disclosure Risks and Data Utility"$"Linear Regression"$handler= function(...) linearRegression()
mbar$"Reports and Logs"$"Generate Report"$handler = exportReport
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment