Explanation of Calculations of the MF-similarity Measure

Peter P. Wakker
December, 2009

This text presents the software used to calculate the metric-frequence (MF) similarity measure introduced by
Sales, Célia M.D. & Peter P. Wakker (2009), “The Metric-Frequency Measure of Similarity for Ill-Structured Data Sets, with an Application to Family Therapy,” The British Journal of Mathematical and Statistical Psychology 62, 663-682.

The program used to calculate the MF similarity measure is called mfsim.exe.   Given that it is an exe-file, your browser will probably give warnings if you click on the preceding link to download the program. It is safe to download it! It was made using Turbo-Pascal. For people who are able to use this program, here is the input file. The program can be used as follows.

Creating a default data file and directory

  1. Create a folder (“directory”) c:\home\wakker (Nowadays many versions of Windows Vista and networks do not allow writing in the main c:\ directory, which is why I direct all my output to this directory, as also done with this program. Hope the name of this directory is not inconvenient to you.)
  2. Create a data file for every participant, which will be a simple text (ASCII) file. Start from a copy of
    this file
    for each participant. Because it should be a simple text file, it may be safest to use a simple editor such as notepad or wordpad to edit it. If you edit it by means of Microsoft word, have to save it as an MS DOS text with linebreaks (or whatever gives you an ASCII file with linebreaks kept). Leave the layout with lines and linebreaks and so on exactly as is. (The program will search info in particular lines.) If you add one linebreak, for example, then the program will no longer work. With this understood, make the following changes.
    - The following points regarding the second, third, and fourth line in the data file, are the same for each participant and, hence, are best done first in your starting copy of the maldata file.
    - On the second line, the malfile has the number capital N explained in the paper. (It should exceed the nr. of items raised by each participant.) For all participants and in all participant-data files you create, N should be the same.
    - On the third line, the malfile has the minimal value of the seriousness weights, which indicates that the item was not raised, and which I usually take to be 0. Any other value can be used. The program will renormalize to 0 automatically.
    - On the fourth line, the malfile has the maximal value of the seriousness weights, which in the paper usually is 7, but it can be any. The program will renormalize it to be 1. The max and min scores are the same for all seriousness weights for all items for all participants. The analysis doesn't work if some items can range from 0 to 7 and others can range from 0 to 3, for instance. In the latter case you might 0-1 normalize all seriousness weights for all items by means of another program, and then set min to 0 and max to 1 for all items before using this program.

Creating a data file for each participant

  1. Number all the participants who will be considered in the analysis.
  2. Number all the items that will appear in the mf-sim analysis. The numbering should be the same for all participants considered. Thus, if item 1 is “conflict within the family” then item 1 should refer to this for all participants considered. Usually, most participants will score the minimal 0 (not raised; absent) on most items. The program as written now assumes that there are no more than 99 items in total that are considered. (It can easily be extended to more than 99.)
  3. Now create a separate file for every participant.
  4. On the first line, change the participant nr. 0 into the nr. of the participant now considered.
  5. Then fill out the seriousness weights of items 1-99, all iinitially set to a default 0 (“@not brought up”) in the mal file. If your data have only 20 items, do not remove items 21-99 because the program needs to read them (I am not a sophisticated programmer). Just leave them at their default value 0 (“not raised”).
  6. Save a separate data file for each participant.

Running the Program

You have to run the program for the participants pairwise, pair by pair. (I am, indeed, not a sophisticated programmer.) Select the two participants of whom you want to calculate the mf-sim score. Copy the data file of one to
c:\home\wakker\datafath
, and of the other to
c:\home\wakker\datamoth
Note that these file names have no extensions. Now run the program mfsim.exe. It will display results on the screen, and will also write them to the file c:\home\wakker\simreprt

Examples

This section gives examples. First I give links to all the data sets of participants considered in our paper. These data files were all made according to the method of the preceding section.

Data files of participants in Table 1.

Data files of participants in Table 3.

Data files of participants in Table 5.

Data files of participants in Table 8.


Now I give some examples of calculating similarities.

EXAMPLE 1. We consider the similarity of the father and mother in Table 1.
Step 1. Go to the data files of the participants in Table 1.
Step 2. Copy the data file of the father (participant 1) to c:\home\wakker\datafath
Step 3. Copy the data file of the mother (participant 2) to c:\home\wakker\datamoth
Step 4. Run the program mfsim.exe. It will display results on the screen, and will also write them to the file c:\home\wakker\simreprt. Here is what that latter file will be like.


EXAMPLE 2. We consider the similarity of fire and ball in Table 3.
Step 1. Go to the data files of the participants in Table 3.
Step 2. Copy the data file of fire (participant 1) to c:\home\wakker\datafath
Step 3. Copy the data file of the sun (participant 2) to c:\home\wakker\datamoth
Step 4. Run the program mfsim.exe. It will display results on the screen, and will also write them to the file c:\home\wakker\simreprt. Here is what that latter file will be like.


EXAMPLE 3. As Example 2, but now the similarity of fire (participant 1) and sun (participant 3) in Table 3.
Here is what that file with results will be like.


EXAMPLE 4. We consider the similarity of participants 6 and 9 in Table 5 (hypothetical example). Here is what that file with results will be like.


EXAMPLE 5. We consider the similarity of mother (participant 1) and Zarastro (participant 2) before treatment in Table 8 (family therapy). Here is what that file with results will be like.


EXAMPLE 6. We consider the similarity of mother(participant 1) and Zarastro (participant 2) after treatment in Table 8 (family therapy). Here is what that file with results will be like.


Last updated: September 15, 2009