Announcement

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

  • Create subsamples to run regressions

    Dear Stata-community,

    I am running a regression on an unabalanced panel data set. I have used the BIC estimator by Hastie, Tibshirani, and Freidman (2001), to specify the variables. In order to complete this specification I need to test the coefficients on subsamples. So far could not find out how to create thos subsamples with stata and following how to regress with these subsamples.
    Can anyone help me out, please?
    Thanks,
    Kaspar

  • #2
    The if condition in a regression command would restrict this regression on the subsample that satisfies this condition.

    So you simply have to manage to create a dummy variable that identifies your subsample, and then regress with this if condition.
    Example, if z==1 identifies your subsample :
    Code:
    reg y x1 x2 x3 if z==1

    Comment


    • #3
      It is not clear how you want to do your subsampling. If you want a random sample where you keep all the records for a panel, do -findit sample2- and see if it meets your needs.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment

      Working...
      X