testdelete: Test deletion of edge from an interaction model

View source: R/test_single_edges.R

testdeleteR Documentation

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.

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

If model is decomposable and edge is in one clique only, then degrees of freedom are adjusted for sparsity

Value

A list.

Author(s)

Søren Højsgaard, sorenh@math.aau.dk

See Also

testadd

Examples


## Discrete models
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"))

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

testdelete(object, c("phys", "mental"))

## Continuous models
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"))

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

gRim documentation built on Oct. 16, 2024, 1:07 a.m.