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

RAnalytics
スポンサーリンク

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 audibleの登録の紹介

プライム会員限定で2024年7月22日まで3か月無料体験キャンペーン開催中です。無料体験後は月額1,500円で聞き放題です。なお、聞き放題対象外の本はAudible会員であれば非会員価格の30%引きで購入することが可能です。

Amazon audibleはプロのナレーターが朗読した本をアプリで聞くことができるサービスで、オフライン再生も可能です。通勤や作業のお供にAmazon audibleのご登録はいかがでしょうか。

・AmazonのAudible

https://amzn.to/3L4FI5o

Copied title and URL