i'm trying to model the linear relation in a panek of continuous indep var X on continuous dep var Y, across intervals of another variable Z collapsed into categorical bins Zcat. my data are xtset with i (1-400) and t(1-48) with about 5% missings, using xtreg random model..
i have:
Code:
xtreg Y c.X ## i.Zcat
margins i.Zcat, dydx(X)
this shows me the slope within each level of Zcat as , along with se, ci, z and p.
what i would like also to see is some indicator like correlation coefficient for the relaitonship within each level. using "margins, post" and "ereturn, list" i could not see anything likely.

is there a formula to derive a correlatiion-coefficient-like statistic from the stored results, or an expression for the margins command to generate something similar?
thnak you in advance.