Loading in 5 sec....

Advanced Models and Methods in Behavioral ResearchPowerPoint Presentation

Advanced Models and Methods in Behavioral Research

- By
**niabi** - Follow User

- 119 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about 'Advanced Models and Methods in Behavioral Research' - niabi

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### Logistic Regression Analysis

Advanced Models and Methods in Behavioral Research

- Chris Snijders
- c.c.p.snijders@gmail.com
- 3 ects
- http://www.chrissnijders.com/ammbr (=studyguide)
- literature: Field book + separate course material
- laptop exam (+ assignments)

ToDo

(ifnotdoneyet):

Enroll in 0a611

Advanced Methods and Models in Behavioral Research –

The methods package

- MMBR (6 ects)
- Blumberg: questions, reliability, validity, research design
- Field: SPSS: factor analysis, multiple regression, ANcOVA, sample sizeetc

- AMMBR (3 ects)
- Field (1 chapter): logististicregression

- literaturethrough website:

conjoint analysis multi-level regression

Advanced Methods and Models in Behavioral Research –

Models and methods: topics

- t-test, Cronbach's alpha, etc
- multiple regression, analysis of (co)varianceand factor analysis
- logisticregression
- conjoint analysis / repeatedmeasures
- Stata next to SPSS
- “Finding new questions”
- Some data collection
In the background:

“now you should be able to deal with dataon your own”

Advanced Methods and Models in Behavioral Research –

Methods in brief (1)

- Logisticregression: target Y, predictorsXi.
Y is a binaryvariable (0/1).

- Whynotjust multiple regression?

- Interpretation is more difficult

- goodness of fit is non-standard

- ...

(andit is a chapter in Field)

Advanced Methods and Models in Behavioral Research –

Methods in brief (2)

- Conjoint analysis
Underlying assumption: for

each user, the "utility" of an

offercan be written as

U(x1,x2, ... , xn) = c0 + c1 x1 + ... + cn xn

- 10 Euro p/m
- 2 years fixed
- free phone
- ...
- How attractive is this
- offer to you?

Advanced Methods and Models in Behavioral Research –

Conjoint analysis as an “in between method”

Between

Which phone do you like and why?

What would your favorite phone be?

And:

Let’s keep track of what people buy.

We have:

Advanced Methods and Models in Behavioral Research –

Local Master Thesis example:

Fiber to the home

Speed: really fast

Price: sort of high

Installation: free!

Your neighbors: are in!

How attractive is this to you?

(RoelSchuring)

Advanced Methods and Models in Behavioral Research –

Coming up with new ideas (3)

“More research is necessary”

But on what?

YOU: come up with sensible new ideas, given previous research

Advanced Methods and Models in Behavioral Research –

Stata next to SPSS

- It’s just better (faster, better written, more possibilities, better programmable …)
- Multi-level regression is much easier than in SPSS
- It’s good to be exposed to more than just a single statistics package (your knowledge should not be based on “where to click” arguments)
- More stable
- BTW Supports OSX as well… (anybody?)

Advanced Methods and Models in Behavioral Research –

Every advantage has a disadvantage

- Output less “polished”
- It takes some extra work to get you started
- The Logistic Regression chapter in the Field book uses SPSS (but still readable for the larger part)
- (and it’s not campus software, but subfaculty software)
- Installation …

Advanced Methods and Models in Behavioral Research –

If on Windows, try downloading

- www.chrissnijders.com/ammbr/TUeStata12-zip.exe

Advanced Methods and Models in Behavioral Research –

That is: your Y variable is 0/1: Now what?

Credit where credit is due:

slides adapted from Gerrit Rooks

The main points

- Why do we have to know and sometimes use logistic regression?
- What is the underlying model? What is maximum likelihood estimation?
- Logistics of logistic regression analysis
- Estimate coefficients
- Assess model fit
- Interpret coefficients
- Check residuals

- An SPSS example

Suppose we have 100 observations with information about an individuals age and wether or not this indivual had some kind of a heart disease (CHD)

A graphic representation of the data individuals age and wether or not this indivual had some kind of a heart disease (CHD)

CHD

Age

Let individuals age and wether or not this indivual had some kind of a heart disease (CHD)’s just try regression analysis

pr(CHD|age) = -.54 +.022*Age

... linear regression is not a suitable model for probabilities

pr(CHD|age) = -.54 +.0218107*Age

In this graph for 8 age groups, I plotted the probability of having a heart disease (proportion)

A nonlinear model is probably better here having a heart disease (proportion)

Something like this having a heart disease (proportion)

This is the logistic regression model having a heart disease (proportion)

