twoway_lda: Two Way Linear Discriminant Analysis of Objective Variable

Description Usage Arguments Details Examples

View source: R/twoway_lda.R

Description

Two way linear discriminant analysis of the objective variable finds the linear combination of the original variables chosen that give the best possible classification. The best classification is defined as groups that are most distinctly separated from one another. twoway_lda() allows a visualization of how each of the definitive subgroups of our objective variables are separated through both histograms and scatterplots.

Usage

1
twoway_lda(main, avar, bvar, cvar, dvar, data, bylabel)

Arguments

main

Chosen variable with subgroups (objective variable recommended).

avar

First variable for the discriminant function.

bvar

Second variable for the discriminant function.

cvar

Third variable for the discriminant function.

dvar

Fourth variable for the discriminant function.

data

Dataset for the variables above.

bylabel

Label for scatterplot of discriminant function data points (objective variable subgroups.)

Details

twoway_lda() returns a scatterplot of the top two discriminant functions from linear combinations, with the utilization of the objective variable's subgroups as labels to see how well each subgroup is separated. Along with the scatterplot, the histogram for the top two discriminant functions can be seen.

Examples

1
2
3
4
example <- iris
twoway_lda(example$Species, example$Sepal.Length,
           example$Petal.Length, example$Sepal.Width,
           example$Petal.Width, example, example$Species)

bhsu4/weightprog documentation built on May 28, 2019, 7:10 p.m.