SlideShare a Scribd company logo
1 of 13
Multinomial logistic
regression
Presented
by:
Amira Badr
Aya Essam
Merit Adel
Eman Abbas
Hajer Bilal
Outlines
What is it?& When
to use it?
Assumptions
Data & codes
Interpretation
Why not ?
Equation
What is it?
when to use?
?
?
It is an extension to binary logistic
regression for multinomial responses,
where the outcome categories are
more than two and unordered.
Like binary logistic regression,
multinomial logistic regression uses
maximum likelihood estimation to
evaluate the probability of categorical
membership.
Multinomial Outcome examples
01
02
03
Which blood type does a
person have, given the
results of various diagnostic
tests?
Which candidate will a
person vote for, given
particular demographic
characteristics?
Entering high school
students make program
choices among general
program, Their choice might
be modeled using their
writing score and their
social economic status.
Assumptions
01
No Multicollinearity
Multicollinearity refers
to the scenario when
two or more of the
independent variables
are substantially
correlated amongst
each other.
02
No outliers
The variables that you
care about must not
contain outliers.
Logistic Regression is
sensitive to outliers, or
data points that have
unusually large or small
values.
Assumptions
03
Independence
Each of your
observations (data
points) should be
independent. This
means that each value
of your variables doesn’t
“depend” on any of the
others.
04
Linearity
Logistic regression
assumes that the
relationship between the
natural log of these
probabilities (when
expressed as odds) and
your predictor variable
is linear.
In the context of logistic regression:
We have 2 classes: 1 vs. 0 (or A vs. B) – to develop one logistic regression
model,
So, the equation of probability is
Log (p/ (1 – p)) = e 𝛽0 + 𝛽1𝑥1 + 𝛽2𝑥2
If we have a dependent variable which consists of 3 levels; (A, B, C,), (1, 2, 3)
we will design K model
The results will be k-1
Choose C as the reference class, then (C Vs. A &B)
First model log (p (A) / p(C)) =e 𝛽01 + 𝛽1𝑥1 + 𝛽3𝑥3
PropA = 𝛽01 + 𝛽1𝑥1 + 𝛽3𝑥3
So, (p (A) / p(C)) = exp (PropA)
Second model log (p (B) / p(C)) = e 𝛽02 + 𝛽2𝑥2 + 𝛽3𝑥3
PropB = 𝛽02 + 𝛽2𝑥2 + 𝛽3𝑥3
So, (p (B) / p(C)) = exp (PropB)
Note: p(A) + p(B) + p(C) = 1
Equation
our data
Covidthreat_ph
1
4
2
5
It is the dependent
Variable.
Coded as:
0=covid is not a threat.
1=covid is a minor threat.
2=covid is major threat.
Gender
agecat covidMadeUp
3
Educationlev
Independent
Variable.
Coded as:
0=male.
1=female.
Independent
Variable.
Coded as:
0=18-29.
1=30-49
2=50-64
3=65+
Independent
Variable.
Coded as:
1=less than high school
2=high school graduate
3=some college, no degree.
4=associate’s degree
5=college graduate/some
post grad.
6=postgraduate
Independent
Variable.
Coded as:
0=not at all
1=not much
2=some
3=alot
Simple linear regression
Outcome is a continuous
variable and one
predictor.
Multiple linear regression
Outcome is a continuous
variable and more than one
predictor.
Poisson regression
outcome variable is a count
variable.
Why not?
Model<-lm(outcome~predictor)
Model<-
glm(outcome~predictor,data,
family=“poisson”)
uses R
Model<-model<-
lm(outcome~predictor1+predictor
2+……)
Binomial logistic regression
Binary outcome(0,1)
Conditional logistic regression
Matched stratified
outcome(like in case-control
study)
Ordinal logistic regression
Outcome is ordered categorical
variable
Multinomial logistic regression
Multinomial unordered outcome
(more than two categories)
Why not?
Model<-
glm(outcome~predictor,family=
“binomial”,data)
Library(survival)
Model<-
clogit(outcome~predictor,strata
(match),data)
Library(nnet)
Model<-
multinom(outcome~predictor,data)
Library(ordinal)
Model<-
clm(outcome~predictor,data,
link=“logit”)
uses R
INTERPRETATION
pseudo R square
P values
Odds ratio
DATASETS FOR PRACTICING REGRESSION
https://www.kaggle.com/code/rtatman/datasets-for-regression-
analysis/notebook
https://www.r-bloggers.com/2020/05/multinomial-logistic-regression-with-r/
https://www.youtube.com/watch?v=csqgBOgVgJ4
Other datasets:
Dataset used in the lecture:
Thank you

