# st: simultaneous fixed and between effects

 From Filipa de Castro To statalist@hsphsun2.harvard.edu Subject st: simultaneous fixed and between effects Date Fri, 16 Oct 2009 10:35:23 -0500

```Dear statalisters,

I am running a model on a panel with two time points and want to
estimate simultaneously fixed effects (within) and between effects
using this sintax which follows a procedure suggested in Sophia
Rabe-Hesketh´s book on multilevel and lingitudinal modelling using
stata 2nd ed.

egen mean_bpd=mean(bpd), by(id)
egen delta_bpd= bpd-mean_bpd

xtreg dep mean_bpd  delta_bpd

By doing this, mean_bpd coefficient is the between effect and
delta_bpd is the fixed effect.

The output is :

. xtreg dep  nm_bp dev_bp

Random-effects GLS regression		    Number of obs      =	407
Group variable: subject		           Number of groups   =	270

R-sq:  within  = 0.1137		           Obs per group: min =	1
between = 0.0913		                   avg =	1.5
overall = 0.0906		                           max =	2

Random effects u_i ~ Gaussian		Wald chi2(2)       =	43.69
corr(u_i, X)       = 0 (assumed)		Prob > chi2        =	0.0000

dep           Coef.       Std. Err.	          z    P>z     [95% Conf.	Interval]

nm_bp    1.135272    .2410716		4.71   0.000     .6627809	1.607764
dev_bp    .8803003   .1789422		4.92   0.000     .5295801	1.23102
_cons      .5785817   .1756038		3.29   0.001     .2344046	.9227588

sigma_u   1.0789156
sigma_e   1.1515882
rho   .46745328   (fraction	of	variance due to u_i)

I have two questions:

1) How exactly is the nm_bp interpreted? I mean, I understand that is
the between effect subject, but not sure how to interpret it. is that
the change for "dep" in which time point? I know this may be a silly
question but it is puzzling me.
2) can the same model be run with a dichotomous dependent variable,
using xtlogit? If not, is there a way to do this?

Many thanks
Filipa

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```