Announcement

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

  • Drop multiple variables that end the same but start different

    Hi everybody, I have a varlist with vars listed below. I want to drop all variables in starting with IyeaXun and ending with 826 dropped, but the middel numbers are different, anybody an idea how to do that?

    Thanks George

    IyeaXun__986_826 _
    IyeaXun__986_842 _
    IyeaXun__986_890 _
    IyeaXun__986_9001 _
    IyeaXun__986_9003 _
    IyeaXun__986_9004 _
    IyeaXun__986_9006 _
    IyeaXun__986_9007 _
    IyeaXun__987_36 _
    IyeaXun__987_40 _
    IyeaXun__987_58 _
    IyeaXun__987_100 _
    IyeaXun__987_124 _
    IyeaXun__987_196 _
    IyeaXun__987_200 _
    IyeaXun__987_208
    Iyeaxun__987_826

  • #2
    Sounds like

    Code:
     
    drop  IyeaXun*826
    but check first with

    Code:
     
    d  IyeaXun*826
    There are puzzling spaces in some of your variable names that are presumably spurious.

    Comment


    • #3
      Thanks, I was wondering something else as well when I run a xtscc driscoll kraay program for standard errors with fixed effects I created a dummy for the variable EU when I take out the 826 code which stands for Great Britain, and generate a new dummy for GB so I can run the regression on EU and GB separately but combined would have the same effect as just regressing EU

      So code

      xtscc lnvalue lngdp_ei EU _E* _I*, fe

      xtscc lnvalue lngdp_ei EU(all values for britain omitted) GB _E* _I*, fe

      In the latter case GB gets omitted do you happen to know why?

      thanks

      Comment


      • #4
        Best to start a new thread with an informative title. That's a better use of the forum for those who might have similar questions. While you're at it, please document as requested where a user-written program comes from.

        Comment

        Working...
        X