Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65099

generate a dummy variable using gen

$
0
0
Dear Statalisters,

This might be a foolish question.

I was using

Code:
bysort year industry: egen med_hhi=median (hhi_sic3)
* generate for each industry year group, the median ratio of hhi_sic3 - which is a industry herfindahl index used to measure competition

* step 2
* generate dummy to indicate if a firm's own herfindahl index is below its industry's median ratio
gen comp_dum=(hhi_sic3<hhi_med)
I have non-missing values for both hhi_sic3, hhi_med, but why I get all zero from step 2 for comp_dum. It must be a logical error.

i think i know why I was wrong. Never mind !

Sincerely,
Rochelle


Viewing all articles
Browse latest Browse all 65099

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>