本文へスキップ
からだにいいもの

Rのトピックスを中心に『まだ、まだ、知らない、役に立つ情報?』を発信します。

Analysis in R: Want to separate groups by individual characteristics? Discriminant analysis package “PPtreeViz”

Discriminant analysis (pattern analysis) is one of the methods used to explore the characteristics of collected data by determining grouping rules from the “characteristics (variables)” possessed by each individual and estimating the group to which an unknown individual belongs.

For example, discriminant analysis is used to “estimate which type of flower is already known based on its characteristics,” “estimate any credit rating based on a company’s financial performance,” “estimate the author of an unnamed novel based on word appearance trends,” and “estimate behavioral patterns that lead to purchases on the Web.

Although it is a useful discriminant analysis, I have not seen many R packages that output figures that can be used in presentation materials without further processing. Therefore, it’s present the “PPtreeViz” package, which can solve such problems.

Package version is 2.4.0. Checked with R version 4.2.2.

Install Package

Run the following command.

install.packages("PPtreeViz")
スポンサーリンク

Example

See the comments in the command and the package’s help file for details.
For the classification rules, the “PPmethod” option is used, and the algorithms “LDA”, “PDA”, “Lr”, “GINI”, and “ENTROPY” are available. The reference data are the “iris” data supplied with R.

#Loading the library
library("PPtreeViz")

#Loading the data
data(iris)

#Example 1
Huberplot(iris[,1:2], iris[,5], PPmethod = "LDA")

#Example 2
LDAindex(iris[,5],as.matrix(iris[,1:4]))

#Example 3
Tree.result <- PPTreeclass(Species~., data = iris, PPmethod = "LDA")
Tree.result
plot(Tree.result)

#Example 4
Tree.result <- PPTreeclass(Species~., data = iris, PPmethod = "LDA")
Tree.result
PPclassNodeViz(Tree.result,1,1)

Output Example

Example1

参考1

Example 3

参考2

Example 4

参考3

I hope this makes your analysis a little easier !!

スポンサーリンク
価格および配送状況は変更される場合があります。購入時は商品ページをご確認ください。
当サイトに表示されている商品情報はAmazonから提供されたものであり、更新または削除される場合があります。
karada-goodはAmazonアソシエイトとして、適格販売により収入を得ています。