Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: problem with factor variables in RE probit

 From Richard Williams To statalist@hsphsun2.harvard.edu Subject Re: st: problem with factor variables in RE probit Date Tue, 27 Sep 2011 10:29:32 -0400

```At 07:41 AM 9/27/2011, Liberini, Federica wrote:
```
```Dear listers,

I am having problems using the factor variables in a RE probit model.

My "group" variable is a categorical that can take up to 3 different
values. My "X" variable is a continuous.
What I did was to compare two regressions:

tab group, gen(group)
gen gr1_x=group1*x
gen gr2_x=group2*x

xtprobit y x group1 group2 gr1_x gr2_x xbar zbar, re

compared to

xtprobit y b3.group##c.x xbar zbar, re

(the xbar and zbar variables are for the RE specification)

Now, before running the two regressions I made sure that the virtual
variables generated by b3.group##c.x were identical to the varlist x
group1 group2 gr1_x gr2_x . I did this by typing

list x group1 group2 gr1_x gr2_x  b3.group##c.x in 1/100

and they were!

So why is that the two regression command return different outcomes?
```
```
```
You don't say how the outcomes are different. Are the fits identical but the parameterizations are different? Personally, I tend to avoid the ## notation and just try to write things the same way I would if I had separate variables. That way I feel more sure of what I am asking for. So, I would rewrite your first command as
```
xtprobit y x b3.group b3.group#c.x xbar zbar, re

```
If that doesn't work then provide more detail as to how the results are different.
```

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   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/
```