MoTBFs (version 1.2)

plotConditional: Plots for Conditional Functions

Description

Get the graphical result of an MoTBF conditional function of two variables, i.e. a parent and his child.

Usage

plotConditional(
  conditionalFunction,
  data,
  nameChild = NULL,
  points = FALSE,
  color = NULL
)

Arguments

conditionalFunction

the output of the conditionalMethod. A list with the the interval of the parent and the final MoTBF density function.

data

The dataset used.

nameChild

Name of the child variable in the conditional function. By default is NULL.

points

Logical value. If TRUE the points of the data are overplotted.

color

By default NULL, a selection of colors of the color palette of R is used.

Value

A plot of the conditional function.

Details

If the number of parents is bigger than one, then the message "It is not possible plotting the conditional function." is shown.

See Also

conditionalMethod

Examples

Run this code
# NOT RUN {
## Data
X <- rnorm(1000)
Y <- rnorm(1000, mean=X)
data <- data.frame(X=X,Y=Y)
cov(data)

## Conditional Learning
parent <- "X"
child <- "Y"
intervals <- 5
potential <- "MTE"
P <- conditionalMethod(data, nameParents=parent, nameChild=child, 
numIntervals=intervals, POTENTIAL_TYPE=potential)
plotConditional(conditionalFunction=P, data=data)
plotConditional(conditionalFunction=P, data=data, points=TRUE)

# }

Run the code above in your browser using DataLab