SlideShare a Scribd company logo
1 of 11
Download to read offline
Logistic regression in Myopia data
Achilleas Papatsimpas
Mathematician,
M.Sc. in Statistics and Operational Research
1 INTRODUCTION
Myopia is an eye condition where a person has difficulty seeing things at a distance. This
condition is primarily because the eyeball is too long. In an eye that sees normally, the image
of what is being viewed is transmitted to the back portion of the eye, which called retina,
and hits the retina to form a clear picture. In the myopic eye, the image focuses in front of
the retina, so the resultant image on the retinal itself is blurry. The blurry image, as a result,
creates problems with a variety of distance viewing tasks (e.g., reading the blackboard, doing
homework, driving, playing sports) and requires wearing glasses or contact lenses to correct
the problem (Hosmer, Lemeshow and Sturdivant, 2013).
The risk factors for the development of myopia include genetic factors (e.g., family history
of myopia) and the amount and type of visual activity that a child performs (e.g., studying,
reading, TV watching, computer or video game playing and sports/outdoor activity). There
is strong evidence that having myopic parents increases the chance that a child will become
myopic and weaker evidence that certain types of visual activities (called “near work” like read-
ing) increase the chance that a child will become myopic (Hosmer, Lemeshow and Sturdivant,
2013).
The dataset used in this project is from 618 of the subjects who had at least five years of
follow up and were not myopic when they entered the study. All data are from their initial
exam and includes 10 variables. In addition to the ocular data there is information on age at
entry, year of entry, family history of myopia and hours of various visual activities. A subject
was coded as myopic if they became myopic at any time during the first five years of follow up.
We refer to this data set as the MYOPIA data.
We will perform a logistic regression in the MYOPIA data, in order to investigate which risk
factors are the most significant.
1
Variable Variable Description Values/Labels Variable Name
1 Myopia within the first five
years of follow up
0= No, 1=Yes MYOPIC
2 Gender 0= Male, 1= Female GENDER
3 Spherical Equivalent Refraction diopter SPHEQ
4 How many hours per week out-
side of school the child spent en-
gaging in sports/outdoor activi-
ties
Hours per week SPORTHR
5 How many hours per week out-
side of school the child spent
reading for pleasure
Hours per week READHR
6 How many hours per week out-
side of school the child spent
playing video/computer games
or working on the computer
Hours per week COMPHR
7 How many hours per week out-
side of school the child spent
reading or studying for school
assignments
Hours per week STUDYHR
8 How many hours per week out-
side of school the child spent
watching television
Hours per week TVHR
9 Was the subject’s mother my-
opic?
0= No, 1=Yes MOMMY
10 Was the subject’s father myopic? 0= No, 1=Yes DADMY
Table 1.1: Variables in the Myopia study
2
2 LOGISTIC REGRESSION WITH S.P.S.S.
2.1 FULL MODEL
Suppose we are interested in investigating predictors of Myopia within the first five years
of follow up. Note that the Myopia dependent variable, MYOPIC is a binary variable. 0
means no myopia within the first five years of follow up and 1 means myopia. Predictor
variables are GENDER, SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR, TVHR, MOMMY
and DADMY. SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR, TVHR are quantitative. In
addition, GENDER, MOMMY and DADMY are categorical variables. We use the Entry method
(Enter means to add all variables to the model simultaneously).
Now we are looking at the S.P.S.S. statistical output. We can see that there are 618 cases used
in the analysis.
Table 2.1: Case Processing Summary
The Block 0 output is for a model that includes only the intercept (which S.P.S.S. calls the
constant). At the classification table we see that 537/618 = 86.9% decide to stop the research
while 13.1% decide to allow it to continue.
Table 2.2: Classification Table: Block 0
3
In the “Variables in the Equation” table we see that the intercept-only model is
ln(odds) = −1.892
If we exponentiate both sides of this expression we conclude that our predicted odds is
Exp(B) = 0.151. Regression weights and a statistical test of the H0 : B = 0 for the variables in
the equation (only the constant for Block 0).
Table 2.3: Variables in the equation: Block 0
In the “Variables not in the Equation” table we see the contribution of each predictor if it
was added alone into the equation.
Table 2.4: Variables not in the equation: Block 0
Now we look at the output, Block 1. Under Omnibus Tests of Model Coefficients we test the
Hypothesis:
H0 : bi = 0 for i = 1,...,9
vs
H1 : bi = 0 for at least 1 coefficient
4
Therefore we conclude that H0 is rejected since p-value < .001.
Table 2.5: Omnibus Tests of Model Coefficients
Table 2.6: Model Summary
The Classification table shows that the model is 89.6% accurate.
Table 2.7: Classification Table: Block 1
The “Variables in the Equation” table contains the coefficients for the (fitted) line and other
5
relative information about the coefficients.
Table 2.8: Variables in the equation: Block 1
The equation of the line found from the output is
ln
ˆp(x)
1− ˆp(x) = 1.679−0.585·GENDER−4.011·SPHEQ−0.047·SPORT HR+0.078·RE ADHR+
0.042·COMPHR −0.022·TV HR −0.187·STUDY HR −0.739· MOMMY −0.809·D ADMY
2.2 INTERPRETING THE FULL MODEL
GENDER does not contribute to the model. The negative B indicates that the target group
(Yes) tends to have more of those coded “0” (females) than of these coded “1” (males) - but
not significantly (p-value = 0.063). SPHEQ, SPORTHR, STUDYHR, MOMMY and DADMY do
contribute to the model, as they are significant factors (p-value < 0.05).
Finally, READHR, COMPHR and TVHR do not contribute to the model as they are not
significant.
2.3 REDUCED MODEL
Now, we conduct an analysis where the dependent variable is MYOPIC and the predictors
are SPHEQ, SPORTHR, STUDYHR, MOMMY and DADMY, which we found previously that
they contribute to the model. We will call this model as the reduced model. Furthermore,
we can test the significance of the difference between the full model and the reduced model,
as long as the reduced model is nested within the other. Our 9-predictor full model had a
-2LogLikelihood statistic of 305.201 (Block 1, Model summary table). Removing the variables
mentioned before, produced an increase of 7.827. As a result, the reduced model has a -
2LogLikelihood statistic of 303.028. This difference is a χ2
on 4 df (one df for each predictor
6
variable).
Table 2.9: Omnibus Tests of Model Coefficients: Reduced model
Table 2.10: Model Summary: Reduced model
To determine the p-value associated with this χ2
, we compute the following p in S.P.S.S. as
p = 1−CDF.CHISQ(7.827,4)
The calculations show that p=0.10. We conclude that the reduced model is as effective as the
full model, as
χ2
(4,N = 618) = 7.827
and p-value = 0.10 > .05.
Note that our overall success rate in classification has improved from 89.6 to 90.1, as we can
see at the classification table below.
7
Table 2.11: Classification Table: Reduced model
The equation of the new model found from the output is:
ln
ˆp(x)
1− ˆp(x) = 1.438−3.969·SPHEQ−0.047·SPORT HR−0.148·STUDY HR−0.651·MOMMY −
0.819·D ADMY
Table 2.12: Variables in the Equation: Reduced model
EXAMPLE Supposing that we have a child with Spherical Equivalent Refraction (SPHEQ) of
1.40. The child spends daily 4 hours engaging in sports and outdoor activities and 1 hour in
reading or studying for school assignments. Also, the child’s parents aren’t myopic.
Therefore, we have the following prediction:
ln
ˆp(x)
1− ˆp(x)
= 1.438−3.969·1.40−0.047·4−0.148·1−0.651·0−0.819·0 = −4.4546
and
ˆp(x) =
exp(−4.4546)
1+exp(−4.4546)
=
0.0116249689
1+0.0116249689
= 0.011491382
That is, our model predicts that there’s an 1% possibility of a myopic child.
3 LOGISTIC REGRESSION WITH R
3.1 FULL MODEL
Now we conduct the previous logistic regression in R. As before, the dependent variable is
MYOPIC and the predictors are GENDER, SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR,
TVHR, MOMMY and DADMY. The Coefficients table which contains the coefficients for the
8
(fitted) line and other relative information about them, is given below
Table 3.1: Coefficients table in R
R also calculates the descriptive statistics (minimum and maximum statistics, median, first
and third quartiles).
Table 3.2: Descriptive statistics
Finally, we get the Analysis of Deviance table.
Table 3.3: Analysis of Deviance
9
3.2 REDUCED MODEL
Now, we conduct an analysis where the predictors are SPHEQ, SPORTHR, STUDYHR, MOMMY
and DADMY. The coefficients table is given below.
Table 3.4: Coefficients table: Reduced model
The Analysis of Deviance table is:
Table 3.5: Analysis of Deviance table: Reduced model
We can test the significance of the difference between the full and the reduced model, as long
as the reduced model is nested within the other. Our 9-predictor model had a -2LogLikelihood
statistic of 305.2 (Coefficients table, Residual deviance). Removing the variables mentioned
before, produced an increase of 7.8267. As a result, the reduced model has a -2LogLikelihood
statistic of 313.03. This difference is a χ2
on 4 df (one df for each predictor variable - look at
10
the analysis of variance table below)
Table 3.6: Analysis of Variance table: Reduced model
To determine the p-value associated with this χ2
, we compute the expression in R
p = 1−pchisq(7.8264,4)
The calculations show that p = 0.0981484. We conclude that the reduced model is as effective
as the full model, as
χ2
(4,N = 618) = 7.8264
and p-value = 0.0981484 > .05.
REFERENCES
1. Karl L. Wuensch, Binary Logistic Regression with SPSS (2014), East Carolina University
2. Logistic Regression on SPSS, https://www.researchgate.net
3. Hosmer, D.W. Lemeshow, S. and Sturdivant, R.X. (2013) Applied Logistic Regression:
Second Edition, John Wiley & Sons Inc., New York, NY
4. Binary Logistic Regression, Training in Quantitative Psychology at UNL, Courses in
Research Methods, Design & Data Analysis
11

