BartlettTestOfSphericity: 'BartlettTestOfSphericity'

View source: R/principalcomponentsanalysis.R

BartlettTestOfSphericityR Documentation

BartlettTestOfSphericity

Description

Conduct the Bartlett Test of Sphericity for a set of data, which tests that the correlation matrix of the data is not the identity matrix.

Usage

BartlettTestOfSphericity(
  data,
  weights = NULL,
  subset = NULL,
  missing = "Exclude cases with missing data"
)

Arguments

data

A data frame containing the data to test.

weights

A numeric vector containing the weight for each case in data.

subset

A logical vector which describes the subset of data to be analyzed.

missing

A string specifiying what to do when the data contains missing values. The valid options are "Error if missing data", "Exclude cases with missing data", "Use partial data (pairwise correlations)", and "Imputation (replace missing values with estimates)".

Details

This function wraps cortest.bartlett. In particular, it extends the existing funcitonality to weighted data, and it computes the test using a more conservative value of the sample size when there is missing data. The value for the sample size that is used is the size of the smallest pairwise-complete set of cases among all pairs of variables. This is consistent with SPSS.

Value

A list containing the Chi-Square value, degrees of freedom (df), and p-value for the test.


Displayr/flipDimensionReduction documentation built on Aug. 19, 2024, 9:29 p.m.