пятница, 16 августа 2019 г.

Logistic Regression output interpretation in R, Analytics Data Exploration

Logistic Regression output interpretation in R. Introduction. This is for you if you are looking for interpretation of p-value,coefficient estimates,odds ratio,logit score and how to find the final probability from logit score in logistic regression in R. Let’s begin !! For Best Course on Data Science Developed by Data Scientist ,please follow the below link to avail discount. https://www.udemy.com/machine-learning-using-r/?couponCode=DATA_MASTER. Importing libraries,Reading Data & Looking at Data. Importing the required libraries.MASS is used for importing birthwt dataset. Model fitting & Model Summary. Now we will fit the logistic regression model using only two continuous variables as independent variables i.e age and lwt. Basic Maths of Logistic Regression. We must know odds-ratio and logit score in order to understand logistic regression. What is Odds Ratio. It represents the odds that an outcome will occur given a particular exposure, compared to the odds of the outcome occurring in the absence of that exposure. Formula for Odds ratio. The mathematical formula for odds ratio is given by: Odds=probability of success(p)/ probability of failure =probability of (target variable=1)/probability of (target variable=0) =p/(1-p) Formula for logit. The logit score can defined as follows: logit(p) = log(p/(1-p)) = b0 + b1*x1 + … + bk*xk. Probability Calculation. Let’s follow the steps as below to find the probability of getting “low=1” (i.e probability of getting success). NOTE: Do not confuse p-value with probability.They are different things. Intercept Coefficients interpretation (b0, b1 and b2) 1. Intercept Coefficient(b0)=1.748773 2. lwt coefficient(b1) =-0.012775 Interpretation: The increase in logit score per unit increase in weight(lwt) is -0.012775 age coefficient(b2) =-0.039788. Interpretation: The increase in logit score per unit increase in age is -0.039788. p-value interpretation. 3. p-value for lwt variable=0.0397 Interpretation: According to z-test,p-value is 0.0397 which is comparatively low which implies its unlikely that there is “no relation” between lwt and target variable i.e low.Star next to p-value in the summary shows that lwt is significant variable in predicting low variable. 4. p-value for age=0.2178 Interpretation: According to z-test,p-value is 0.2178 which is comparatively high which implies its unlikely that there is “any relation” between age and target variable i.e low. Logit score Calculation. 5. Let’s consider a random person with age =25 and lwt=55.Now let’s find the logit score for this person b0 + b1*x1 + b2*x2= 1.748773-0.039788*25-0.012775*55=0.05144(approx). 6. So logit score for this observation=0.05144. Odds ratio calculation. 7. Now let’s find the probability that birthwt.

Комментариев нет:

Отправить комментарий