There are at least two options, parsing that function as a string or expression. Below is one option how you could parse it as expression using Arg()
Names Default To Here(1);
f = Expr(Fit Model(
Y(:Y1, :Y2, :Y3, :Y4, :Y5, :Y6, :Y7, :Y8, :Y9, :Y10, :Y11, :Y12, :Y13, :Y14, :Y15),
Effects(
:X1 & RS, :X2 & RS, :X3 & RS, :X4 & RS, :X5 & RS, :X1 * :X1, :X1 * :X2, :X2 * :X2, :X1 * :X3,
:X2 * :X3, :X3 * :X3, :X1 * :X4, :X2 * :X4, :X3 * :X4, :X4 * :X4, :X1 * :X5, :X2 * :X5, :X3 * :X5,
:X4 * :X5, :X5 * :X5, :Block, :X6, :X7
),
Personality("Standard Least Squares")
));
first_arg = Arg(f, 1);
second_arg = Arg(f, 2);
ys = Substitute(Arg(f, 1), Expr(Y), Expr(List()));
show(first_arg); // first_arg = Y(:Y1, :Y2, :Y3, :Y4, :Y5, :Y6, :Y7, :Y8, :Y9, :Y10, :Y11, :Y12, :Y13, :Y14, :Y15);
show(second_arg);
show(ys); // ys = {:Y1, :Y2, :Y3, :Y4, :Y5, :Y6, :Y7, :Y8, :Y9, :Y10, :Y11, :Y12, :Y13, :Y14, :Y15};
I think you could also use Extract Expr()
Extract Expr(f, Y(Wild List()));
-Jarmo