New features in MLwiN 2.18

Improved names window functionality

In MLwiN v2.10 to v2.17, the Names window looked like this:

old names

In MLwiN 2.18 several features have been added to the Names window, and the window has been reorganized so that it now looks like this:

new names

New features


Three features for managing category labels assigned to categorical variables have been added. These give the ability to Copy category labels from one variable and Paste into another, and to Regenerate the category labels so that labels referring to codes not taken on by any unit in the data are dropped along with the corresponding code while labels referring to codes that are taken on by at least one unit in the data are kept. The ability to View the labels assigned to the codes and to edit these, which was available in previous versions too, is still present in v2.18.

Copy and paste

Category labels can be copied from a variable by highlighting this variable in the Names window and pressing Copy under Categories. These can then be pasted onto another column by highlighting that column and pressing Paste under Categories. The column pasted to need not already be categorical; if it is not then it will become categorical when the categories are pasted into it. (Note that there is no undo button for this paste operation, but it can be undone by pressing Toggle Categorical to turn the variable back to continuous, and then if the variable should be categorical but with different labels, pressing Toggle Categorical again, and pressing View under Categories to edit the category labels back to the correct ones). Category labels can also be pasted into a program such as Word Pad, Excel, or Word, edited here if desired, then copied from these programs and pasted back into MLwiN.

Copying a categorical variable (not just its labels) to another column in the same worksheet or to a different worksheet and preserving its category labels is a two step task. First the data must be copied, by highlighting the variable in the Names window, pressing Copy under Data, highlighting the destination column, and pressing Paste under Data. This will copy the numerical values of the variable, but the variable will not be declared as categorical, and if Toggle Categorical is pressed it will not have the original category labels but automatically generated ones. To preserve the labels, the second step is, after pasting, to highlight the original variable again, press Copy under Categories, highlight the new variable, and press Paste under Categories.

The commands to copy and paste categories are CCAT and PCAT:

CCAT <column> copies the category labels from the specified column
PCAT <column> pastes previously copied labels to the specified columnmn


It is possible for category labels to be present for codes that do not occur in the data. For example, we could have a variable called "Transport" which has the label "Bus" assigned to code 10, but the values actually taken on by "Transport" could only range between 2 and 7: no unit in the data takes on the value "Bus" for this variable. This may happen when we recode the variable, collapsing several categories into one; or if we omit all cases with a certain value of the variable from the data; or, very frequently, when the data comes from SPSS or Stata where several different categories of Missing are allowed: MLwiN recodes all these to its MISSING value but the labels remain assigned to the original codes. Having labels assigned to codes which are not taken on by any unit in the data is problematic when the variable is included in a model, either as an explanatory variable or as the response. When it is included as an explanatory variable a dummy variable will be created and entered into the model for every code that has a label (apart from the reference category),and when it is used as the response in a multinomial model there will be an equation for every value of the response that has a label (again apart from the reference category).

In previous versions of MLwiN, the only way to remove the unwanted labels was to press Toggle Categorical so that the variable became continuous, then press Toggle Categorical again so that the variable was once again declared as categorical. This would make MLwiN automatically generate category labels just for the codes present in the data; these automatically generated labels could then be edited to the desired ones. The removing of unwanted labels is made
easier in v2.18 via the Regenerate button under Categories. When this is pressed, MLwiN looks at the assigned labels for the highlighted variable and at the values actually taken on by that variable. It then drops the labels for any codes which do not appear in the data, while the labels of any codes which do appear in the data are preserved.

The command to regenerate categories is RCAT:

RCAT <column> will regenerate the category labels for the specified column

Reorganisation of previously existing features

Some of the buttons that appeared on the Names window of v2.10 to v2.17 have the same names in v2.18, but have changed their locations. These are:

button previously now
Description the 6th button from the left the 2nd button under Column
Toggle Categorical the 4th button from the left the 3rd button under Column
Copy the 7th button from the left the 2nd button under Data
Paste the 8th button from the left the 3rd button under Data
Delete the 9th button from the left the 4th button under Data
The refresh button the 1st button on the left under Window
Help the rightmost button the rightmost button under Window

In addition to these buttons, the Used columns tick box has changed position, moving from being to the right of all the buttons to appearing as the first thing under Windows.

Other buttons that appeared on the Names window of v2.10 to v2.17 are still present in v2.18, but have changed their names as well as moving. These are:

New button Old button

Name under Column

Edit name

View under Data


View under Categories


All of these buttons have identical functionality to their incarnations in v2.10 to v2.17; and there are no functions in v2.10 to v2.17 that are not carried out by some button in v2.18.

*Training materials - a few changes from 2.18 onwards

The changes affect the appearance of the Names window; some buttons have changed their location, and some buttons have also changed their name. There are also some new features available in the Names window; there is no loss of features compared to earlier versions (every facility offered by the Names window in v2.10 to v2.17 is also available in v2.18).

Since the training materials use screenshots and instructions based on the earlier versions, users should be aware that:

We intend to update many of our materials, in particular the manuals and the LEMMA online learning materials. However this is a fairly large undertaking and it is anticipated that this will not happen for several months. In the meantime we ask users to be aware of these small differences and apologise for any confusion resulting from this.

Edit this page