Regression analysis on categorical variable in Python

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • Python is an exceptional tool in determining the statistical relationship between independent categorical variable in multiple regression analysis

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

  • @chisomanagbakwu2507
    @chisomanagbakwu2507 2 года назад +7

    Thank you for this. How can one handle multiple categorical variables? For e.g. If you have more than one column of categorical variable with some of them having more than 2 possible results e.g size: large, medium and small, how do I handle this? I used the get.dummies function to convert to binary but I'm now stuck

    • @obiriyeboah7515
      @obiriyeboah7515 Год назад +3

      df= pd.get_dummies(df, columns=['var1','var2','var3',....'varn'],
      prefix='', prefix_sep='')

      df.head()

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

      did you solved it ?

  • @papaorgen4224
    @papaorgen4224 2 года назад +1

    well and simply done!

  • @heartbrokendra
    @heartbrokendra 3 года назад +1

    SO helpful

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

    P-value for female variable indicates that it is not significant for a model (since it is 0.39, but the significance level is usually 0.05)

  • @_peeyush
    @_peeyush 3 года назад +1

    Thank you so much!

  • @anvekshakatiyar1507
    @anvekshakatiyar1507 2 года назад +2

    Last code is not running

  • @ShubhamSingh-tu9nk
    @ShubhamSingh-tu9nk Год назад

    Hey, I have more than two variables such as material_con, material_timber, material_others, Design_slab,Design_flat,Design_rec but there is an error after dropping the data can you help here do you have any video on more than 2 variable??

  • @ShubhamSingh-tu9nk
    @ShubhamSingh-tu9nk Год назад

    even the ols giving error saying variable required

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

    thanks man

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

    Isn't male and female binary data and wouldn't be a logistic regression model be better?

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

      Don't think so since the output of a logistic model would be a categorical variable. So since you are predicting price this can't use logistic regression.