50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


balance (version 0.2.4)

pba: Principal Balance Analysis

Description

Principal Balance Analysis

Usage

pba(x, how = "sbp.fromPBA", ...)

# S4 method for pba show(object)

# S4 method for pba predict(object, y)

# S4 method for pba,missing plot(x, y, group, pb1 = 1, pb2 = 2, size.text = 18)

# S4 method for pba,matrix plot(x, y, group, pb1 = 1, pb2 = 2, size.text = 18)

# S4 method for pba,data.frame plot(x, y, group, pb1 = 1, pb2 = 2, size.text = 18)

Arguments

how

A character string. The method used to construct the SBP. The default computes principal balances via sbp.fromPBA.

...

Arguments passed to how method.

object, x

A pba object.

y

A matrix on which to deploy the pba model.

group

A character vector. Group labels used to color points.

pb1, pb2

An integer. Sets principal balances to plot.

size.text

An integer. Sets legend text size.

Value

Returns a pba object.

Slots

data

A matrix. The original data.

sbp

A matrix. The SBP matrix.

pba

A matrix. The balances.

totvar

A numeric vector. The total variance per balance.

subvar

A numeric vector. The fractional variance per balance.

Methods (by generic)

show: Method to show pba object.

predict: Method to deploy pba object.

plot: Method to plot pba object.

Details

The pba function performs a principal balance analysis using the hierarchical clustering of components method described by Pawlowsky-Glahn et al. in "Principal balances" from the CoDaWork 2011 proceedings.

This resultant object contains the original data, the serial binary partition, the principal balances, and the fractional variances per balance. Use predict to deploy the pba model on new data.

Examples

Run this code
# NOT RUN {
library(balance)
data(iris)
train <- iris[1:50,1:4]
test <- iris[51:150,1:4]
model <- pba(train)
predict(model, test)
plot(model, test)

# }

Run the code above in your browser using DataLab