Statalist The Stata Listserver

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

st: running regs for subsamples

From   Marcello Pagano <>
Subject   st: running regs for subsamples
Date   Tue, 08 Aug 2006 10:09:17 -0400

From: Kit Baum <>
Date: August 8, 2006 8:49:02 AM EDT
Subject: running regs for subsamples

Shams asked about running regressions for data LT//GE annual median values of a variable in panel data.

webuse grunfeld, clear
egen medinv = median(invest), by(year)
g lowinv = (invest < medinv)
bys lowinv: reg invest mvalue kstock
bys lowinv: xtreg invest mvalue kstock, fe

Kit Baum, Boston College Economics
An Introduction to Modern Econometrics Using Stata:
* For searches and help try:

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