Missing data in groups and zero variance
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

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;

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
 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
 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