## Logistic Regression

Logistic Regression is a statistical method that determine a dataset in which there are one or more independent variables.

The aim of Logistic regression is to find the best fitting model to describe the relationship between dichotomous dependent variable and several independent variables.

Ordinal logistic regression deals with dependent variables that are ordered.

If we use linear regression to model a dichotomous variable (as

Lets us first discuss some basic terminologies that will be used in further ♘

odd = p ∕ (1-p) ; probability of occurring / probability of not occurring

Odd Ratio is a relative measure of effect, it gives the comparison of the group in the study to the other group available.

To see a very good example of Odd Ratio Click the link below ¬

https://stats.idre.ucla.edu/stata/faq/how-do-i-interpret-odds-ratios-in-logistic-regression/

The goal of Logistic Regression is to estimate p for a linear combination of the independent variable. Now we need a function that connects to the linear combination of independent variables to the dichotomous dependent variable 🤔 . Yes it it "logit"

Therefore, ln(odd) = ln(p/1-p)

logit(p) = ln(p) - ln(1-p)

Now the antilog of of "logit" function is used to find the estimated regression equation

**In logistic regression, the dependent variable is binary or dichotomous i.e binary outcome eg. Pass or Fail.**Example: Probability of passing an exam versus hours of studies.The aim of Logistic regression is to find the best fitting model to describe the relationship between dichotomous dependent variable and several independent variables.

Ordinal logistic regression deals with dependent variables that are ordered.

If we use linear regression to model a dichotomous variable (as

*Y*), the resulting model might not restrict the predicted*Y**s*within 0 and 1.Lets us first discuss some basic terminologies that will be used in further ♘

odd = p ∕ (1-p) ; probability of occurring / probability of not occurring

Odd Ratio is a relative measure of effect, it gives the comparison of the group in the study to the other group available.

To see a very good example of Odd Ratio Click the link below ¬

https://stats.idre.ucla.edu/stata/faq/how-do-i-interpret-odds-ratios-in-logistic-regression/

The goal of Logistic Regression is to estimate p for a linear combination of the independent variable. Now we need a function that connects to the linear combination of independent variables to the dichotomous dependent variable 🤔 . Yes it it "logit"

Therefore, ln(odd) = ln(p/1-p)

logit(p) = ln(p) - ln(1-p)

Now the antilog of of "logit" function is used to find the estimated regression equation

One of a nice video explaining the concept of Logistic Regression equation is as below.

https://www.youtube.com/watch?v=NmjT1_nClzg

How to use logistic regression & how to use it for prediction purpose in R - watch the link below

https://www.youtube.com/watch?v=nubin7hq4-s

A great video that will explain along with R concepts of converting a rank or dichotomous data into factor, cross tabs, along with logistic regression glm() and predict().

https://www.youtube.com/watch?v=AVx7Wc1CQ7Y

To use logistic regression in R we use glm()

try <- glm(dep.vari~inde.var1+inde.var2+..., data= ......, family= binomial)

summary(try) # to get the complete details of the function.

to get the test data or predict the result of test data

predict(try, testingdata, type ="response") # to evaluate

https://www.youtube.com/watch?v=NmjT1_nClzg

How to use logistic regression & how to use it for prediction purpose in R - watch the link below

https://www.youtube.com/watch?v=nubin7hq4-s

A great video that will explain along with R concepts of converting a rank or dichotomous data into factor, cross tabs, along with logistic regression glm() and predict().

https://www.youtube.com/watch?v=AVx7Wc1CQ7Y

To use logistic regression in R we use glm()

try <- glm(dep.vari~inde.var1+inde.var2+..., data= ......, family= binomial)

summary(try) # to get the complete details of the function.

to get the test data or predict the result of test data

predict(try, testingdata, type ="response") # to evaluate