parallel_analysis: Parallel analysis

View source: R/parallel_analysis.R

parallel_analysisR Documentation

Parallel analysis

Description

Conducts a parallel analysis to determine how many factors to retain in a factor analysis.

Usage

parallel_analysis(
  data = NULL,
  names_of_vars = NULL,
  iterations = NULL,
  percentile_for_eigenvalue = 95,
  line_types = c("dashed", "solid"),
  colors = c("red", "blue"),
  eigenvalue_random_label_x_pos = NULL,
  eigenvalue_random_label_y_pos = NULL,
  unadj_eigenvalue_label_x_pos = NULL,
  unadj_eigenvalue_label_y_pos = NULL,
  label_offset_percent = 2,
  label_size = 6,
  dot_size = 5,
  line_thickness = 1.5,
  y_axis_title_vjust = 0.8,
  title_text_size = 26,
  axis_text_size = 22
)

Arguments

data

a data object (a data frame or a data.table)

names_of_vars

names of the variables

iterations

number of random data sets. If no input is entered, this value will be set as 30 * number of variables.

percentile_for_eigenvalue

percentile used in estimating bias (default = 95).

line_types

types of the lines connecting eigenvalues. By default, line_types = c("dashed", "solid")

colors

size of the dots denoting eigenvalues (default = 5).

eigenvalue_random_label_x_pos

(optional) x coordinate of the label for eigenvalues from randomly generated data.

eigenvalue_random_label_y_pos

(optional) y coordinate of the label for eigenvalues from randomly generated data.

unadj_eigenvalue_label_x_pos

(optional) x coordinate of the label for unadjusted eigenvalues

unadj_eigenvalue_label_y_pos

(optional) y coordinate of the label for unadjusted eigenvalues

label_offset_percent

How much should labels for the eigenvalue curves be offset, as a percentage of the plot's x and y range? (default = 2)

label_size

size of the labels for the eigenvalue curves (default = 6).

dot_size

size of the dots denoting eigenvalues (default = 5).

line_thickness

thickness of the eigenvalue curves (default = 1.5).

y_axis_title_vjust

position of the y axis title as a proportion of the range (default = 0.8).

title_text_size

size of the plot title (default = 26).

axis_text_size

size of the text on the axes (default = 22).

Details

The following package(s) must be installed prior to running the function: Package 'paran' v1.5.2 (or possibly a higher version) by Alexis Dinno (2018), https://cran.r-project.org/package=paran

Examples


parallel_analysis(
  data = mtcars, names_of_vars = c("disp", "hp", "drat"))
# parallel_analysis(
# data = mtcars, names_of_vars = c("carb", "vs", "gear", "am"))


kim documentation built on Oct. 9, 2023, 5:08 p.m.