Multinomial Logistic Regression with R | 2. Final Model and Interpretation

  Рет қаралды 22,709

Dr. Bharatendra Rai

Dr. Bharatendra Rai

Күн бұрын

Provides steps for applying multinomial logistic regression model with R. Goes over steps to arrive at final model by carrying out 2-tail z-test and provides interpretation of the model.
Previous video: • Multinomial Logistic R...
Next video - • Multinomial Logistic R...
TIMESTAMP
00:00 Introduction
00:20 Finalizing the model, two-tail z-test, p-value
05:14 Interpretation
05:55 Equations for predicting probability
Time-Series videos: goo.gl/FLztxt
Machine Learning videos: goo.gl/WHHqWP
Becoming Data Scientist: goo.gl/JWyyQc
Introductory R Videos: goo.gl/NZ55SJ
Deep Learning with TensorFlow: goo.gl/5VtSuC
Image Analysis & Classification: goo.gl/Md3fMi
Text mining: goo.gl/7FJGmd
Data Visualization: goo.gl/Q7Q2A8
Playlist: goo.gl/iwbhnE
R is a free software environment for statistical computing and graphics, and is widely used by both academia and industry. R software works on both Windows and Mac-OS. It was ranked no. 1 in a KDnuggets poll on top languages for analytics, data mining, and data science. RStudio is a user friendly environment for R that has become popular.