More Related Content

What's hot

10 ch ken black solution
10 ch ken black solution10 ch ken black solution
10 ch ken black solutionKrunal Shah
 
Math Statistics IA December 2010
Math Statistics IA December 2010Math Statistics IA December 2010
Math Statistics IA December 2010david1dave
 
Math Internal Assessment
Math Internal AssessmentMath Internal Assessment
Math Internal AssessmentJanniie
 
Quantitative Analysis For Management 11th Edition Render Solutions Manual
Quantitative Analysis For Management 11th Edition Render Solutions ManualQuantitative Analysis For Management 11th Edition Render Solutions Manual
Quantitative Analysis For Management 11th Edition Render Solutions ManualShermanne
 
Complements and Conditional Probability, and Bayes' Theorem
 Complements and Conditional Probability, and Bayes' Theorem Complements and Conditional Probability, and Bayes' Theorem
Complements and Conditional Probability, and Bayes' TheoremLong Beach City College
 
02 ch ken black solution
02 ch ken black solution02 ch ken black solution
02 ch ken black solutionKrunal Shah
 
Biostatichomeworks
Biostatichomeworks Biostatichomeworks
Biostatichomeworks raveen mayi
 
Week 6 lecture_math_221_apr_2012
Week 6 lecture_math_221_apr_2012Week 6 lecture_math_221_apr_2012
Week 6 lecture_math_221_apr_2012Brent Heard
 
