Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: by with multiple commands


From   "Henrik Andersson" <[email protected]>
To   <[email protected]>
Subject   st: by with multiple commands
Date   Fri, 2 May 2008 16:39:31 +0200

Hi,

I need to run identical regressions for different subsamples of my data
set. I have one variable that defines the different subsamples and I
would like to use this variable together with the "by" command. My
problem is that my regressions contain several command.

My regressions, together with my "post estimation" commands, look like

probit yes lnbid lninc if bid<=income 
wtpcikr lnbid lninc if bid<=income, mym(mean1) expo
matrix b=e(b)
matrix beta=b/-b[1,1]
matrix v=e(V)/(b[1,1]^2)
ereturn post beta v, noclear
ereturn display
scalar sigma=1/-b[1,1]
display sigma

Using my variable that defines the different subsamples, I would like to
run the string of commands above for each subsample. Is this possible
using the "by" command? 

Thank you 

Henrik 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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