Hi everyone,
I am having a hard time generating deciles for a specific variable, in this case, a market share (m_share_dec), for each industry -year. I have tried several commands:
1)
xtile2 m_share_dec = m_share, nq(10) by(year industry)
-> this also gives me an error 'no observations'
2)
bysort year industry: egen m_share_dec = xtile(m_share), nq(10)
-> this one gives me an error 'too many observations'
Would anyone be able to help on this? Maybe it is possible to also use a loop or another command that would create the correct deciles .
Thanks!
I am having a hard time generating deciles for a specific variable, in this case, a market share (m_share_dec), for each industry -year. I have tried several commands:
1)
xtile2 m_share_dec = m_share, nq(10) by(year industry)
-> this also gives me an error 'no observations'
2)
bysort year industry: egen m_share_dec = xtile(m_share), nq(10)
-> this one gives me an error 'too many observations'
Would anyone be able to help on this? Maybe it is possible to also use a loop or another command that would create the correct deciles .
Thanks!
Comment