Test deletion of edge from an interaction model

Description

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

Usage

1
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

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

Value

A list.

Author(s)

S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk

See Also

testadd

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## ## ## 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"))