[email protected] maths study centre cb04.03.331 open 11am – 5pm semester weekdays check...

11
Regression Analysis: Lab 9 Logistic Regression [email protected] Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out www.khanacademy.org This presentation can be found at: www.mahritaharahap.wordpress.com/teaching-areas/ Marking Scheme: 0 if less than 50% attempted, 1 for more than 50% attempted but less than 50% correct, 2 if more than 50% correct.

Upload: magnus-wilkinson

Post on 18-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

Regression Analysis: Lab 9 Logistic [email protected] Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out www.khanacademy.org This presentation can be found at:www.mahritaharahap.wordpress.com/teaching-areas/

Marking Scheme: 0 if less than 50% attempted, 1 for more than 50% attempted but less than 50% correct, 2 if more than 50% correct.

Page 2: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

A) Testing for Association between two variables:Ho: No association between the two variables (in the population) so any pattern we see is just due to random variation. Ha: An association exists between the two variables (in the population).Test Stat:

If X2 > X2(rows-1)×(columns-1) , this means p-value<α, so we do

reject the null hypothesis. We have enough statistical evidence to prove an association exists between the two variables

FEEDBACK FOR LAB 8

Page 3: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

B), C), D) and E)

Page 4: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

F) Testing for Association between two variables:Ho: No association between the two variables (in the population) so any pattern we see is just due to random variation. Ha: An association exists between the two variables (in the population).Test Stat:

If X2 > X2(rows-1)×(columns-1) , this means p-value<α, so we do

reject the null hypothesis. We have enough statistical evidence to prove an association exists between the two variables

Page 5: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

F), G) and H)

Page 6: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

Lab 9: Logistic Regressionyi=α+β1x1i+….+βpxpi+εi εi~N(0,σ)

When the response variable y is not a continuous random variable but a categorical random response variable, the normal linear regression model becomes inappropriate because the random errors are no longer normally distributed. Therefore, we need to use logistic regression, which deals with this type of data for the response variable. Suppose the response variable y takes only two possible values, 1 and 0 (to denote success or failure for example):Then p=P(y=1)=probability of belonging to group 1 (e.g. success group) so 1-p=P(y=0)=probability of belonging to group 0

In order to do regression on a categorical response variable, we need to do a transformation of p to the whole real line i.e. g:[0,1]->(-∞,∞), using a link function called logit link ), hence which is why this is called logistic regression.

Page 7: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

This is the transformation model:

and the inverse of the transformation model gives

which gives the logistic regression model:==probability of belonging to group 1

Page 8: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

A)

Page 9: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

B)log (𝑜𝑑𝑑𝑠 )=𝜂=α+β1 x1 i ¿−48.909+1.313(𝐺𝐴𝐺𝐸)

Page 10: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

C)H0: Odds Ratio=1Ha: Odds Ratio≠1

Use the confidence interval to answer this question. Is 1 a possible value for the population odds ratio?

Page 11: Mahrita.Harahap@uts.edu.au Maths Study Centre CB04.03.331 Open 11am – 5pm Semester Weekdays Check out   This presentation

E)

F)

log (𝑜𝑑𝑑𝑠 )=𝜂=α+β1 x1 i=−1.033+0.835(𝑆𝐸𝑋 )