Learn R Programming

missMDA (version 1.14)

estim_ncpMultilevel: Estimate the number of dimensions for the Multilevel PCA, multlevel MCA or Multilevel FAMD by cross-validation

Description

Estimate the number of dimensions for Multilevel principal component (multilevel PCA, multilevel MCA ormultilevel Factorial Analysis of Mixed Data) by cross-validation

Usage

estim_ncpMultilevel(X,  ifac=1, ncpW.min = 1, ncpW.max = 5, ncpB.min = 1, 
    ncpB.max = 5, scale = TRUE, nbsim=100, pNA=0.05, threshold=1e-4, 
	nb.cores = NULL, verbose = TRUE)

Arguments

X

a data.frame with categorical variables; with missing entries or not

ifac

index of the group variable

ncpB.min

integer corresponding to the minimum number of components to test for the between matrix

ncpB.max

integer corresponding to the maximum number of components to test for the between matrix

ncpW.min

integer corresponding to the minimum number of components to test for the within matrix

ncpW.max

integer corresponding to the maximum number of components to test for the within matrix

scale

if all the variables are continuous, should they be standardized? Yes if true.

nbsim

number of simulations

pNA

percentage of missing values added in the data set, useful only if method.cv="Kfold"

threshold

the threshold for assessing convergence

nb.cores

Integer, number of core used. By default, NULL and the number of cores used are the number of cores of your computer minus 1

verbose

boolean. TRUE means that a progressbar is writtent

Value

ncp

the number of components retained for the FAMD

criterion

the criterion (the MSEP) calculated for each number of components

Details

pNA percentage of missing values is inserted at random in the data matrix and predicted with a multilevel model using ncpB.min to ncpB.max and ncpW.min to ncpW.max dimensions. This process is repeated nbsim times. The number of components which leads to the smallest MSEP is retained. More precisely, the missing entries are predicted using the imputeMultilevel function.

See Also

imputeMultilevel

Examples

Run this code
# NOT RUN {
data(ozone)
result <- estim_ncpMultilevel(ozone, ifac=12)
# }

Run the code above in your browser using DataLab