returnDeviance {CoCoRaw}R Documentation

Return likelihoods, deviance, dimensions, etc.

Description

Returns the test statistics (deviance and F-test statistics) with p-values based on the likelihoods and the dimensions of the two argument models. For discrete models also an adjustment of the degrees of freedom is returned.

Usage

returnDeviance(model.1 = "current", model.2 = "base", data = NULL, 
               object = .object.of.models(model.1, model.2, 
                                          data = data, ...), ...)

Arguments

model.1 See isSubmodel.
model.2 See isSubmodel.
data See exportCoCo.
object See exportCoCo.
... Additional arguments to generate the CoCo object from the data argument. See propertyModel.

Value

A labeled vector of reals.

Note

A vector of zeros is returned if an error occurs. returnTest will return NULL if the models are not available or nested.

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, showTest, showDeviance, returnTest, backward and forward.

Examples

 

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

# ( Should be replaced by calculation of the tests of David Edwards book. )

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

# Show the model list:
showModel("all", object = CoCoObject);

returnDeviance("last", 1, object = CoCoObject);

homogeneModel <- makeModel(enterModel("[[ab]] / [[aby][abx]] / [[x^][abxy][y^]]",
                           object = CoCoObject));

returnDeviance("last", 1, object = CoCoObject);

endCoCo(object = CoCoObject);


[Package Contents]