Stability criterion of periodic oscillations in a (16)
Stability criterion of periodic oscillations in a (16)Stability criterion of periodic oscillations in a (16)
Stability criterion of periodic oscillations in a (16)Alexander Decker
 
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...MaxineBoyd
 
Normal distribution
Normal distributionNormal distribution
Normal distributionCamilleJoy3
 
Normal distribution
Normal distributionNormal distribution
Normal distributionGlobal Polis
 
Note 2 probability
Note 2 probabilityNote 2 probability
Note 2 probabilityNur Suaidah
 

What's hot (18)

10 ch ken black solution
10 ch ken black solution10 ch ken black solution
10 ch ken black solution
 
Chapter3
Chapter3Chapter3
Chapter3
 
Math Statistics IA December 2010
Math Statistics IA December 2010Math Statistics IA December 2010
Math Statistics IA December 2010
 
Math Internal Assessment
Math Internal AssessmentMath Internal Assessment
Math Internal Assessment
 
Quantitative Analysis For Management 11th Edition Render Solutions Manual
Quantitative Analysis For Management 11th Edition Render Solutions ManualQuantitative Analysis For Management 11th Edition Render Solutions Manual
Quantitative Analysis For Management 11th Edition Render Solutions Manual
 
Complements and Conditional Probability, and Bayes' Theorem
 Complements and Conditional Probability, and Bayes' Theorem Complements and Conditional Probability, and Bayes' Theorem
Complements and Conditional Probability, and Bayes' Theorem
 
02 ch ken black solution
02 ch ken black solution02 ch ken black solution
02 ch ken black solution
 
Estimating a Population Proportion
Estimating a Population ProportionEstimating a Population Proportion
Estimating a Population Proportion
 
Normal distribution
Normal distribution  Normal distribution
Normal distribution
 
Central tendency
Central tendencyCentral tendency
Central tendency
 