More Related Content

Similar to multinomial-pdf.pdf

Logistic-regression.pptx
Logistic-regression.pptxLogistic-regression.pptx
Logistic-regression.pptxsherinjoyson
 
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5Daniel Katz
 
Supervised Learning.pdf
Supervised Learning.pdfSupervised Learning.pdf
Supervised Learning.pdfgadissaassefa
 
German credit score shivaram prakash
German credit score shivaram prakashGerman credit score shivaram prakash
German credit score shivaram prakashShivaram Prakash
 
Add slides
Add slidesAdd slides
Add slidesRupa D
 
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...Predicting an Applicant Status Using Principal Component, Discriminant and Lo...
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...inventionjournals
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spssDr Nisha Arora
 
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...Estimating ambiguity preferences and perceptions in multiple prior models: Ev...
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...Nicha Tatsaneeyapan
 
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACRO
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACROBOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACRO
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACROAnthony Kilili
 
Car Accident Severity Report
Car Accident Severity ReportCar Accident Severity Report
Car Accident Severity ReportFaizan Hussain
 
Multinomial Logistic Regression.pdf
Multinomial Logistic Regression.pdfMultinomial Logistic Regression.pdf
Multinomial Logistic Regression.pdfAlemAyahu
 
Machine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperMachine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperJames by CrowdProcess
 
For this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The dFor this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The dMerrileeDelvalle969
 
linear regression PDF.pdf
linear regression PDF.pdflinear regression PDF.pdf
linear regression PDF.pdfJoshuaLau29
 
Simple Linear Regression detail explanation.pdf
Simple Linear Regression detail explanation.pdfSimple Linear Regression detail explanation.pdf
Simple Linear Regression detail explanation.pdfUVAS
 
Discrete Choice Model - Part 2
Discrete Choice Model - Part 2Discrete Choice Model - Part 2
Discrete Choice Model - Part 2Michael770443
 
Multinomial Logistic Regression Analysis
Multinomial Logistic Regression AnalysisMultinomial Logistic Regression Analysis
Multinomial Logistic Regression AnalysisHARISH Kumar H R
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2uetian12
 
Statistics - Multiple Regression and Two Way Anova
Statistics - Multiple Regression and Two Way AnovaStatistics - Multiple Regression and Two Way Anova
Statistics - Multiple Regression and Two Way AnovaNisheet Mahajan
 

Similar to multinomial-pdf.pdf (20)

Logistic-regression.pptx
Logistic-regression.pptxLogistic-regression.pptx
Logistic-regression.pptx
 
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
 
Supervised Learning.pdf
Supervised Learning.pdfSupervised Learning.pdf
Supervised Learning.pdf
 
German credit score shivaram prakash
German credit score shivaram prakashGerman credit score shivaram prakash
German credit score shivaram prakash
 
Add slides
Add slidesAdd slides
Add slides
 
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...Predicting an Applicant Status Using Principal Component, Discriminant and Lo...
Predicting an Applicant Status Using Principal Component, Discriminant and Lo...
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
 
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...Estimating ambiguity preferences and perceptions in multiple prior models: Ev...
Estimating ambiguity preferences and perceptions in multiple prior models: Ev...
 
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACRO
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACROBOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACRO
BOOTSTRAPPING TO EVALUATE RESPONSE MODELS: A SAS® MACRO
 
Car Accident Severity Report
Car Accident Severity ReportCar Accident Severity Report
Car Accident Severity Report
 
Multinomial Logistic Regression.pdf
Multinomial Logistic Regression.pdfMultinomial Logistic Regression.pdf
Multinomial Logistic Regression.pdf
 
Machine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperMachine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paper
 
For this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The dFor this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The d
 
linear regression PDF.pdf
linear regression PDF.pdflinear regression PDF.pdf
linear regression PDF.pdf
 
Simple Linear Regression detail explanation.pdf
Simple Linear Regression detail explanation.pdfSimple Linear Regression detail explanation.pdf
Simple Linear Regression detail explanation.pdf
 
1624.pptx
1624.pptx1624.pptx
1624.pptx
 
Discrete Choice Model - Part 2
Discrete Choice Model - Part 2Discrete Choice Model - Part 2
Discrete Choice Model - Part 2
 
Multinomial Logistic Regression Analysis
Multinomial Logistic Regression AnalysisMultinomial Logistic Regression Analysis
Multinomial Logistic Regression Analysis
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2
 
Statistics - Multiple Regression and Two Way Anova
Statistics - Multiple Regression and Two Way AnovaStatistics - Multiple Regression and Two Way Anova
Statistics - Multiple Regression and Two Way Anova
 

