plot.CDF: Plot Comparison Data Forest (CDF) Classification Probability...

View source: R/plot.R

plot.CDFR Documentation

Plot Comparison Data Forest (CDF) Classification Probability Distribution

Description

This function generates a bar plot of the classification probabilities predicted by the Comparison Data Forest for determining the number of factors. The plot displays the probability distribution across different numbers of factors, with each bar representing the probability for a specific number of factors.

Usage

## S3 method for class 'CDF'
plot(x, ...)

Arguments

x

An object of class CDF, representing the results to be plotted.

...

Additional arguments to be passed to the plotting function.

Value

None. This function is used for side effects (plotting).

See Also

CDF

Examples

library(EFAfactors)
set.seed(123)

## Take the data.bfi dataset as an example.
data(data.bfi)

response <- as.matrix(data.bfi[, 1:25]) ## Load data
response <- na.omit(response) ## Remove samples with NA/missing values

## Transform the scores of reverse-scored items to normal scoring
response[, c(1, 9, 10, 11, 12, 22, 25)] <- 6 - response[, c(1, 9, 10, 11, 12, 22, 25)] + 1


CDF.obj <- CDF(response)

## Plot the CDF probabilities
plot(CDF.obj)




EFAfactors documentation built on Sept. 30, 2024, 1:06 a.m.