Biostatichomeworks
Biostatichomeworks Biostatichomeworks
Biostatichomeworks
 
Week 6 lecture_math_221_apr_2012
Week 6 lecture_math_221_apr_2012Week 6 lecture_math_221_apr_2012
Week 6 lecture_math_221_apr_2012
 
Stability criterion of periodic oscillations in a (16)
Stability criterion of periodic oscillations in a (16)Stability criterion of periodic oscillations in a (16)
Stability criterion of periodic oscillations in a (16)
 
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...
Introduction to Probability and Statistics 13th Edition Mendenhall Solutions ...
 
Normal distribution
Normal distributionNormal distribution
Normal distribution
 
Static Models of Continuous Variables
Static Models of Continuous VariablesStatic Models of Continuous Variables
Static Models of Continuous Variables
 
Normal distribution
Normal distributionNormal distribution
Normal distribution
 
Note 2 probability
Note 2 probabilityNote 2 probability
Note 2 probability
 

Viewers also liked

Solving exponential and logarithmic equations (In Greek)
Solving exponential and logarithmic equations (In Greek)Solving exponential and logarithmic equations (In Greek)
Solving exponential and logarithmic equations (In Greek)Achilleas Papatsimpas
 
Soft Introduction to Brain-Computer Interfaces and Machine Learning
Soft Introduction to Brain-Computer Interfaces and Machine LearningSoft Introduction to Brain-Computer Interfaces and Machine Learning
Soft Introduction to Brain-Computer Interfaces and Machine LearningIlya Kuzovkin
 
2014-06-20 Multinomial Logistic Regression with Apache Spark
2014-06-20 Multinomial Logistic Regression with Apache Spark2014-06-20 Multinomial Logistic Regression with Apache Spark
2014-06-20 Multinomial Logistic Regression with Apache SparkDB Tsai
 
Multinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkDB Tsai
 
Introduction to Spintronics by Ch.Ravikumar
Introduction to Spintronics by Ch.RavikumarIntroduction to Spintronics by Ch.Ravikumar
Introduction to Spintronics by Ch.RavikumarRavikumar Chilmula
 
Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Ali Rind
 
Logistic regression with SPSS examples
Logistic regression with SPSS examplesLogistic regression with SPSS examples
Logistic regression with SPSS examplesGaurav Kamboj
 
Brain Computer Interface.ppt
Brain Computer Interface.pptBrain Computer Interface.ppt
Brain Computer Interface.pptAmal Sanjay
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionDrZahid Khan
 
Intro to Classification: Logistic Regression & SVM
Intro to Classification: Logistic Regression & SVMIntro to Classification: Logistic Regression & SVM
Intro to Classification: Logistic Regression & SVMNYC Predictive Analytics
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionsaba khan
 

Viewers also liked (15)

Solving exponential and logarithmic equations (In Greek)
Solving exponential and logarithmic equations (In Greek)Solving exponential and logarithmic equations (In Greek)
Solving exponential and logarithmic equations (In Greek)
 
Fetc2015 app skills
Fetc2015 app skills Fetc2015 app skills
Fetc2015 app skills
 
Machine Learning คือ? #bcbk
Machine Learning คือ? #bcbkMachine Learning คือ? #bcbk
Machine Learning คือ? #bcbk
 
Soft Introduction to Brain-Computer Interfaces and Machine Learning
Soft Introduction to Brain-Computer Interfaces and Machine LearningSoft Introduction to Brain-Computer Interfaces and Machine Learning
Soft Introduction to Brain-Computer Interfaces and Machine Learning
 
2014-06-20 Multinomial Logistic Regression with Apache Spark
2014-06-20 Multinomial Logistic Regression with Apache Spark2014-06-20 Multinomial Logistic Regression with Apache Spark
2014-06-20 Multinomial Logistic Regression with Apache Spark
 
Multinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache Spark
 
Introduction to Spintronics by Ch.Ravikumar
Introduction to Spintronics by Ch.RavikumarIntroduction to Spintronics by Ch.Ravikumar
Introduction to Spintronics by Ch.Ravikumar
 
Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20
 
Logistic regression with SPSS examples
Logistic regression with SPSS examplesLogistic regression with SPSS examples
Logistic regression with SPSS examples
 
Logistic Regression Analysis
Logistic Regression AnalysisLogistic Regression Analysis
Logistic Regression Analysis
 