Recently uploaded

VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad EscortsCall girls in Ahmedabad High profile
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 

Recently uploaded (20)

VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 

multinomial-pdf.pdf

  • 1. Multinomial logistic regression Presented by: Amira Badr Aya Essam Merit Adel Eman Abbas Hajer Bilal
  • 2. Outlines What is it?& When to use it? Assumptions Data & codes Interpretation Why not ? Equation
  • 3. What is it? when to use? ? ? It is an extension to binary logistic regression for multinomial responses, where the outcome categories are more than two and unordered. Like binary logistic regression, multinomial logistic regression uses maximum likelihood estimation to evaluate the probability of categorical membership.
  • 4. Multinomial Outcome examples 01 02 03 Which blood type does a person have, given the results of various diagnostic tests? Which candidate will a person vote for, given particular demographic characteristics? Entering high school students make program choices among general program, Their choice might be modeled using their writing score and their social economic status.
  • 5. Assumptions 01 No Multicollinearity Multicollinearity refers to the scenario when two or more of the independent variables are substantially correlated amongst each other. 02 No outliers The variables that you care about must not contain outliers. Logistic Regression is sensitive to outliers, or data points that have unusually large or small values.
  • 6. Assumptions 03 Independence Each of your observations (data points) should be independent. This means that each value of your variables doesn’t “depend” on any of the others. 04 Linearity Logistic regression assumes that the relationship between the natural log of these probabilities (when expressed as odds) and your predictor variable is linear.
  • 7. In the context of logistic regression: We have 2 classes: 1 vs. 0 (or A vs. B) – to develop one logistic regression model, So, the equation of probability is Log (p/ (1 – p)) = e 𝛽0 + 𝛽1𝑥1 + 𝛽2𝑥2 If we have a dependent variable which consists of 3 levels; (A, B, C,), (1, 2, 3) we will design K model The results will be k-1 Choose C as the reference class, then (C Vs. A &B) First model log (p (A) / p(C)) =e 𝛽01 + 𝛽1𝑥1 + 𝛽3𝑥3 PropA = 𝛽01 + 𝛽1𝑥1 + 𝛽3𝑥3 So, (p (A) / p(C)) = exp (PropA) Second model log (p (B) / p(C)) = e 𝛽02 + 𝛽2𝑥2 + 𝛽3𝑥3 PropB = 𝛽02 + 𝛽2𝑥2 + 𝛽3𝑥3 So, (p (B) / p(C)) = exp (PropB) Note: p(A) + p(B) + p(C) = 1 Equation
  • 8. our data Covidthreat_ph 1 4 2 5 It is the dependent Variable. Coded as: 0=covid is not a threat. 1=covid is a minor threat. 2=covid is major threat. Gender agecat covidMadeUp 3 Educationlev Independent Variable. Coded as: 0=male. 1=female. Independent Variable. Coded as: 0=18-29. 1=30-49 2=50-64 3=65+ Independent Variable. Coded as: 1=less than high school 2=high school graduate 3=some college, no degree. 4=associate’s degree 5=college graduate/some post grad. 6=postgraduate Independent Variable. Coded as: 0=not at all 1=not much 2=some 3=alot
  • 9. Simple linear regression Outcome is a continuous variable and one predictor. Multiple linear regression Outcome is a continuous variable and more than one predictor. Poisson regression outcome variable is a count variable. Why not? Model<-lm(outcome~predictor) Model<- glm(outcome~predictor,data, family=“poisson”) uses R Model<-model<- lm(outcome~predictor1+predictor 2+……)
  • 10. Binomial logistic regression Binary outcome(0,1) Conditional logistic regression Matched stratified outcome(like in case-control study) Ordinal logistic regression Outcome is ordered categorical variable Multinomial logistic regression Multinomial unordered outcome (more than two categories) Why not? Model<- glm(outcome~predictor,family= “binomial”,data) Library(survival) Model<- clogit(outcome~predictor,strata (match),data) Library(nnet) Model<- multinom(outcome~predictor,data) Library(ordinal) Model<- clm(outcome~predictor,data, link=“logit”) uses R
  • 11. INTERPRETATION pseudo R square P values Odds ratio
  • 12. DATASETS FOR PRACTICING REGRESSION https://www.kaggle.com/code/rtatman/datasets-for-regression- analysis/notebook https://www.r-bloggers.com/2020/05/multinomial-logistic-regression-with-r/ https://www.youtube.com/watch?v=csqgBOgVgJ4 Other datasets: Dataset used in the lecture: