margin.tables: Get the marginal distributions

View source: R/margin.R

margin.tablesR Documentation

Get the marginal distributions

Description

Get the marginal distributions

Usage

## S3 method for class 'tables'
margin(x, margin = NULL, order = TRUE, ...)

## S3 method for class 'tables'
conditional(
  x,
  variables,
  condition = NULL,
  condition.value = NULL,
  force = FALSE,
  undef = NaN,
  ...
)

## S3 method for class 'tables'
conditional2(x, variables, condition = NULL, force = FALSE, undef = NaN, ...)

## S3 method for class 'tables'
intervention(x, variables, condition, force = FALSE, ...)

Arguments

x

an object of class tables

margin

integer vector giving margin to be calculated (1 for rows, etc.)

order

logical indicating whether resulting indices should be in the same order as stated in margin

...

other arguments to function

condition

variables to condition upon

condition.value

(optionally) values to condition upon

undef

value to return for undefined cells

Details

Calculates marginal distributions for each entry in a probMat.

Value

An object of class tables consisting of the required marginal distribution.

Functions

  • conditional(tables): condition in distributions

  • conditional2(tables): condition and keep all variables

  • intervention(tables): intervene on variables in distributions


rje42/contingency documentation built on Sept. 9, 2024, 6:32 p.m.