Brain Computer Interface.ppt
Brain Computer Interface.pptBrain Computer Interface.ppt
Brain Computer Interface.ppt
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Intro to Classification: Logistic Regression & SVM
Intro to Classification: Logistic Regression & SVMIntro to Classification: Logistic Regression & SVM
Intro to Classification: Logistic Regression & SVM
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 

Similar to Logistic regression in Myopia data

Lecture 6 guidelines_and_assignment
Lecture 6 guidelines_and_assignmentLecture 6 guidelines_and_assignment
Lecture 6 guidelines_and_assignmentDaria Bogdanova
 
Principal components
Principal componentsPrincipal components
Principal componentsHutami Endang
 
Lesson 1 06 using the mean to measure central tendency
Lesson 1 06 using the mean to measure central tendency Lesson 1 06 using the mean to measure central tendency
Lesson 1 06 using the mean to measure central tendency Perla Pelicano Corpez
 
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docxLynellBull52
 
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docx
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docxPSY520 – Module 6Answer SheetSubmit your answers in the boxe.docx
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docxwoodruffeloisa
 
Advanced statistics Lesson 1
Advanced statistics Lesson 1Advanced statistics Lesson 1
Advanced statistics Lesson 1Cliffed Echavez
 
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved. .docx
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved.  .docx© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved.  .docx
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved. .docxLynellBull52
 
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docxtroutmanboris
 
Advanced business mathematics and statistics for entrepreneurs
Advanced business mathematics and statistics for entrepreneursAdvanced business mathematics and statistics for entrepreneurs
Advanced business mathematics and statistics for entrepreneursDr. Trilok Kumar Jain
 
Topic 8a Basic Statistics
Topic 8a Basic StatisticsTopic 8a Basic Statistics
Topic 8a Basic StatisticsYee Bee Choo
 
Predicting breast cancer: Adrian Valles
Predicting breast cancer: Adrian VallesPredicting breast cancer: Adrian Valles
Predicting breast cancer: Adrian VallesAdrián Vallés
 
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docx
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docxBUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docx
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docxhumphrieskalyn
 
Quality Engineering material
Quality Engineering materialQuality Engineering material
Quality Engineering materialTeluguSudhakar3
 
Chi-square tests are great to show if distributions differ or i.docx
 Chi-square tests are great to show if distributions differ or i.docx Chi-square tests are great to show if distributions differ or i.docx
Chi-square tests are great to show if distributions differ or i.docxMARRY7
 
Lecture 2 practical_guidelines_assignment
Lecture 2 practical_guidelines_assignmentLecture 2 practical_guidelines_assignment
Lecture 2 practical_guidelines_assignmentDaria Bogdanova
 

Similar to Logistic regression in Myopia data (20)

Factorial Experiments
Factorial ExperimentsFactorial Experiments
Factorial Experiments
 
Lecture 6 guidelines_and_assignment
Lecture 6 guidelines_and_assignmentLecture 6 guidelines_and_assignment
Lecture 6 guidelines_and_assignment
 
Lab 1 intro
Lab 1 introLab 1 intro
Lab 1 intro
 
Principal components
Principal componentsPrincipal components
Principal components
 
Lesson 1 06 using the mean to measure central tendency
Lesson 1 06 using the mean to measure central tendency Lesson 1 06 using the mean to measure central tendency
Lesson 1 06 using the mean to measure central tendency
 
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx
© Charles T. Diebold, Ph.D., 71113, 100313. All Rights Res.docx
 
Mech ma6452 snm_notes
Mech ma6452 snm_notesMech ma6452 snm_notes
Mech ma6452 snm_notes
 
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docx
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docxPSY520 – Module 6Answer SheetSubmit your answers in the boxe.docx
PSY520 – Module 6Answer SheetSubmit your answers in the boxe.docx
 
Advanced statistics Lesson 1
Advanced statistics Lesson 1Advanced statistics Lesson 1
Advanced statistics Lesson 1
 
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved. .docx
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved.  .docx© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved.  .docx
© Charles T. Diebold, Ph.D., 9152013. All Rights Reserved. .docx
 
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx
5DDBA 8307 Week 6 Assignment Template – Multiple Regression.docx
 
Advanced business mathematics and statistics for entrepreneurs
Advanced business mathematics and statistics for entrepreneursAdvanced business mathematics and statistics for entrepreneurs
Advanced business mathematics and statistics for entrepreneurs
 
Topic 8a Basic Statistics
Topic 8a Basic StatisticsTopic 8a Basic Statistics
Topic 8a Basic Statistics
 
