Variables
You can (and have to) name the variables you are reading using the VARIABLE
command.
VARIABLE:
NAMES ARE var1 var2 var3 var4 var5
Variable names can have a maximum of 8 characters and may contain letters, numbers and the underscore sign. Note that it is advisable to use variables names with 6 (six) characters only. The reason is that for some parts of some of the output, Mplus will add one or two additional characters (e.g. in the case of thresholds); and if your variable name has eight characters, the last two characters will be truncated and replaced by the new characters.>
You may also indicate consecutive variables like this:
VARIABLE:
NAMES ARE var1-var5
Categorical and other non-continuous variables
If variables cannot be considered as metric and continuous, you should indicate the type of variable. Note that this holds only for dependent variables. (Don't forget that all indicators are dependent variables as well, typically outnumbering what 'normal' people consider as dependent variables).
VARIABLE:
NAMES ARE var1-var8;
CATEGORICAL IS var2;
NOMINAL ARE var3 var4;
CENSORED ARE var5 (a) var6 (b);
COUNT IS var7;
Note that CATEGORICAL
refers to variables that are either binary or ordered; variables declared as categorical must not have more than 10 categories. Unordered categorical variables are declared as NOMINAL
. In the case of CENSORED
variables, you have to declare whether they are censored from a
bove or from b
elow.
Missing values
Missing values may be either numerical values or non-numerical characters. These two ways may not be combined in a data set.
Numerical missing values
VARIABLE:
NAMES ARE var1 var2 var3 var4 var5;
MISSING ARE var1 (99) var2 (999);
Things are much more easy if you can use the same value for all missing variables
VARIABLE:
NAMES ARE var1 var2 var3 var4 var5;
MISSING ARE ALL (999);
Non-numerical missing values
You may use the period ".", the asterisk "*", or blanks to indicate missing data. You can use only one of these "flags" in a particular data set. In the case of the period, it goes like this (and you would deal with the asterisk in a similar way):
VARIABLE:
NAMES ARE var1 var2 var3 var4 var5;
MISSING ARE .;
Blanks can be used only with fixed format data.
VARIABLE:
NAMES ARE var1-var5;
MISSING = BLANK;
Select variables or cases
Variable selection
Often, you will not need all the variables in your data file for a specific analysis. In this case, use the USEVARIABLE
subcommand:
VARIABLE:
NAMES ARE var1 var2 var3 var4 var5;
USEVARIABLES var1 var2 var3 var4;
© W. Ludwig-Mayerhofer, Mplus Guide | Last update: 29 Aug 2010