Here's an example (simple mediation model with one mediator m and two groups):
TITLE: multigroup path analysis
DATA: data.dat;
VARIABLE: NAMES ARE x m y;
GROUPING IS g (1=male 2=female);
MODEL: y on x m;
m on x;
OUTPUT: SAMPSTAT STDYX;
In this example, all 3 paths would be estimated separately/freely between groups. If you wanted the paths to be constrained equal across groups, you would have to change the MODEL statement as follows:
MODEL: y on x (c)
m (b);
m on x (a);
The labels (a), (b), and (c) tell Mplus to hold the path coefficients equal across groups.
If you wanted to obtain the direct, indirect, and total effects from x to y, you would add the statement