Predicted probabilities are always between 0 and 1 having a heart disease (proportion)

similar to classic regression

analysis

Side note: this is similar to MMBR … having a heart disease (proportion)

Suppose Y is a percentage (so between 0 and 1).

Then consider

…which will ensure that the estimated Y will vary between 0 and 1

and after some rearranging this is the same as

Advanced Methods and Models in Behavioral Research –

… (continued) having a heart disease (proportion)

- And one “solution” might be:
- Change all Y values that are 0 to 0.001
- Change all Y values that are 1 to 0.999

- Now run regression on log(Y/(1-Y)) …
- … but that really is sort of higgledy-piggledy …

Advanced Methods and Models in Behavioral Research –

Logistics of logistic regression having a heart disease (proportion)

- How do we estimate the coefficients?
- How do we assess model fit?
- How do we interpret coefficients?
- How do we check regression assumptions?

Kinds of estimation in regression having a heart disease (proportion)

- Ordinary Least Squares (we fit a line through a cloud of dots)
- Maximum likelihood (we find the parameters that are the most likely, given our data)
We never bothered to consider maximum likelihood in standard multiple regression, because you can show that they lead to exactly the same estimator (in MR, that is, normally they differ).

Actually, maximum likelihood has superior statistical properties (efficiency, consistency, invariance, …)

Advanced Methods and Models in Behavioral Research –

Maximum likelihood estimation having a heart disease (proportion)

- Method of maximum likelihood yields values for the unknown parameters that maximize the probability of obtaining the observed set of data

Unknown parameters

Maximum likelihood estimation having a heart disease (proportion)

- First we have to construct the “likelihood function” (probability of obtaining the observed set of data).

Likelihood = pr(obs1)*pr(obs2)*pr(obs3)…*pr(obsn)

Assuming that observations are independent

Log-likelihood having a heart disease (proportion)

- For technical reasons the likelihood is transformed in the log-likelihood (then you just maximize the sum of the logged probabilities)

LL= ln[pr(obs1)]+ln[pr(obs2)]+ln[pr(obs3)]…+ln[pr(obsn)]

Some subtleties having a heart disease (proportion)

- In OLS, we did not need stochastic assumptions to be able to calculate a best-fitting line (only for the estimates of the confidence intervals we need that). With maximum likelihood estimation we need this from the start
(and let us not be bothered at this point by how the confidence intervals are calculated in maximum likelihood)

Advanced Methods and Models in Behavioral Research –

Note: optimizing log-likelihoods is difficult having a heart disease (proportion)

- It’s iterative (“searching the landscape”)
it might not converge

it might converge to the wrong answer

Advanced Methods and Models in Behavioral Research –

Nasty implication: having a heart disease (proportion)extreme cases should be left out

(some handwaving here)

Advanced Methods and Models in Behavioral Research –

SPSS output having a heart disease (proportion)

Advanced Methods and Models in Behavioral Research –

Estimation of coefficients: SPSS Results having a heart disease (proportion)

This function fits best: other values of b0 and b1 give worse results (that is, other values have a smaller likelihood value)

Illustration 1: suppose we chose worse results .05X instead of .11X

Illustration 2: suppose we chose worse results .40X instead of .11X

Logistics of logistic regression worse results

- Estimate the coefficients (and their conf.int.)
- Assess model fit
- Between model comparisons
- Pseudo R2 (similar to multiple regression)
- Predictive accuracy

- Interpret coefficients
- Check regression assumptions

Model fit: worse results comparisons between models

The log-likelihood ratio test statistic can be used to test the fit of a model

full model

reduced model

The test statistic has a

chi-square distribution

NOTE This is sort of similar to the variance decomposition tables you see in MR!

Advanced Methods and Models in Behavioral worse results Research

Between model comparisons: worse results the likelihood ratio test

full model

reduced model

The model including only an intercept

Is often called the empty model. SPSS uses this model as a default.

Between model comparison: SPSS output worse results

This is the test statistic,

and it’s associated

significance

Just like in multiple regression, pseudo R worse results 2 ranges 0.0 to 1.0

Cox and Snell

cannot theoretically reach 1

Nagelkerke

adjusted so that it can reach 1

Overall model fitpseudo R2log-likelihood of the model

that you want to test

log-likelihood of model

before any predictors were

entered

NOTE: R2 in logistic regression tends to be (even) smaller than in multiple regression

Overall model fit: Classification table worse results

We predict 74% correctly

Overall model fit: Classification table worse results

14 cases had a CHD while according to our model

this shouldnt have happened

Overall model fit: Classification table worse results

12 cases didn’t have a CHD while according to our model

