Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

test-edges

Test edges in graphical models with p-value/AIC value


Description

Test edges in graphical models with p-value/AIC value. The models must be iModels.

Usage

testEdges(
  object,
  edgeMAT = NULL,
  ingraph = TRUE,
  criterion = "aic",
  k = 2,
  alpha = NULL,
  headlong = FALSE,
  details = 1,
  ...
)

testInEdges(
  object,
  edgeMAT = NULL,
  criterion = "aic",
  k = 2,
  alpha = NULL,
  headlong = FALSE,
  details = 1,
  ...
)

testOutEdges(
  object,
  edgeMAT = NULL,
  criterion = "aic",
  k = 2,
  alpha = NULL,
  headlong = FALSE,
  details = 1,
  ...
)

Arguments

object

An iModel model object

edgeMAT

A p * 2 matrix with edges

ingraph

If TRUE, edges in graph are tested; if FALSE, edges not in graph are tested.

criterion

Either "aic" or "test" (for significance test)

k

Penalty term when criterion="aic". Only k=2 gives genuine AIC.

alpha

Critical value for deeming an edge to be significant/ insignificant. When criterion="aic", alpha defaults to 0; when criterion="test", alpha defaults to 0.05.

headlong

If TRUE then testing will stop once a model improvement has been found.

details

Controls the level of printing on the screen.

...

Further arguments to be passed on to testdelete (for testInEdges) and testadd (for testOutEdges).

Details

  • testIn: Function which tests whether each edge in "edgeList" can be delete from model "object"

  • testOut: Is similar but in the other direction.

Value

A dataframe with test statistics (p-value or change in AIC), edges and logical telling if the edge can be deleted.

Author(s)

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

See Also

Examples

data(math)
cm1 <- cmod(~me:ve + ve:al + al:an, data=math)
testEdges(cm1, ingraph=TRUE)
testEdges(cm1, ingraph=FALSE)
## Same as
# testInEdges(cm1)
# testOutEdges(cm)

gRim

Graphical Interaction Models

v0.2.5
GPL (>= 2)
Authors
Søren Højsgaard <sorenh@math.aau.dk>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.