Search in sources :

Example 6 with IndTestType

use of edu.cmu.tetrad.search.IndTestType in project tetrad by cmu-phil.

the class MmhcRunner method getIndependenceTest.

private IndependenceTest getIndependenceTest() {
    Object dataModel = getDataModel();
    if (dataModel == null) {
        dataModel = getSourceGraph();
    }
    IndTestType testType = (IndTestType) (getParams()).get("indTestType", IndTestType.FISHER_Z);
    return new IndTestChooser().getTest(dataModel, getParams(), testType);
}
Also used : IndTestType(edu.cmu.tetrad.search.IndTestType)

Example 7 with IndTestType

use of edu.cmu.tetrad.search.IndTestType in project tetrad by cmu-phil.

the class CcdRunner method getIndependenceTest.

public IndependenceTest getIndependenceTest() {
    Object dataModel = getDataModel();
    if (dataModel == null) {
        dataModel = getSourceGraph();
    }
    IndTestType testType = (IndTestType) (getParams()).get("indTestType", IndTestType.FISHER_Z);
    return new IndTestChooser().getTest(dataModel, getParams(), testType);
}
Also used : IndTestType(edu.cmu.tetrad.search.IndTestType)

Example 8 with IndTestType

use of edu.cmu.tetrad.search.IndTestType in project tetrad by cmu-phil.

the class CeFanSearchRunner method getIndependenceTest.

public IndependenceTest getIndependenceTest() {
    Object dataModel = getDataModel();
    if (dataModel == null) {
        dataModel = getSourceGraph();
    }
    Parameters params = getParams();
    IndTestType testType = (IndTestType) params.get("indTestType", IndTestType.FISHER_Z);
    return new IndTestChooser().getTest(dataModel, params, testType);
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) IndTestType(edu.cmu.tetrad.search.IndTestType)

Example 9 with IndTestType

use of edu.cmu.tetrad.search.IndTestType in project tetrad by cmu-phil.

the class IndTestMenuItems method addContinuousTestMenuItems.

static void addContinuousTestMenuItems(JMenu test, final IndTestTypeSetter setter) {
    IndTestType testType = setter.getTestType();
    if (testType != IndTestType.FISHER_Z && testType != IndTestType.FISHER_ZD && testType != IndTestType.SEM_BIC && testType != IndTestType.FISHER_Z_BOOTSTRAP && // testType != IndTestType.CORRELATION_T &&
    testType != IndTestType.CONDITIONAL_CORRELATION && testType != IndTestType.LINEAR_REGRESSION && testType != IndTestType.MIXED_MLR) {
        setter.setTestType(IndTestType.FISHER_Z);
    }
    ButtonGroup group = new ButtonGroup();
    JCheckBoxMenuItem fishersZ = new JCheckBoxMenuItem("Fisher's Z");
    group.add(fishersZ);
    test.add(fishersZ);
    // JCheckBoxMenuItem fishersZD =
    // new JCheckBoxMenuItem("Fisher's Z - Generalized Inverse");
    // group.add(fishersZD);
    // test.add(fishersZD);
    // 
    // JCheckBoxMenuItem fishersZBootstrap =
    // new JCheckBoxMenuItem("Fisher's Z - Bootstrap");
    // group.add(fishersZBootstrap);
    // test.add(fishersZBootstrap);
    JCheckBoxMenuItem tTest = new JCheckBoxMenuItem("Correlation T");
    group.add(tTest);
    test.add(tTest);
    JCheckBoxMenuItem logr = new JCheckBoxMenuItem("Multinomial Logistic Regression");
    group.add(logr);
    test.add(logr);
    logr.setSelected(true);
    JCheckBoxMenuItem conditionalCorrelation = new JCheckBoxMenuItem("Conditional Correlation");
    group.add(conditionalCorrelation);
    test.add(conditionalCorrelation);
    JCheckBoxMenuItem linRegrTest = new JCheckBoxMenuItem("Linear Regression Test");
    group.add(linRegrTest);
    test.add(linRegrTest);
    JCheckBoxMenuItem bicBump = new JCheckBoxMenuItem("BIC Score Bump");
    group.add(bicBump);
    test.add(bicBump);
    logr.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.MIXED_MLR);
        }
    });
    testType = setter.getTestType();
    if (testType == IndTestType.FISHER_Z) {
        fishersZ.setSelected(true);
    // } else if (testType == IndTestType.FISHER_ZD) {
    // fishersZD.setSelected(true);
    // } else if (testType == IndTestType.FISHER_Z_BOOTSTRAP) {
    // fishersZBootstrap.setSelected(true);
    // } else if (testType == IndTestType.CORRELATION_T) {
    // tTest.setSelected(true);
    } else if (testType == IndTestType.CONDITIONAL_CORRELATION) {
        conditionalCorrelation.setSelected(true);
    } else if (testType == IndTestType.LINEAR_REGRESSION) {
        linRegrTest.setSelected(true);
    } else if (testType == IndTestType.MIXED_MLR) {
        logr.setSelected(true);
    } else if (testType == IndTestType.SEM_BIC) {
        bicBump.setSelected(true);
    }
    fishersZ.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.FISHER_Z);
            JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "Using Fisher's Z.");
        }
    });
    // fishersZD.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // setTestType(IndTestType.FISHER_ZD);
    // JOptionPane.showMessageDialog(JOptionUtils.centeringComp(),
    // "Using Fisher's Z - Generalized Inverse.");
    // }
    // });
    // fishersZBootstrap.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // setTestType(IndTestType.FISHER_Z_BOOTSTRAP);
    // JOptionPane.showMessageDialog(JOptionUtils.centeringComp(),
    // "Using Fisher's Z - Bootstrap.");
    // }
    // });
    // tTest.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // setter.setTestType(IndTestType.CORRELATION_T);
    // JOptionPane.showMessageDialog(JOptionUtils.centeringComp(),
    // "Using Correlation T.");
    // }
    // });
    conditionalCorrelation.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.CONDITIONAL_CORRELATION);
            JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "Using Conditional Correlation.");
        }
    });
    linRegrTest.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.LINEAR_REGRESSION);
            JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "Using linear regression test.");
        }
    });
    logr.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.MIXED_MLR);
            JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "Using multinomial logistic regression test.");
        }
    });
    bicBump.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.SEM_BIC);
            JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "Using the BIC bump test.");
        }
    });
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) IndTestType(edu.cmu.tetrad.search.IndTestType)

Example 10 with IndTestType

use of edu.cmu.tetrad.search.IndTestType in project tetrad by cmu-phil.

the class IndTestMenuItems method addMixedTestMenuItems.

private static void addMixedTestMenuItems(JMenu test, final IndTestTypeSetter setter) {
    IndTestType testType = setter.getTestType();
    if (testType != IndTestType.MIXED_MLR) {
        setter.setTestType(IndTestType.MIXED_MLR);
    }
    ButtonGroup group = new ButtonGroup();
    JCheckBoxMenuItem logr = new JCheckBoxMenuItem("Multinomial Logistic Regression");
    group.add(logr);
    test.add(logr);
    logr.setSelected(true);
    logr.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            setter.setTestType(IndTestType.MIXED_MLR);
        }
    });
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) IndTestType(edu.cmu.tetrad.search.IndTestType)

Aggregations

IndTestType (edu.cmu.tetrad.search.IndTestType)19 ActionEvent (java.awt.event.ActionEvent)10 ActionListener (java.awt.event.ActionListener)10 Parameters (edu.cmu.tetrad.util.Parameters)5