Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: including "gen" in a "by"-command


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: including "gen" in a "by"-command
Date   Thu, 5 Nov 2009 14:52:07 +0100

<> 

BTW, quite apart from the technical aspects of capturing the coefficients,
does it make sense to put the same variable into the -by- prefix and the
-group()- option? It leads to no good in this example, for one:


*************
webuse lowbirth2, clear

bys pairid: clogit low lwt smoke /* 
	*/ ptd ht ui i.race, /* 
	*/ group(pairid)
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Regina Kemmler
Gesendet: Donnerstag, 5. November 2009 10:26
An: [email protected]
Betreff: st: including "gen" in a "by"-command

Dear Statalist,

I would like to conduct a clogit seperated by each household. So far so
good. My syntax is as follows:

sort hhnr
by hhnr: clogit DV IV1 IV2, group(hhnr)

Now as I am getting the beta coefficients for each household I would like to
add them as a variable to each household. Following syntax is not really
working, it just adds the last calculated beta coefficients to all
households:

gen b1=_coef[ri]
gen b2=_coef[ri2]


Is there any possibility to include the gen command in the by command?
Your help as much appreciated.
Thanks a lot,
Regina
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


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


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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index