Statistics
StatisticsStatistics
Statistics
 
Statistical analysis by iswar
Statistical analysis by iswarStatistical analysis by iswar
Statistical analysis by iswar
 
Predicting breast cancer: Adrian Valles
Predicting breast cancer: Adrian VallesPredicting breast cancer: Adrian Valles
Predicting breast cancer: Adrian Valles
 
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docx
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docxBUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docx
BUSI 620Questions for Critical Thinking 3Salvatore’s Chapter.docx
 
Quality Engineering material
Quality Engineering materialQuality Engineering material
Quality Engineering material
 
Chi-square tests are great to show if distributions differ or i.docx
 Chi-square tests are great to show if distributions differ or i.docx Chi-square tests are great to show if distributions differ or i.docx
Chi-square tests are great to show if distributions differ or i.docx
 
Lecture 2 practical_guidelines_assignment
Lecture 2 practical_guidelines_assignmentLecture 2 practical_guidelines_assignment
Lecture 2 practical_guidelines_assignment
 

More from Achilleas Papatsimpas

Marshall – Olkin distributions in R
Marshall – Olkin distributions in RMarshall – Olkin distributions in R
Marshall – Olkin distributions in RAchilleas Papatsimpas
 
2017 World Happiness Report Data Analysis
2017 World Happiness Report Data Analysis2017 World Happiness Report Data Analysis
2017 World Happiness Report Data AnalysisAchilleas Papatsimpas
 
Marketing in the Hellenic private secondary education during the recession
Marketing in the Hellenic private secondary education during the recession Marketing in the Hellenic private secondary education during the recession
Marketing in the Hellenic private secondary education during the recession Achilleas Papatsimpas
 
Important Probability distributions (in Greek)
Important Probability distributions (in Greek)Important Probability distributions (in Greek)
Important Probability distributions (in Greek)Achilleas Papatsimpas
 
Level of measurement between 2 variables
Level of measurement between 2 variablesLevel of measurement between 2 variables
Level of measurement between 2 variablesAchilleas Papatsimpas
 
Flow chart for popularly used statistical tests
Flow chart for popularly used statistical testsFlow chart for popularly used statistical tests
Flow chart for popularly used statistical testsAchilleas Papatsimpas
 

More from Achilleas Papatsimpas (6)

Marshall – Olkin distributions in R
Marshall – Olkin distributions in RMarshall – Olkin distributions in R
Marshall – Olkin distributions in R
 
2017 World Happiness Report Data Analysis
2017 World Happiness Report Data Analysis2017 World Happiness Report Data Analysis
2017 World Happiness Report Data Analysis
 
Marketing in the Hellenic private secondary education during the recession
Marketing in the Hellenic private secondary education during the recession Marketing in the Hellenic private secondary education during the recession
Marketing in the Hellenic private secondary education during the recession
 
Important Probability distributions (in Greek)
Important Probability distributions (in Greek)Important Probability distributions (in Greek)
Important Probability distributions (in Greek)
 
Level of measurement between 2 variables
Level of measurement between 2 variablesLevel of measurement between 2 variables
Level of measurement between 2 variables
 
Flow chart for popularly used statistical tests
Flow chart for popularly used statistical testsFlow chart for popularly used statistical tests
Flow chart for popularly used statistical tests
 

Recently uploaded

RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
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
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
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
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一F La
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 

Recently uploaded (20)

RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
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
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
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...
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 

