NaN* Error (PLEASE HELP)

Discuss statistics related things
Post Reply
2batra54
Posts: 3
Joined: Sat Aug 13, 2022 2:12 pm

NaN* Error (PLEASE HELP)

Post by 2batra54 »

Hello,

I have encountered this NaN* error while trying to use MANCOVA, more specifically the Box's M Test. I have 2 dependent variables (self-esteem and life-sat) and two independent variables (biological sex and socio-economic status). They are all nominal integer variables, except for sex which is nominal text. If I put just sex in the factor box, it gives me a number. However if I add or put just the SES variable in the factors box it gives me the NaN* error.
I have not seen this error before (nor have I found an explanation or fix online) and it is my first time using MANCOVA so I don't really know what to do, if anyone could help.
Thank you! :blush:
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: NaN* Error (PLEASE HELP)

Post by MAgojam »

Hey @2batra54,
he is always happy to help, but I cannot produce a possible error in MANCOVA as you indicated.
I am working on MANCOVA sources and if you have no problems, could you provide the omv file in which the error occurs?
You do not need the file with the real data, especially if there is sensitive data.
False data is fine too, as long as it produces the error that prevents you from concluding the analysis.

Cheers,
Maurizio
Last edited by MAgojam on Sat Aug 13, 2022 5:24 pm, edited 1 time in total.
2batra54
Posts: 3
Joined: Sat Aug 13, 2022 2:12 pm

Re: NaN* Error (PLEASE HELP)

Post by 2batra54 »

Hello,

Please find attached a fake dataset that gives the error.

It happenes when SES is put in factors and SELFESTEEM and lifesatisfaction are in dependent variables.
Attachments
fakescore.omv
(155.79 KiB) Downloaded 415 times
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: NaN* Error (PLEASE HELP)

Post by MAgojam »

Hey @2batra54,

you are using the variable "SES" as a factor that produces a warning here (source):
https://github.com/jamovi/jmv/blob/mast ... a.b.R#L166
The warning is reported in the foot of the "Box's Homogeneity of Covariance Matrices Test" table.
The Box's M test is only relevant when model contains factors, but your "SES" variable doesn't seem a factor.
So it shouldn't be on the Factors list, but is likely to be informative (adjust) if placed on the Covariates list.

Cheers,
Maurizio
2batra54
Posts: 3
Joined: Sat Aug 13, 2022 2:12 pm

Re: NaN* Error (PLEASE HELP)

Post by 2batra54 »

Thank you, that did fix it, although I wonder if that will change my results?

I am trying to find Socio-economic status and sex differences in reported levels of Self-Esteem and Life-satisfaction. To be completely truthful, I have not worked with so many variables before and I'm a bit lost. I thought MANCOVA would be the best solution to find said differences, but if I put sex in factors and SES in covariates, would that only show me differences for sex and not SES?
If that is the case, what do you think would be best to use? I have been searching for days and have not come across anything in relation to this.
Thank you very much!
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: NaN* Error (PLEASE HELP)

Post by MAgojam »

Hey @2batra54,
allow me to answer you in a generalist way.

A statistical technique that extends covariance analysis (ANCOVA) is multivariate analysis of covariance (MANCOVA)
Basically, it is multivariate analysis of variance (MANOVA) with one or more covariates.

In MANCOVA, statistical differences on multiple continuous dependent variables are evaluated by an independent grouping variable, by checking for a third variable called a covariate (multiple covariates may be used, depending on the sample size).
The covariate is added to reduce the error terms and to make the analysis eliminate the effect of the covariate on the relationship between the independent grouping variable and the continuous dependent variables.
If "sex" enters Factors, "SES" enters Covariates and the two "SelfEsteem" and "LifeSatisfaction" enters Dependent Variables, it's like asking MANCOVA:
Do self-esteem and life satisfaction differ by biological sex, after controlling by socio-economic status?

With your four variables we can consider it a one-way MANCOVA.

If you have time and desire to read:
Using Multivariate Statistics, 7th Edition [Barbara G. Tabachnick, Linda S. Fidell]
Chapter 7, p. 203

Cheers,
Maurizio
umesh_123
Posts: 1
Joined: Sun Aug 21, 2022 2:09 pm

Re: NaN* Error (PLEASE HELP)

Post by umesh_123 »

Hi,
I am doing analysis using LCA model. When i run a analysis upto 10 sample, i am able to compute Entropy value. I have 218 samples and try to compute Entropy. It never compute Entropy and says NaN. Why is this happening ?

Next, I am looking for interpretation of results on log-likehood, G2, G2P and X2p.

Thank you and waiting for your response.

Umesh Aryal
bekean23
Posts: 2
Joined: Tue Jul 18, 2023 4:03 am

Re: NaN* Error (PLEASE HELP)

Post by bekean23 »

LCA models can be sensitive to initial parameter values, especially with larger sample sizes. Make sure you have initialized the model with appropriate starting values and consider adjusting the optimization algorithm settings to improve model wordle convergence.
Post Reply