Пікірлер: 59
@ezhaque
@ezhaque 4 жыл бұрын
Your videos are great! Well described, easy to follow, and good quality. Thanks!
@bkrai
@bkrai 4 жыл бұрын
Thanks for comments!
@dexterrity
@dexterrity 4 жыл бұрын
Thanks for this series, looking forward to the next video
@bkrai
@bkrai 4 жыл бұрын
Thanks, it will be up soon.
@flamboyantperson5936
@flamboyantperson5936 4 жыл бұрын
Good to see you back Sir
@bkrai
@bkrai 4 жыл бұрын
Thanks for comments!
@sebastianvarela2190
@sebastianvarela2190 4 жыл бұрын
very good explanation!
@bkrai
@bkrai 4 жыл бұрын
Thanks for comments!
@oihaneelenaalbonigadiez9511
@oihaneelenaalbonigadiez9511 Жыл бұрын
Hi. Thanks a lot for this video. It helps me a lot but I have a question related to p-vales. I have 14 variables + the dependent variable (3 groups). When I run the model for the first time I only get 1 significant variable. Then, I removed all non-significant variables as you told in your video and re-run z test. In this last, after p-value calculation the previous significant variable has a p-value > than 0.05 (now is not significant). Does this make sense? Should I change to other regression model?. Thanks in advance.
@steveurkel9410
@steveurkel9410 3 жыл бұрын
Sir, what about the chi sqaured and the pseudo r test ?
@pshani3512
@pshani3512 3 жыл бұрын
These series have been very very useful for me Sir... Thank you so much! May I ask you, how can we get confidence intervals?
@bkrai
@bkrai 3 жыл бұрын
Here we use metrics such as accuracy, sensitivity, specificity, etc.
@pshani3512
@pshani3512 3 жыл бұрын
@@bkrai Thank you, Sir !!!
@manikandankrishnakumar5430
@manikandankrishnakumar5430 4 жыл бұрын
Thanks
@bkrai
@bkrai 4 жыл бұрын
Welcome!
@annaboffa7330
@annaboffa7330 Жыл бұрын
Thanks for your video. The variables in my dataset are almost all categorical variables. Following your video I get each level of category as it's own variable (in the same manner yours did with Gender), but when I run the 2 tailed Z test, it doesn't rule out any of the variables (and now there are several hundred as a result of the original 13 variables being split into each of their levels. Is there an alternative test I should use?
@bkrai
@bkrai Жыл бұрын
I think tree based methods will work better with such data. You can refer to this: kzbin.info/www/bejne/nnSvfICfj6eHqLc
@debasishmishra1493
@debasishmishra1493 4 жыл бұрын
Sir..what if we get 0 as p values for every predictor in the initial model? Does that imply, every variable is significant? Just like the predictors UC, DL, DS, DP in your example
@bkrai
@bkrai 4 жыл бұрын
Yes if p is zero, the variable is significant.
@LLFRA
@LLFRA 3 жыл бұрын
when trying to display the standard errors using summary(mymodel)$standarderrors i get the folllowing error Warning message in sqrt(diag(vc)): “NaNs produced” NULL as a consequence i cant get the pvalues. thanks in advance
@sophielong8937
@sophielong8937 3 жыл бұрын
Hi, is it possible to get the p value for the categorical variable "1", i can see in the results (at 2.49) that there are only results for "2 and 3" is there a way to get the p value for 1?
@bkrai
@bkrai 3 жыл бұрын
Note that when you see results for '2', it is with reference to '1'. Same thing applies to '3'.
@dhanielaritonang3273
@dhanielaritonang3273 4 жыл бұрын
Sir can you explain the physical meaning of the intercept value in 2 tailed z-test, I mean in each variables we have different intercept for 2 (Suspect) and 3 (Pathologic) and what is the relation of those to the 1 (Normal), in simple words. Thanks!
@bkrai
@bkrai 4 жыл бұрын
It is log-odds of x1, x2, x3, .... = 0.
@harishnagpal21
@harishnagpal21 4 жыл бұрын
I have one query here. Here we used 2 tail z test to remove the variables. What if we also have categorical variables. For categorical variables, I believe it creates sum variables also by adding _1, _2 etc to categorical variables. How we will remove such variables! Thanks
@bkrai
@bkrai 4 жыл бұрын
When you remove the main variable, those dummy variables will automatically be removed.
@ezechielamoussou7409
@ezechielamoussou7409 2 жыл бұрын
Hello Sir. I'm following your procedure and running a multinomial logistic regression. The problem is that my dependent variable is a factor with 6 levels. After doing the 2 tailed Z test, how will a know which variables are significant?
@bkrai
@bkrai 2 жыл бұрын
The way it was done in this example for response at 3 levels, you can use the same process. In your example, you will have 5 p-values for each variable and even if one of them is significant, that variable can be treated significant.
@rionaghdevine3688
@rionaghdevine3688 3 жыл бұрын
Hi there, I''m just wondering about exponentiating the coefficients to convert them to odds ratios? Is this a necessary step, or just something additional to make interpretation easier?
@bkrai
@bkrai 3 жыл бұрын
It's just for interpretation.
@rionaghdevine3688
@rionaghdevine3688 3 жыл бұрын
Dr. Bharatendra Rai ahh I see, thank you!
@bkrai
@bkrai 3 жыл бұрын
You are welcome!
@paulohenriquecamargo1335
@paulohenriquecamargo1335 4 жыл бұрын
Thanks for your video, but I have a question. Do you know how I can add a random effect to the model? It seems that the net package does not work with random effects. Thank you
@shoumicshahid9315
@shoumicshahid9315 4 жыл бұрын
Exactly my problem. Please leave a comment if you have found one.
@bkrai
@bkrai 4 жыл бұрын
I've added it to my list.
@paulohenriquecamargo1335
@paulohenriquecamargo1335 4 жыл бұрын
​@@shoumicshahid9315I managed to include a random effect in a Bayesian model. I used the rstan package. If you have a little knowledge of Bayesian statistics, it's reasonably easy to use the package and configure the model. Best regards
@paulohenriquecamargo1335
@paulohenriquecamargo1335 4 жыл бұрын
@@bkrai I was able to include a random effect using a Bayesian model, but it would be nice to learn how to include a random effect in a frequentist model. If you can prepare a video, I’ll be very grateful. Best regards.
@deprofundis3293
@deprofundis3293 3 жыл бұрын
@@bkrai For the record, I'm interested in being able to include a random effect in a multinomial model as well! :)
@deprofundis3293
@deprofundis3293 3 жыл бұрын
Thank you for the wonderful tutorial! I have a problem, though, and would love your input because much googling has not helped yet. I have far too many variables for my dataset. I was hoping that the p-values of this multinomial model would inform me on which to drop, but because I put in too many (I know I'm overfitting), very few were significant. Variables that came out significant consistently in univariate and other tests (and appear to be very important when looking at graphs of means with 95% CIs) are NOT significant in the overfit/full multinomial model. My questions are this: (1) How much of this issue of non-significance could be due to which category I set as the "reference" variable? I don't like that I can't compare each level against all others...my gut is to lump so I can do a binomial logistic regression and/or univariate analysis, but it's not as elegant. (2) I have quite a few correlated variables. I intend to use VIF to remove some, but I still need criteria for which one to include if, e.g., 2 are correlated, given that I know the full model with all variables is not accurate, given my relatively small sample size. I understand the issues with forward stepwise regression, but I can't seem to find an alternative solution to easily cut back on the # of variables (without losing interpretability). I can't depend too heavily on the literature for a priori hypotheses because what I'm looking at is novel enough to have very little literature to support it. I collected each variable deliberately, but yes, there are a lot (and many of my IVs are quite specific and/or nested/multilevel). Thank you so much for any guidance you can provide!
@bkrai
@bkrai 3 жыл бұрын
I would suggest narrowing down on IVs using feature selection: kzbin.info/www/bejne/jHalkqtojLKVe6M
@deprofundis3293
@deprofundis3293 3 жыл бұрын
@@bkrai Thank you!!!
@bkrai
@bkrai 3 жыл бұрын
You are welcome!
@saminba9111
@saminba9111 3 жыл бұрын
Thank you for the video,i just have a question when removing variables form the model which are not significant,you just simply remove them,but my independent variables are categorial,for some of them p value is less than 0.05 and for others are significant,for example job has 8 categories,for two of them is not significant,should i completely remove job in my model?
@bkrai
@bkrai 3 жыл бұрын
Even if one of them is significant, keep the variable in the model.
@saminba9111
@saminba9111 3 жыл бұрын
@@bkrai thanks a lot,i am a new PhD student, just started 2 months ago, these videos helped me more than every texts,
@bkrai
@bkrai 3 жыл бұрын
Thanks for comments!
@shoumicshahid9315
@shoumicshahid9315 4 жыл бұрын
Hello Professor, I wanted to use Multinomial Logistic Regression with Random Effects. Can you please suggest me how to implement it?
@bkrai
@bkrai 4 жыл бұрын
I've added it to my list for future.
@shoumicshahid9315
@shoumicshahid9315 4 жыл бұрын
@@bkrai Thank you Professor. Looking forward to it.
@sandeepreddy8567
@sandeepreddy8567 4 жыл бұрын
@@shoumicshahid9315 did he make the video ?
@shoumicshahid9315
@shoumicshahid9315 4 жыл бұрын
@@sandeepreddy8567 I still did not find any video about this
@bkrai
@bkrai 4 жыл бұрын
Not yet!
@charanlobo2981
@charanlobo2981 4 жыл бұрын
Sir, what if the p value is exactly zero
@bkrai
@bkrai 4 жыл бұрын
When values are very low it may report as zero.
@eniolashittu6825
@eniolashittu6825 4 жыл бұрын
what if the Z stats and P value command does not work , is there another way to get the P values for the multinominal logistic regression? Thanks
@bkrai
@bkrai 4 жыл бұрын
They will work fine as they are just calculations and are not using any package.
@eniolashittu6825
@eniolashittu6825 4 жыл бұрын
@@bkrai when i ran the command it did not work, do you have any suggestion of what to do, as i need to find the Pvalue for the multinominal logistic regression? Thanks
Logistic Regression in R, Clearly Explained!!!!
17:15
StatQuest with Josh Starmer
Рет қаралды 512 М.
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 36 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 16 МЛН
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 5 МЛН
Multinomial Logistic Regression with R | 4. Prediction & Model Assessment
8:04
Multinomial Logistic Regression with R | 1. Data and Model
6:18
Dr. Bharatendra Rai
Рет қаралды 31 М.
Binary logistic regression using R: Analysis and interpretation
27:55
Chapter 13 Video 12 - Multinomial Logit Model in R
19:36
Quantitative Social Science Data Analysis
Рет қаралды 2,5 М.
Understanding Generalized Linear Models (Logistic, Poisson, etc.)
20:19
Logistic Regression with R: Categorical Response Variable at Two Levels (2018)
19:47
Introduction to Ordinal Regression
16:06
DrGreggHarbaugh
Рет қаралды 44 М.
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН