Missing data in groups and zero variance PreviousNext
Mplus Discussion > Missing Data Modeling >
Message/Author
 Ray posted on Tuesday, March 17, 2009 - 9:14 am
I'm having some trouble understanding how I should reformat my input statement given these problems:

1) I have a grouping variable in which one of the groups has no data. MPlus doesn't like this, apparently.

2) The variance in some of my variables within groups is zero.

How do I overcome these issues?
 Ray posted on Tuesday, March 17, 2009 - 9:17 am
I'm doing a CFA, by the way.
 Ray posted on Tuesday, March 17, 2009 - 9:43 am
Okay, I solved the first problem, but still don't understand how to address the second.
 Bengt O. Muthen posted on Friday, March 20, 2009 - 1:29 pm
You can try:

Variance = nocheck;

but you may still get in trouble when the program tries to invert the sample covariance matrix in that group. You might have to include a dummy person given a small weight.
 Kristine Molina posted on Friday, December 11, 2009 - 8:18 pm
Hi--

I just tried running a multiple group (4 groups) path analysis and am getting an error that says:

*** ERROR
One or more variables have a variance of zero. Check your data and format statement.

I realize that this is because there are no people from one of the subgroups that were sampled in a specific region.

How can I address this issue, and if there is a command I can use, in what section would it go under in the Mplus Editor?

Thanks!
Kristine
 Bengt O. Muthen posted on Saturday, December 12, 2009 - 9:08 am
You need to have a set of variables that have variance in all groups. So deleting this variable would be a simple solution.
 Rachel Liebman posted on Saturday, September 07, 2013 - 6:15 pm
Hi, I am conducting a CFA in which a latent variable is regressed on 2 dichotomous variables. I keep getting this error message:

*** ERROR
One or more variables have a variance of zero. Check your data and format statement.

Continuous Number of
Variable Observations Variance

**IPV 41 0.000
CHIADOL 41 0.678

IPV is a dichotomous variable. i've checked the data and it shouldn't have zero variance - group 1 has 42 people and group 2 has 22. there are only a couple missing data points, and no blanks. I'm not sure what is causing the problem.

Here is my syntax:

MODEL:
f1 BY zaffang Zharm@.5 ZRisk zconcen@.5;
zAFFANG WITH zSOMAT ;
f2 BY ineffnob* zdamsham* zguilt zsomat zsystems;
zSOMAT WITH ZRISK ;
f3 BY zvicoth distrrev@1;
distrrev WITH zconcen ;
ZDAMSHAM WITH INEFFNOB;
INEFFNOB WITH ZSYSTEMS ;
INEFFNOB WITH distrrev;
ZDAMSHAM WITH INEFFNOB ;
f4 BY f1* f2@.33 f3@.33;


f4 ON IPV;
f4 ON chiadol;

This error only comes up when I run both the regressions listed above. If I just include f4 on ipv, I don't get the error. Any ideas what might be causing this?
 Linda K. Muthen posted on Sunday, September 08, 2013 - 6:47 am
Please send the output and data to support@statmodel.com.
 P.Kwei posted on Monday, April 27, 2015 - 8:16 am
Hello Dr Muthen,
I am new to MPlus and just feeling my way around it. I want to run an MSEM and when I added Gender (1=Male, 2=Female) as a control variable, I got the error below. I had used the DEFINE option to create a new
variable but it has not worked. What is the way around it?

*** ERROR
One or more variables have a variance of zero.
Check your data and format statement.
 Linda K. Muthen posted on Monday, April 27, 2015 - 10:17 am
Please send your output and license number to support@statmodel.com.
 Daria Bakina posted on Thursday, August 06, 2015 - 6:54 am
I'm getting a similar message "ERROR
One or more variables have a variance of zero.
Check your data and format statement."

I checked the data files and the data is there. I saved the data in two versions of a .txt file (Comma Delimited and MS-DOS).

Any suggestions on fixing this would be appreciated!
 Linda K. Muthen posted on Thursday, August 06, 2015 - 11:54 am
Please send the output, data set, and your license number to support@statmodel.com.
 Claire Johnston posted on Thursday, November 26, 2015 - 12:20 am
I am getting the error message that one of my variables has a value of zero. I know this is not the case, because when checking the same variable in SPSS, it does not have a variance of zero. The variable concerned is a log transformation of income for year 1. The same variables for year 2 and year 3 cause no problems.

Any ideas?
 Linda K. Muthen posted on Thursday, November 26, 2015 - 6:37 pm
Please send the output, data, and your license number to support@statmodel.com.
 Mercy Oyet posted on Thursday, January 11, 2018 - 6:01 pm
Hello Dr. Muthen,

I am conducting multilevel analyses with mplus. Similar to the previous posts, I am getting the following error message:

ERROR
One or more variables have a variance of zero.
Check your data and format statement.
However, the SPSS result indicates that the variable identified in the MPLUS output does not have a variance of zero. I am not sure how to proceed and would appreciate your advice. Thank you.
 Linda K. Muthen posted on Friday, January 12, 2018 - 5:02 pm
Please send the output, your data set, and your license number to support@statmodel.com.
 Amber Fahey posted on Sunday, April 08, 2018 - 5:21 pm
Hello, I too am receiving an error others had received saying one or more variables have a variance of zero, however when I check in SPSS I am getting a variance value for the trouble variables, and when I run the exact same model statement but with a different within variable, I do not receive this error. I can not seem to find any good work arounds.

I tried Variance = no check mentioned above and received this error:

*** ERROR in ANALYSIS command
(Err#: 64)
Numerical format error for VARIANCE option:
no check

Your advice is greatly appreciated!!
 Bengt O. Muthen posted on Sunday, April 08, 2018 - 5:34 pm
Please send the output, your data set, and your license number to support@statmodel.com.
 Tess Yanisch posted on Friday, February 08, 2019 - 12:29 pm
I'm running a SEM and I get the same error ("*** ERROR
One or more variables have a variance of zero.
Check your data and format statement.")

I have three genders: male, female, and nonbinary. I'm using dummy variables with male as the reference group.

The error refers to the Nonbinary dummy variable. In SPSS, the variance is small (.05ish) as only about 5% of my sample falls in that category, but it's not zero, and variables that--according to SPSS--have smaller variance aren't causing a problem in Mplus.

Any advice?

Thank you in advance.
 jb posted on Saturday, February 09, 2019 - 2:52 am
Dear Mplus Support,
I am also receiving a similar error message to the posters above ("*** ERROR
One or more variables have a variance of zero.
Check your data and format statement.") using a dichotomous predictor variable with values 0 and 1, the variance according to SPSS is 0.5
I have emailed the data set as advised to the users above...

Many thanks for your support in advance
 Bengt O. Muthen posted on Saturday, February 09, 2019 - 11:10 am
Answer for Tess and jb.

This message typically appears when the data haven't been read as intended due to user error. One way to check that the data has been read as intended is to use the SAVEDATA command to save the analysis data set. You can then compare the data to the variable order given at the end of the output and see what your mistake was.
 Tess Yanisch posted on Friday, February 15, 2019 - 3:20 pm
Thank you very much!

I seem to have a related issue now. When I save the data, my missing values all turn into *. This is fine, but when I try to run my analysis in the newly-saved dataset, I change my MISSING ARE ALL (-9999) to MISSING ARE ALL (*) and I get this error:

*** ERROR in VARIABLE command
Period (.) or asterisk (*) used as the missing symbol must apply to the whole dataset. No variables (or ALL) should be mentioned in the MISSING option when these symbols are specified as the missing symbol.

But when I don't have ALL in there, I get *this* error:

No variable name given for missing value: *

Any ideas would be much appreciated! Is there a way to do SAVEDATA and keep my missing values what they were, perhaps?
 Linda K. Muthen posted on Friday, February 15, 2019 - 5:29 pm
The correct specification is

MISSING = *;

See the MISSFLAG option of the SAVEDATA command to select a different missing value flag.
 Tess Yanisch posted on Saturday, February 16, 2019 - 12:36 pm
Thank you so much!

And the analysis is now running without any strange variance errors, so thank you twice.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: