Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regressions for each subsample of my dataset

    Hi,

    I'm new to STATA so my problem is probably pretty simple but I'm stuck:

    my data st consist of 3 variables: bloomberg, return and flow and I want to perform a mlogit on return and flow. Bloomberg serves as a group identifier.

    bysort bloomberg: mlogit return flow works perfectly fine but how can I add another command, in my case mfx to estimate marginal effects?

    bysort bloomberg: mfx... won't work since it has to be estimated after every regression (I think).

    So, is there a way to define a subsample based on my bloomberg variable and run a couple of similar commands for each group?

    Thanks in advance!

  • #2
    Yes, there are a few ways to do that. Most appealing imho is write your subsample analysis as a byable program. See help for details and example. Best, Sergiy Radyakin

    Comment


    • #3
      Code:
      levelsof bloomberg
      foreach lev in `r(levels)' {
        mlogit ... if bloomberg==`lev'
        mfx ... if bloomberg==`lev'
      }

      Comment


      • #4
        Sergiy, Elan, your hints where very helpful! Thanks a lot! I managed to do what I wanted.

        Comment

        Working...
        X