showTest {CoCoRaw}R Documentation

Show the Pearson $chi^2$, the power divergence, etc.

Description

Print on standard output for discrete data the Pearson $chi^2$, the power divergence, and the deviance, and for tests of two ordinal variable conditional independent given discrete also the Goodman and Kruskal's Gamma coefficient, and for mixed data the deviance and the F-test statistic, all with p-values. For discrete data also exact p-values can be printed.

Usage

showTest(model.1 = "current", model.2 = "base", exact.test = NULL, 
         break.down = "", set = ";", only.if.one.edge = FALSE, data = NULL, 
         object = .object.of.models(model.1, model.2, data = data, ...), ...)

Arguments

model.1 See isSubmodel.
model.2 See isSubmodel.
exact.test Logical, if exact.test is TRUE then exact p-values are computed by Monte Carlo simulation.
break.down Text-string: "edges": Break down the test in a sequence of tests, each test a test between two models differing by one edge. The order of the edges are controlled by the argument set. "interactions": Break down the test in a sequence of tests, each test a test between two models differing by one interaction term. The order of the terms are controlled by the argument set. "components": Find sets that are complete separators for both models, and show tests collapsed to each component. "show.common.decompositions": Do not perform a test, show separators which are complete in both models. "decompose.models": Do not perform a test, but decompose both models with respect to the argument set.
set Text string with set of variables, see the argument break.down.
only.if.one.edge Logical, if only.if.one.edge is set to TRUE then the test is only performed if the models differs with one edge and only one edge.
data See exportCoCo.
object See exportCoCo.
... Additional arguments to generate the CoCo object from the data argument. See propertyModel.

Value

TRUE

Note

Author(s)

Jens Henrik Badsberg

References

Badsberg, J.H.: A guide to CoCo, JSS, 2001 ( http://www.jstatsoft.org/v06/i04/ ) and Badsberg, J.H.: Xlisp+CoCo, Aalborg University, 1996.

See Also

enterModel, makeModel, showModel, makeCurrent, returnModel, returnModelNumber, partialAssociations, optionsCoCo, showDeviance, returnTest, returnDeviance, backward and forward.

Examples

 
# data(HairEyeColor);
# library(CoCo);
# showTest(":H:S,:E:S", "*", data = HairEyeColor, exact.test = "on");
# endCoCo();

library(MASS);
data(cabbages);
library(CoCoCg);
data(Rats);
CoCoObject <- makeCoCoCg();
enterDataFrame(cabbages, object = CoCoObject);
fullModel <- makeModel(enterModel("*", object = CoCoObject));

# Generate some models, here by "backward":
backward(recursive = TRUE, headlong = TRUE, coherent = TRUE, 
         follow = TRUE, object = CoCoObject);

makeCurrent("last", object = CoCoObject);
showTest("last", object = CoCoObject);

returnTable("moment", ":Cult:Date:HeadWt:VitC", object = CoCoObject);
returnTable("moment", ":Cult:Date:HeadWt:VitC", matrix = TRUE, 
            object = CoCoObject);

returnTable("mk", ":Cult:Date:HeadWt:VitC", matrix = TRUE, 
            object = CoCoObject);

showTable("mk", ":Cult:Date:HeadWt:VitC", matrix = TRUE, 
           object = CoCoObject);

showTable("mk", ":Cult:Date:HeadWt:VitC", 
           object = CoCoObject);

showTable("ms", ":Cult:Date:HeadWt:VitC", 
           object = CoCoObject);

endCoCo(CoCoObject);

[Package Contents]