Hi,
I'm relatively new to STATA, and am struggling to understand a particular code that explains how covariates can be entered into crossed effects models at both levels.
xtmixed asset || _all: R.country tax || industry: size
Where 'tax' is the covariate that is specified to have a random slope for each country (country level). However, this syntax includes 'tax' at the _all: level and so doesn't really do the job. The author of this syntax has then written the following which is what I cannot understand.
tab country, gen(id_country) unab idvar: id_country* foreach v of local idvar {
gen tax_`v ́ = tax*`v ́ }
xtmixed asset || _all: R.country ||_all: tax_*, cov(identity) nocons /// || industry: size
What does the gen (id_country) syntax do? Because it is not generating a new variable in the dataset, so what is its purpose?
And also, foreach v of local idvar... code..
I've tried reading up the syntax manual for STATA but am still unable to get any clarity. Can someone explain this? Or has anyone used a similar syntax and can shed some light?
Thank you.
Ahuti
Related Posts with Crossed effects models with covariates
Two way pyramid graph using countries instead of rangeHello! I'm trying so hard to replicate a graph like this, it's some sort of a pyramid but it is not …
CEM v/s psmatch2Hi everyone, could anyone please tell me where does the algorithm of CEM and psmatch2 differ? I have…
Merging m:m - it seems to work for me. Why critise? Appreciate your feedbackAs you can see in my previous posts. I currently have one huge dataset called procedure. This shows…
Referring to local macros using unabHello statalisters, I have 227 variables that are grouped by common prefixes. I am trying to use th…
Independent Variable predicts is highly correlated with dependent variable.I will be very grateful for your help on this issue. Independent Variable (Last Birth CS) is highly …
Subscribe to:
Post Comments (Atom)
0 Response to Crossed effects models with covariates
Post a Comment