Changing reference category in glm

#1
Hello!

I'm trying to change reference category in a glm model in Stata.
If I use:

char sex[omit] 2
xi: glm d i.fup i.sex, fam(pois) link(rs d_star) lnoff(y) eform
char sex[omit]

it works fine but, if I use only

char sex[omit] 2
glm d i.fup i.sex, fam(pois) link(rs d_star) lnoff(y) eform
char sex[omit]

it doesn't work. I don't to use xi because for interactions it causes some problems when using #.
Can anyone help me with this?

Thanks,
Luis
 

bukharin

RoboStataRaptor
#2
It sounds like you're using Stata 11.

See -help fvvarlist- and the related User's Guide entry.

Try:
Code:
glm d i.fup ib2.sex, fam(pois) link(rs d_star) lnoff(y) eform
-or-
fvset base 2 sex
glm d i.fup i.sex, fam(pois) link(rs d_star) lnoff(y) eform
More to the point, I would think that sex should be a dummy variable (eg 0 = female, 1 = male). Then you wouldn't even need to worry about using the i. prefix.
 
#3
Thank you very much for the reply.
It worked.
And yes, I'm using Stata 11.1.
For the sex variable, indeed I don't need to use the i. prefix, but I had the same problem with other categorical variables.

Thanks,
Luis