MissMDA error message

3,886 views
Skip to first unread message

Emily Choy

unread,
Nov 28, 2015, 4:19:19 PM11/28/15
to FactoMineR users
Dear Factominer users,

I am having trouble using missMDA to imput missing PCA values.  I have a table of fatty acid proportions that have been log transformed.
When I put in the first line of code :

nb <- estim_ncpPCA(orange,ncp.min=0, ncp.max=5)
 
I get:

Error in eigen(crossprod(X, X), symmetric = TRUE) :
  infinite or missing values in 'x'

Also, is it possible to use missMDA for a PCA if you have qualitative supplementary variables?

Thank you,
Emily

François Husson

unread,
Nov 30, 2015, 8:17:30 AM11/30/15
to FactoMineR users
Hi,

If you have continuous and categorical variables, and you want to use only the continuous variables as active variables, you should omit first the categorical variables, impute the continuous variables and then concatenate the imputed dataset and the categorical variables.

Else, if you want to use all the variables as active variables, you should use the imputeFAMD function. This function will use both continuous and categorical variables to impute missing values.

Best
FH

Raquel Pereira

unread,
Jun 19, 2017, 8:30:22 AM6/19/17
to FactoMineR users
Hej 

I am having the same issue, with all my variables being continuous. 

I have some zeros (actual number 0) and some NA, I was trying to get the estim_ncpPCA to work, but without success.

variables<-estim_ncpPCA(trim.data,ncp.min=0, ncp.max=5)


estim_ncpPCA(trim.data, ncp.min=0,ncp.max=3)
Error in eigen(crossprod(t(X), t(X)), symmetric = TRUE) : 
  infinite or missing values in 'x'


head(trim.data,3)
                                           Length_mega_1 Length_mega_2 Length_mega_3 Length_mega_4 Length_mega_5  .... Length_mega_36
BMNH_1954_3_9_425             284.3                    185.8                  272.5                   311.4                338.2
BR513                                       408.1                     335.1                 402.7                  427.3                332.4
P056_111012_1                        390.0                     380.0                  365.0                 350.0                 330.0



What am I doing wrong?

Raquel Pereira

unread,
Jun 19, 2017, 8:31:19 AM6/19/17
to FactoMineR users
NOTE
trim.data[1,1]
[1] 284.3


On Saturday, November 28, 2015 at 10:19:19 PM UTC+1, Emily Choy wrote:

josse

unread,
Jun 20, 2017, 12:25:19 PM6/20/17
to factomin...@googlegroups.com

Dear Raquel and Emily,

Could you send me the summary of your data so that I can get a hint on what's going on,

Best wishes,

Julie

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "FactoMineR users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Daniel Pinillos

unread,
Jun 20, 2019, 6:26:21 AM6/20/19
to FactoMineR users
Hi Raquel,

I am having the exact same problem, I have some 0s and some NAs in my data and I get the same message over and over. Did you find out what was wrong or an alternative solution? (I am trying to run a PCA with missing values)

Thanks!!

Daniel

François Husson

unread,
Jun 24, 2019, 4:07:02 AM6/24/19
to factomin...@googlegroups.com
The problem was that one of the variable has only NA except just one observed value. So the standard deviation cannot be calculated. It is necessary to suppress this variable ... and then everything will be ok!
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "FactoMineR users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Francois Husson
Department Statistics & Computer science
AGROCAMPUS OUEST
65 rue de St-Brieuc - 35042 RENNES
Tel: +33 2 23 48 58 86
https://husson.github.io

Cecilia Alonso

unread,
Jun 25, 2019, 11:21:35 AM6/25/19
to FactoMineR users
hi Francois,

Iam having the same problem while trying to impute missing data with missMDA. I get this error ( Error in eigen(crossprod(X, X), symmetric = TRUE) : infinite or missing values in 'x'), even when there is only one variable with NAs and there are only 2 NAs in 30 observations... attached goes the csv file.

many thanks in advance for your help!

best regards

Cecilia

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factomin...@googlegroups.com.

Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/factominer-users/a8ed68be-40b4-4d46-a8d3-5e49f9194a8d%40googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
EnvRdlP.csv

Francois Husson

unread,
Jun 27, 2019, 2:06:56 AM6/27/19
to factomin...@googlegroups.com

Hi,

Your variable depth is not a variable because there are only 0. Thus it is not possible to use this column whin is not a variable. The standard deviation is 0, and thus you cannot perform a standardized PCA.

So suppress this column from your dataset.

FH

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/factominer-users/fb428b71-129b-48a1-84f6-5251cf146805%40googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
--
Francois Husson
Department Statistics & Computer science
IRMAR 6625
65 rue de St-Brieuc - Agrocampus Ouest - 35042 RENNES

Cecilia Alonso

unread,
Jun 27, 2019, 4:01:21 PM6/27/19
to factomin...@googlegroups.com
hi, thank you very much. I had suppressed it in other analyses, but not in this one :(

sorry for the mistake.

best regards

Cecilia

SHAMIHAH GHAZALI

unread,
Jan 8, 2020, 2:20:27 AM1/8/20
to FactoMineR users
Hi Francois, i have been use this missmda package and load for imputing missing values using imputePCA function and do some simulating pattern (up to 100 array) of missingness to be imputed. but when i load some of simulation along with the imputePCA function it show some error which is
" Error in eigen(crossprod(X, X), symmetric = TRUE) : 
  infinite or missing values in 'x' "

if you want to see my data pet me get your email and i will email personally to you. Thankyou
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factomin...@googlegroups.com.

Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/factominer-users/a8ed68be-40b4-4d46-a8d3-5e49f9194a8d%40googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Francois Husson

unread,
Jan 14, 2020, 8:35:26 AM1/14/20
to factomin...@googlegroups.com
Maybe you have some individuals or some wariabes that only have missing values.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/factominer-users/abefc700-0351-4ac4-9aa8-144eeaa3b783%40googlegroups.com.

SHAMIHAH GHAZALI

unread,
Jan 14, 2020, 10:09:26 AM1/14/20
to factomin...@googlegroups.com
Thankyou so much for the replies! i had found the problem..some of the array have only missing values then the standard deviation cant be calculated. 
Best Regards,
Shamihah Binti Muhammad Ghazali
Sarjana Sains Statistik (CS753)
Fakulti Sains Komputer & Matematik
Universiti Teknologi MARA, Shah Alam



Reply all
Reply to author
Forward
0 new messages