this should have happened

Logistics of logistic regression worse results

- Estimate the coefficients
- Assess model fit
- Interpret coefficients
- Direction
- Significance
- Magnitude

- Check regression assumptions

Magnitude of association: worse results Percentage change in odds

Interpreting coefficients: direction worse results

original b reflects changes in logit: b>0 implies positive relationship

exponentiated b reflects the “changes in odds”: exp(b) > 1 implies a positive relationship

52

3. Interpreting coefficients: magnitude worse results

The slope coefficient (b) is interpreted as the rate of change in the "log odds" as X changes … not very useful.

exp(b) is the effect of the independent variable on the odds, more useful for calculating the size of an effect

53

For the age variable: worse results

Percentage change in odds = (exponentiated coefficient – 1) * 100 = 12%, or “the odds times 1,117”

A one unit increase in age will result in 12% increase in the odds that the person will have a CHD

So if a soccer player is one year older, the odds that (s)he will have CHD is 12% higher

Magnitude of associationRef=1

Ref=0

Another way to get an idea of the size of effects: worse results Calculating predicted probabilities

For somebody of 20 years old, the predicted probability is .04

For somebody of 70 years old, the predicted probability is .91

But this gets more complicated worse results when you have more than a single X-variable

(see blackboard)

Conclusion: if you consider the effect of a variable on the predicted probability, the size of the effect of X1 depends on the value of X2! (yuck!)

Advanced Methods and Models in Behavioral Research –

Testing significance of coefficients worse results

- In linear regression analysis this statistic is used to test significance
- In logistic regression something similar exists
- however, when b is large, standard error tends to become inflated, hence underestimation (Type II errors are more likely)

estimate

t-distribution

standard error of estimate

Note: This is not the WaldStatistic SPSS presents!!!

Interpreting coefficients: significance worse results

SPSS presents

While Andy Field thinks SPSS presents this (at least in the 2nd version of the book):

Advanced Methods and Models in Behavioral Research – worse results

Logistics of logistic regression worse results

- Estimate the coefficients
- Assess model fit
- Interpret coefficients
- Check regression assumptions

Checking assumptions worse results

- Influential data points & Residuals
- Follow Samanthas tips

- Hosmer & Lemeshow
- Divides sample in subgroups
- Checks whether there are differences between observed and predicted between subgroups
- Test should not be significant, if so: indication of lack of fit

Hosmer & Lemeshow worse results

Test divides sample in subgroups, checks whether difference between observed and predicted is about equal in these groups

Test should not be significant (indicating no difference)

Examining residuals in worse results logistic regression

- Isolate points for which the model fits poorly
- Isolate influential data points

Residual worse results statistics: Field’s rules of thumb

Time for a summary … worse results

Advanced Methods and Models in Behavioral Research –

Logistic regression worse results

- Y = 0/1
- Multiple regression (or ANcOVA) is not right
- You consider either the odds or the log(odds)
- It is estimated through “maximum likelihood”
- Interpretation is a bit more complicated than normal
- Assumption testing is a bit more concrete than in multiple regression

Advanced Methods and Models in Behavioral Research –

Advanced Methods and Models worse results in Behavioral Research

- Make sureto
- enroll in studyweb (0a611)
- Read the Field chapter on logisticregression
- Go through the slides as well
- Bringyour laptop next time: we’ll go through a logisticregression in Stata

Advanced Methods and Models in Behavioral Research – 2008/2009 68

Advanced Methods and Models in Behavioral Research –

Illustration with worse results SPSS (without the outlier part)

- Penalty kicks data, variables:
- Scored: outcome variable,
- 0 = penalty missed, and 1 = penalty scored

- Pswq: degree to which a player worries
- Previous: percentage of penalties scored by a particular player in their career

- Scored: outcome variable,

SPSS OUTPUT Logistic Regression worse results

Tells you something

about the number of

observations and

missings

this table is based on worse results

the empty model, i.e. only

the constant in the model

Block 0: Beginning Block

these variables

will be entered

in the model

later on

Block is useful to check significance of individual coefficients, see Field

Block 1: Method = Enter

this is the test statistic

Note: Nagelkerke

is larger than Cox

after dividing by -2

New model

Block 1: Method = Enter (Continued) coefficients, see Field

Predictive accuracy has improved (was 53%)

significance

based on

Wald statistic

estimates

change in odds

standard error

estimates

How is the classification table constructed? coefficients, see Field

# cases not predicted

corrrectly

# cases not predicted

corrrectly

How is the classification table constructed? coefficients, see Field

How is the classification table constructed? coefficients, see Field

Download Presentation

Connecting to Server..