Stata Tutorial: Dealing with Dummy Variables

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • How to create dummy variables in Stata, and a short review of how to interpret estimated dummy coefficients in a multiple linear regression model.
    Creating dummy variables using 'encode' from text/string source variable:
    • Stata Tutorial: Encode...
    Slope-dummy and interaction effects:
    • Slope-dummy and Intera...
    Link to "Gentle Introduction to Stata"
    www.amazon.com...
    Link to the excellent Introduction to Econometrics Textbook by AH Studenmund:
    www.amazon.com...
    Link to Jeffrey Wooldridge Introductory Econometrics Textbook:
    www.amazon.com...
    My Twitter is:
    / michaelrjonas
    My Google Scholar Page:
    scholar.google...
    ResearchGate:
    www.researchga...

Комментарии • 33

  • @rjyuan7428
    @rjyuan7428 4 года назад

    Amazing! Works better than defining the variable in one command

  • @surenperera7010
    @surenperera7010 Год назад

    Hey Mike. Thanks a lot for the well explanation.

  • @AI_Masterpiece_
    @AI_Masterpiece_ 2 года назад

    Very helpful! Thank you very much. Have a great day!

  • @user-ox6fh1jc3x
    @user-ox6fh1jc3x 2 года назад +2

    Thank you Mike, you did a good job

  • @scotthu9833
    @scotthu9833 4 года назад

    Another great video Mike! But for the first method you introduced, I do not suggest using it because it might cause some problems if there are missing values in the variable lotsize.

  • @user-yj4vl3px4m
    @user-yj4vl3px4m 4 года назад +1

    thanks ,
    clear , simple & interesting

  • @Just_Another
    @Just_Another 3 года назад +2

    Hey Mike, congrats on your great work! One question: how do I compute p-value for the omitted dummy variable? Thanks

  • @dr.shumailameerperhiar1091
    @dr.shumailameerperhiar1091 3 года назад

    BEAUTIFUL VIDEO

  • @nursesofyaalqahtaniy7424
    @nursesofyaalqahtaniy7424 3 года назад

    Thank you for this well explained video my question is how many observation minimally needed per each dummy variable ?

  • @11Samyo
    @11Samyo 4 года назад +1

    Hey Mike, say you were testing whether the number of bedrooms have a higher return in colonial
    areas than in non-colonial ones, how would you do this? Is there a video for this?

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  4 года назад

      You will need to create a slope-dummy variable that interacts 'bedrooms' with the colonial style dummy. Here is the video:ruclips.net/video/Qc9IrsbZVww/видео.html
      Hope that helps!

  • @afaturo
    @afaturo 5 лет назад +1

    Halo Mike..this is Fatur from Indonesia. I love your tutorial...How to make dummies with many categories? i.e. Primary school=1 juniorhigh=2 seniorhigh=3 etc.?

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  5 лет назад

      Hello Fatur. If you have a categorical variable such as "education" that takes on a value of 1=primary, 2=junior high, etc; then you can use the factor variable expansion option in Stata. for example: xi:reg y i.education
      will estimate the regression with m-1 dummy variables if your education variable has m categories. type "help xi" in stata for more info.

  • @kaizoku4life
    @kaizoku4life 3 года назад

    thanks

  • @suzanacvijanovic5011
    @suzanacvijanovic5011 Год назад

    Hey Mike, you are super! Can you help me? I need serie of volatility for gdp and inflation rate?I 'm working on my phd disertation.

  • @adelez9856
    @adelez9856 4 года назад

    Hi, Thank you for the video, but here 9010 is an integer, can we do it also to the string?

  • @chiaragaribaldi6297
    @chiaragaribaldi6297 4 года назад

    Hi Mike, do you know how the interpretation would change if I have a log-log function?
    Cobb Douglas linearised? Thank you!!

  • @sudhakarmarri6027
    @sudhakarmarri6027 3 года назад

    Sir, I have a dataset in stata which has a string variable having names i want to list only those names which starts or contains a particular characters. Please help me out with the command
    My question in brief sir .. for example I have a dataset with two variables one string variable and another numeric variable i.e., name and age if i want to list people who are under age of 10 , the command is like list if age < 10 simply stata list out the data, but i want to list out the only people who's names are starting with "S" or a part of name with "ra"..
    Usually in mysql we write this command
    select * from xxxx where name like "S%" or name like "%ran%"
    Which is very simple... but i couldn't get in stata.. Please help me out.. Thank You Sir

  • @Angie-wc1bu
    @Angie-wc1bu 2 года назад

    Thanks for this video Mike. In my regression result, the dummy variable has been omitted due to collinearity - please how can this be fixed? Thank you once again.

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  2 года назад

      I would have to see the data to tell for sure, but this can happen when multiple dummy variables are used: the treatment/control groups may perfectly overlap. Check the correlation coefficients among all of your variables for perfect correlations.

    • @Angie-wc1bu
      @Angie-wc1bu 2 года назад

      @@mikejonaseconometrics1886 Thanks very much Mike for your quick and kind revert. My dependent variable is the gini coefficient and my independent variable is the fiscal adjustment size (scaled in GDP) and the dummy (the slope of the adjustment size) corresponds to 1 for years in which fiscal adjustments were implemented and 0 otherwise. I haven't yet introduced any control variables nor factored yet for country and fixed effects. Please what do you think could be wrong? Thank you so very much.

    • @pietislekker
      @pietislekker 2 года назад

      @@Angie-wc1bu Hey have you found a solution to this? I have the same issue..

    • @Angie-wc1bu
      @Angie-wc1bu 2 года назад

      @@pietislekker No I haven't.

  • @point4496
    @point4496 2 года назад

    ive created dummy variables for different years, gen y18=0, replace y18=1 if Year==2018. done that for 3 different years but when i add them to my regression y20 comes out as omitted

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  2 года назад

      You must omit one of the dummy variables to avoid perfect multicolinearity. In general, if you have m categories, use m-1 dummy variables. The omitted category becomes the baseline.

    • @point4496
      @point4496 2 года назад

      @@mikejonaseconometrics1886 yeah i forgot that i have to use one year as the base. Thank you

  • @dayaniisaiahpaul245
    @dayaniisaiahpaul245 2 года назад

    I have an enquiry about dummy verable so please help nd how can I contact you

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  2 года назад

      Hi, you can email me at mrjonas@usfca.edu. Let me know your question and I’ll see if I can help.

  • @ninapavlopoulos3697
    @ninapavlopoulos3697 2 года назад

    THANK YOU SO MUCH SIR JESUS WAS BORN TODAY