Uncentred covariate

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
coopsrct
Posts: 1
Joined: Mon Nov 30, 2015 2:56 pm

Uncentred covariate

Post by coopsrct »

When using MLwiN, you can choose whether a continuous covariate is uncentred, centred at grand mean, centred around a value or by groups. How can you set this when using runmlwin in STATA especially when you want the covariate to be uncentred?

Thanks
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Uncentred covariate

Post by GeorgeLeckie »

Dear coopsrct,

We have not implemented this functionality in the runmlwin command. We note that it is also not implemented in Stata's own commands. In Stata you have to manually centre your covariates (by generating new variables) prior to including them in a model.

Consider covariate x

We can centre x around a specific value 17 as follows

. generate xdev1 = x - 17

We can grand mean centre x as follows

. summarize x

. generate xmn2 = r(mean)

. generate xdev2 = x - xmn2

We can group mean centre x as follows

. bysort cluster: egen xmn3 = mean(x)

. generate xdev3 = x - xmn3

Best wishes

George
Post Reply