Questions tagged [factominer]

29 questions
4
votes
0 answers

Dimensionality reduction on repeated measures: PCA? MFA? (FactoMineR)

I have a repeated measures sample, where each participant was asked to complete a sleep survey over the course of 5 years (baseline though year 4 of follow-up). Each survey item is fairly correlated (e.g. when you go to bed correlates with your…
Jess G
  • 188
  • 9
2
votes
0 answers

How I can get the cos2 from the PCA results?

I would like to calculate the cos2 of variables and individuals in Sklearn, like the FactoMineR package does in R. Is there an alternative in pyhton? In R with FactoMineR I do something like this pca_exp = PCA(df) pca_exp[["ind"]][["cos2"]] I got,…
2
votes
0 answers

HCPC and PCA: how to assign supplementary individuals to clusters?

Context: I am trying to 1) define cluster based on certain individuals and 2) assign others individuals to the defined clusters. What has been done: I use FactoMineR functions PCA() and HCPC() according to the workflow described by Husson, F.,…
Paul
  • 2,850
  • 1
  • 12
  • 37
1
vote
0 answers

Specify both different pointshapes and color by group for ind in fviz_mfa_ind?

Is there any way of specifying both a 1) shape for individual points by a grouping variable, and 2) color for individual points by a different grouping variable in fviz_mfa_ind() from R package FactoExtra? Specificizing a group in "habillage" as in…
c_j
  • 11
  • 2
1
vote
1 answer

Change colour of supplementary column using factoextra in R

I am trying to change the colour used for the supplementary column in a correspondence analysis using fviz_ca_col() from the package factoextra, but I do not seem to get any response when changing the colour from the default col.col.sup =…
humperderp
  • 241
  • 1
  • 11
1
vote
1 answer

geom_path grouped and path ordered by categorical factor

I am looking for a solution to order the pathway of geom_path based on a defined order set to a factor. I have been working with the fist two PCA dimensions. Using library("factoextra") and library("FactoMineR") I generate my figure with…
bennh
  • 11
  • 2
0
votes
1 answer

How do I extract the Eigenvectors from a PCA calculated using FactoMinerR using R?

I am running a PCA on some inflation data and have performed it using the PCA() command from the FactoMineR package and also using the prcomp()command. My goal is to get the Eigenvectors from the PCA for the next step in my analysis. The results…
tlkcfa
  • 1
  • 2
0
votes
0 answers

Why PCA code is not running, the matrix is 0х0?

df_scaled <- as.data.frame(scale(df)) features <- df_scaled[, -10] target <- df_scaled[, 10] pc <- PCA(features, graph = FALSE) print(pc) Error in eigen(crossprod(t(X), t(X)), symmetric = TRUE) :0х0 matrix where is the error? I have 19178 obs. of …
0
votes
0 answers

Trouble with FactoMineR plotting (R)

I am using the FactoMineR package in R, combined with a dataset from the ISLR package. Below is reproducible code: library(FactoMineR) library(factoextra) library(ISLR) data("Wage") attach(Wage) # discreetize age and log wage Wage$age <-…
Leah Bevis
  • 317
  • 1
  • 11
0
votes
1 answer

Applying Benzecrì correction with FactoMiner

I have a dataset like the one below (with qualitative variable) and I need to apply Benzecrì correction on the dataframe that i will use for the MCA or on the function res.mca, gender Income Male from 10-15 Female from…
0
votes
0 answers

Is it possible to use missMDA for imputating values for MCA with FactoMineR and still get a modality names containing underlying variable names?

I use the missMDA and the factomineR package to create an object for my mca analysis. It works fine except for the names of the modalities. When I create a mca object without imputation, the names of the modalities are a combination of the…
0
votes
0 answers

Specify coloring & grouping variable (habillage) within factoextra::fviz_pca custom function

Question I am creating a custom function that takes a dataframe, wrangles it to a PCA, and then plots a PCA using factoextra::fviz_pca but I am having trouble coloring the groups of the PCA using the habillage argument. Or, what is the unknown…
user7264
  • 123
  • 8
0
votes
0 answers

Error while knitting PCA plots with R in vscode

When I knit my Rmd file, the graphs related to my PCA are not shown on the html file. The PCA seems to be working though. library("FactoMineR") data(decathlon) decathlon.active <- decathlon[1:23, 1:10] head(decathlon.active[, 1:6], 4) res.pca <-…
0
votes
0 answers

Add some labels on a clustering plot with Factoextra and FactoMineR

I am a beginner at FactoMineR and factoextra, and I don't know how to add some labels in the result plot of my HCPC. This is my code : library(FactoMineR) library(factoextra) X<-read.table('C:/.../Bus.txt', sep='\t', header=TRUE,…
JC_
  • 33
  • 4
0
votes
1 answer

Why do I get different clustering between FactoMineR and factoextra packages in R given I use the same metric and method?

I am doing agglomerative hierarchical clustering (AHC) using two R packages, FactoMineR and factoextra after doing PCA on the dataset, and I end up having a discrepancy in at least one cluster membership but it could more than one had other datasets…
doctorate
  • 1,381
  • 1
  • 19
  • 43
1
2