Learn R Programming

gRim (version 0.1.2)

testdelete: Test deletion of edge from an interaction model

Description

Tests if an edge can be deleted from an interaction model.

Usage

testdelete(object, edge, k=2, details=1,...)

Arguments

object
A model; an object of class iModel.
edge
An edge in the model; either as a right-hand sided formula or as a vector
k
Penalty parameter used when calculating change in AIC
details
The amount of details to be printed; 0 surpresses all information
...
Further arguments to be passed on to the underlying functions for testing; that is to CItable and CImvn

Value

  • A list.

Details

If the model is decomposable and the edge is contained in one clique only then the test is made in the marginal model given by that clique. In that case, if the model is a log-linear model then degrees of freedom are adjusted for sparsity

See Also

testadd

Examples

Run this code
## ## ## testdelete
## ## ## 

## ## Discrete model
## ## 
data(reinis)
## A decomposable model
##
mf <- ~smoke:phys:mental+smoke:systol:mental
object <- dmod(mf, data=reinis)

testdelete(object,c("phys","mental"))
testdelete(object,c("smoke","mental"))
#testdelete(object,c("systol","phys"))


## A non-decomposable model
##
mf <- ~smoke:phys+phys:mental+smoke:systol+systol:mental
object <- dmod(mf, data=reinis)

testdelete(object,c("phys","mental"))
#testdelete(object,c("systol","phys"))
#testdelete(object,c("smoke","mental"))


## ## Continuous model
## ## 
data(math)
## A decomposable model
##
mf <- ~me:ve:al+me:al:an
object <- cmod(mf, data=math)

testdelete(object,c("ve","al"))
testdelete(object,c("me","al"))

Run the code above in your browser using DataLab