Am 07.04.2026 um 10:57 schrieb Ramki S:
Seems I fixed the issue. However I want to add the suffix to _gmc,
_cwc, _cm to grand mean centered, cluster mean centered, cluster mean variables
automatically. How to do this? Currently i have to give a variable name.
Either string substitution with the @ symbol or the genseries() function.
string yname = "GPA"
series @yname_cm = cluster_mean(@yname, PSI)
or
genseries(yname ~ "_cm", cluster_mean(GPA, PSI))
For the latter line, if you're inside a function with input series
argument y, something like:
genseries(argname(y) ~ "_cm", cluster_mean(y, PSI))
We tend to discourage string substitution unless really necessary, but
it's official syntax and sometimes more intuitive.
Without providing a name if i run the script, a new window with ?
grand_mean_centered(y) is opening.
Sorry, I don't understand what you did here.
-s