Logistic regression in Myopia data

  • 1. Logistic regression in Myopia data Achilleas Papatsimpas Mathematician, M.Sc. in Statistics and Operational Research 1 INTRODUCTION Myopia is an eye condition where a person has difficulty seeing things at a distance. This condition is primarily because the eyeball is too long. In an eye that sees normally, the image of what is being viewed is transmitted to the back portion of the eye, which called retina, and hits the retina to form a clear picture. In the myopic eye, the image focuses in front of the retina, so the resultant image on the retinal itself is blurry. The blurry image, as a result, creates problems with a variety of distance viewing tasks (e.g., reading the blackboard, doing homework, driving, playing sports) and requires wearing glasses or contact lenses to correct the problem (Hosmer, Lemeshow and Sturdivant, 2013). The risk factors for the development of myopia include genetic factors (e.g., family history of myopia) and the amount and type of visual activity that a child performs (e.g., studying, reading, TV watching, computer or video game playing and sports/outdoor activity). There is strong evidence that having myopic parents increases the chance that a child will become myopic and weaker evidence that certain types of visual activities (called “near work” like read- ing) increase the chance that a child will become myopic (Hosmer, Lemeshow and Sturdivant, 2013). The dataset used in this project is from 618 of the subjects who had at least five years of follow up and were not myopic when they entered the study. All data are from their initial exam and includes 10 variables. In addition to the ocular data there is information on age at entry, year of entry, family history of myopia and hours of various visual activities. A subject was coded as myopic if they became myopic at any time during the first five years of follow up. We refer to this data set as the MYOPIA data. We will perform a logistic regression in the MYOPIA data, in order to investigate which risk factors are the most significant. 1
  • 2. Variable Variable Description Values/Labels Variable Name 1 Myopia within the first five years of follow up 0= No, 1=Yes MYOPIC 2 Gender 0= Male, 1= Female GENDER 3 Spherical Equivalent Refraction diopter SPHEQ 4 How many hours per week out- side of school the child spent en- gaging in sports/outdoor activi- ties Hours per week SPORTHR 5 How many hours per week out- side of school the child spent reading for pleasure Hours per week READHR 6 How many hours per week out- side of school the child spent playing video/computer games or working on the computer Hours per week COMPHR 7 How many hours per week out- side of school the child spent reading or studying for school assignments Hours per week STUDYHR 8 How many hours per week out- side of school the child spent watching television Hours per week TVHR 9 Was the subject’s mother my- opic? 0= No, 1=Yes MOMMY 10 Was the subject’s father myopic? 0= No, 1=Yes DADMY Table 1.1: Variables in the Myopia study 2
  • 3. 2 LOGISTIC REGRESSION WITH S.P.S.S. 2.1 FULL MODEL Suppose we are interested in investigating predictors of Myopia within the first five years of follow up. Note that the Myopia dependent variable, MYOPIC is a binary variable. 0 means no myopia within the first five years of follow up and 1 means myopia. Predictor variables are GENDER, SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR, TVHR, MOMMY and DADMY. SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR, TVHR are quantitative. In addition, GENDER, MOMMY and DADMY are categorical variables. We use the Entry method (Enter means to add all variables to the model simultaneously). Now we are looking at the S.P.S.S. statistical output. We can see that there are 618 cases used in the analysis. Table 2.1: Case Processing Summary The Block 0 output is for a model that includes only the intercept (which S.P.S.S. calls the constant). At the classification table we see that 537/618 = 86.9% decide to stop the research while 13.1% decide to allow it to continue. Table 2.2: Classification Table: Block 0 3
  • 4. In the “Variables in the Equation” table we see that the intercept-only model is ln(odds) = −1.892 If we exponentiate both sides of this expression we conclude that our predicted odds is Exp(B) = 0.151. Regression weights and a statistical test of the H0 : B = 0 for the variables in the equation (only the constant for Block 0). Table 2.3: Variables in the equation: Block 0 In the “Variables not in the Equation” table we see the contribution of each predictor if it was added alone into the equation. Table 2.4: Variables not in the equation: Block 0 Now we look at the output, Block 1. Under Omnibus Tests of Model Coefficients we test the Hypothesis: H0 : bi = 0 for i = 1,...,9 vs H1 : bi = 0 for at least 1 coefficient 4
  • 5. Therefore we conclude that H0 is rejected since p-value < .001. Table 2.5: Omnibus Tests of Model Coefficients Table 2.6: Model Summary The Classification table shows that the model is 89.6% accurate. Table 2.7: Classification Table: Block 1 The “Variables in the Equation” table contains the coefficients for the (fitted) line and other 5
  • 6. relative information about the coefficients. Table 2.8: Variables in the equation: Block 1 The equation of the line found from the output is ln ˆp(x) 1− ˆp(x) = 1.679−0.585·GENDER−4.011·SPHEQ−0.047·SPORT HR+0.078·RE ADHR+ 0.042·COMPHR −0.022·TV HR −0.187·STUDY HR −0.739· MOMMY −0.809·D ADMY 2.2 INTERPRETING THE FULL MODEL GENDER does not contribute to the model. The negative B indicates that the target group (Yes) tends to have more of those coded “0” (females) than of these coded “1” (males) - but not significantly (p-value = 0.063). SPHEQ, SPORTHR, STUDYHR, MOMMY and DADMY do contribute to the model, as they are significant factors (p-value < 0.05). Finally, READHR, COMPHR and TVHR do not contribute to the model as they are not significant. 2.3 REDUCED MODEL Now, we conduct an analysis where the dependent variable is MYOPIC and the predictors are SPHEQ, SPORTHR, STUDYHR, MOMMY and DADMY, which we found previously that they contribute to the model. We will call this model as the reduced model. Furthermore, we can test the significance of the difference between the full model and the reduced model, as long as the reduced model is nested within the other. Our 9-predictor full model had a -2LogLikelihood statistic of 305.201 (Block 1, Model summary table). Removing the variables mentioned before, produced an increase of 7.827. As a result, the reduced model has a - 2LogLikelihood statistic of 303.028. This difference is a χ2 on 4 df (one df for each predictor 6
  • 7. variable). Table 2.9: Omnibus Tests of Model Coefficients: Reduced model Table 2.10: Model Summary: Reduced model To determine the p-value associated with this χ2 , we compute the following p in S.P.S.S. as p = 1−CDF.CHISQ(7.827,4) The calculations show that p=0.10. We conclude that the reduced model is as effective as the full model, as χ2 (4,N = 618) = 7.827 and p-value = 0.10 > .05. Note that our overall success rate in classification has improved from 89.6 to 90.1, as we can see at the classification table below. 7
  • 8. Table 2.11: Classification Table: Reduced model The equation of the new model found from the output is: ln ˆp(x) 1− ˆp(x) = 1.438−3.969·SPHEQ−0.047·SPORT HR−0.148·STUDY HR−0.651·MOMMY − 0.819·D ADMY Table 2.12: Variables in the Equation: Reduced model EXAMPLE Supposing that we have a child with Spherical Equivalent Refraction (SPHEQ) of 1.40. The child spends daily 4 hours engaging in sports and outdoor activities and 1 hour in reading or studying for school assignments. Also, the child’s parents aren’t myopic. Therefore, we have the following prediction: ln ˆp(x) 1− ˆp(x) = 1.438−3.969·1.40−0.047·4−0.148·1−0.651·0−0.819·0 = −4.4546 and ˆp(x) = exp(−4.4546) 1+exp(−4.4546) = 0.0116249689 1+0.0116249689 = 0.011491382 That is, our model predicts that there’s an 1% possibility of a myopic child. 3 LOGISTIC REGRESSION WITH R 3.1 FULL MODEL Now we conduct the previous logistic regression in R. As before, the dependent variable is MYOPIC and the predictors are GENDER, SPHEQ, SPORTHR, READHR, COMPHR, STUDYHR, TVHR, MOMMY and DADMY. The Coefficients table which contains the coefficients for the 8
  • 9. (fitted) line and other relative information about them, is given below Table 3.1: Coefficients table in R R also calculates the descriptive statistics (minimum and maximum statistics, median, first and third quartiles). Table 3.2: Descriptive statistics Finally, we get the Analysis of Deviance table. Table 3.3: Analysis of Deviance 9
  • 10. 3.2 REDUCED MODEL Now, we conduct an analysis where the predictors are SPHEQ, SPORTHR, STUDYHR, MOMMY and DADMY. The coefficients table is given below. Table 3.4: Coefficients table: Reduced model The Analysis of Deviance table is: Table 3.5: Analysis of Deviance table: Reduced model We can test the significance of the difference between the full and the reduced model, as long as the reduced model is nested within the other. Our 9-predictor model had a -2LogLikelihood statistic of 305.2 (Coefficients table, Residual deviance). Removing the variables mentioned before, produced an increase of 7.8267. As a result, the reduced model has a -2LogLikelihood statistic of 313.03. This difference is a χ2 on 4 df (one df for each predictor variable - look at 10
  • 11. the analysis of variance table below) Table 3.6: Analysis of Variance table: Reduced model To determine the p-value associated with this χ2 , we compute the expression in R p = 1−pchisq(7.8264,4) The calculations show that p = 0.0981484. We conclude that the reduced model is as effective as the full model, as χ2 (4,N = 618) = 7.8264 and p-value = 0.0981484 > .05. REFERENCES 1. Karl L. Wuensch, Binary Logistic Regression with SPSS (2014), East Carolina University 2. Logistic Regression on SPSS, https://www.researchgate.net 3. Hosmer, D.W. Lemeshow, S. and Sturdivant, R.X. (2013) Applied Logistic Regression: Second Edition, John Wiley & Sons Inc., New York, NY 4. Binary Logistic Regression, Training in Quantitative Psychology at UNL, Courses in Research Methods, Design & Data Analysis 11