Am 06.04.2026 um 19:07 schrieb Ramki S:
Hi
Is there any option to create grand mean centering of a varibale x_mc, (x_i - x_bar),
group mean (x_barj), centering within clustered variable x_cwc (x_i - x_barj). These are
necesary functions to teach mixed models. If there are not, i request you to provide.
- general centering: Add/Standardize, then choose only centering; script
function "stdize"
- Demeaning by a discrete group indicator (possibly more general than a
panel group): I'm not aware of a one-stop-shopping in the GUI here, but
one could do: Add/Dummies for discrete variables..., Model/OLS..., then
add those created dummies as regressors, estimate that model, and from
the model window save the residuals as series.
(Possibly the stdize function could be extended to allow a factorizing
variable. There also a view of factorized basic statistics like the
mean, but there I don't think it's possible to save those means to the
dataset.)
For scripting you could do the same things, using stuff like the
dummify() function, and/or aggregate() etc.
-s