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

st: by with multiple commands

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


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 


*   For searches and help try:

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