ordinal data, matrix algebra & factor analysis

33
Ordinal data, matrix algebra & factor analysis Sarah Medland – Boulder 2008 Thursday morning

Upload: saxon

Post on 12-Jan-2016

55 views

Category:

Documents


2 download

DESCRIPTION

Ordinal data, matrix algebra & factor analysis. Sarah Medland – Boulder 2008 Thursday morning. This morning. Fitting the regression model with ordinal data Factor Modelling Continuous Ordinal. Binary Data… 1 variable. Standard normal distribution Mean = 0 SD =1 Non Smokers =53% - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Ordinal data, matrix algebra & factor analysis

Ordinal data, matrix algebra & factor analysis

Sarah Medland – Boulder 2008Thursday morning

Page 2: Ordinal data, matrix algebra & factor analysis

This morning

Fitting the regression model with ordinal data

Factor Modelling Continuous Ordinal

Page 3: Ordinal data, matrix algebra & factor analysis

Binary Data… 1 variable

Thresholds T ; 11t

Standard normal distribution

Mean = 0

SD =1

Non Smokers =53%

Threshold =.074

Page 4: Ordinal data, matrix algebra & factor analysis

Binary Data… adding a regression

Thresholds T + D*B ;

11

11

*

* *

.1118 *.007 * .050

if Age = 22 and Sex =1 (Male)

.1118 (22*.007) (1* .050)

.0422

age sex

age sex

Aget

Sex

t Age Sex

Age Sex

51.6%

.0422

Page 5: Ordinal data, matrix algebra & factor analysis

What about more than 2 categories?

Thresholds = L*T;

~15% in each tail Thresholds:

~-1.03 ~1.03

anxiety

153 15.3 15.3 15.3

710 71.0 71.0 86.3

137 13.7 13.7 100.0

1000 100.0 100.0

.00

1.00

2.00

Total

ValidFrequency Percent Valid Percent

CumulativePercent

Displacement = ~2.06

Page 6: Ordinal data, matrix algebra & factor analysis

What about more than 2 categories?

Thresholds = L*T;

11

21

11 21

11 21

1 0*

1 1

1* 0*

1* 1*

1.03

1.03 2.06

1.03

1.03

t

t

t t

t t

~15% in each tail Thresholds:

~-1.03 ~1.03

Displacement = ~2.06

Page 7: Ordinal data, matrix algebra & factor analysis

Adding a regression

L*T + G@(D*B);

maxth =2, ndef=2, nsib=1, nthr=2

1G D B

1

sexsex age

age

Page 8: Ordinal data, matrix algebra & factor analysis

Adding a regression

B*D = * 1 * 1sex sex age age

* 1 * 1G@(B*D) =

* 1 * 1

sex sex age age

sex sex age age

1G D B

1

sexsex age

age

Page 9: Ordinal data, matrix algebra & factor analysis

Adding a regression

L*T + G@(B*D) =

11 * 1 * 1

( 11 21) * 1 * 1

t sex sex age age

t t sex sex age age

Page 10: Ordinal data, matrix algebra & factor analysis

Multivariate Threshold Models

Specification in Mx

Thanks Kate Morley for these slides

Page 11: Ordinal data, matrix algebra & factor analysis

#define nsib 1 ! number of siblings = 1#define maxth 2 ! Maximum number of thresholds#define nvar 2 ! Number of variables#define ndef 1 ! Number of definition variables#define nthr 2 ! nsib x nvar

T Full maxth nthr Free ! ThresholdsB Full nvar ndef Free ! Regression betasL lower maxth maxth ! For converting incremental to cumulative thresholdsG Full maxth 1 ! For duplicating regression betas across thresholdsK Full ndef nsib ! Contains definition variables

Thresholds = L*T +G@((\vec(B*K))’)

Page 12: Ordinal data, matrix algebra & factor analysis

Threshold model for multivariate, multiplecategory data with definition variables:

We will break the algebra into two parts:1 - Definition variables;2 - Uncorrected thresholds;and go through it in detail.

Part 1Part 2

L*T +G@((\vec(B*K))’)

Page 13: Ordinal data, matrix algebra & factor analysis

Threshold correctionTwin 1Variable 1

Threshold correctionTwin 1Variable 2

Twin 1 Twin 2Definitionvariables

Threshold correctionTwin 2Variable 2

Threshold correctionTwin 2Variable 1

Page 14: Ordinal data, matrix algebra & factor analysis

Transpose:

Page 15: Ordinal data, matrix algebra & factor analysis
Page 16: Ordinal data, matrix algebra & factor analysis

Thresholds 1 & 2Twin 1Variable 1 Thresholds 1 & 2

Twin 1Variable 2

Thresholds 1 & 2Twin 2Variable 1

Thresholds 1 & 2Twin 2Variable 2

Page 17: Ordinal data, matrix algebra & factor analysis

=

Page 18: Ordinal data, matrix algebra & factor analysis

Factor Analysis

Suppose we have a theory that the covariation between self reports of depression, anxiety and stress levels is due to one underlying factor

Depression Anxiety Stress

C

R1 R2 R3

Page 19: Ordinal data, matrix algebra & factor analysis

Factor Analysis….

Our data (simulated) Five variables – Three traits Depression, Anxiety & Stress Transformed to Z-scores

Page 20: Ordinal data, matrix algebra & factor analysis

In Spss…

Page 21: Ordinal data, matrix algebra & factor analysis

And we get…

Page 22: Ordinal data, matrix algebra & factor analysis

c_factor.mx

Page 23: Ordinal data, matrix algebra & factor analysis

c_factor.mx

. . .

. . . . .

. .

2. . . .

2. . . .

.

C=L*L'+R*R'

0 0 0 0

* 0 0 * 0 0

0 0 0 0

. .

. .

.

dep dep dep

anx dep anx stress dep dep

stress dep dep

dep dep anx dep stress

dep anx anx anx stress

dep stress

l r r

l l l l r r

l r r

l l l l l

l l l l l

l l l

2.

2.

2 2. .

2 2. . . . .

2 2. . . . .

2 2. . .

0 0

0 0

. 0 0

. .

. .

. .

dep

dep

anx stress stress dep

dep dep dep anx dep stress

dep anx anx anx anx stress

dep stress anx stress stress anx

r

r

l l r

l r l l l l

l l l r l l

l l l l l r

Page 24: Ordinal data, matrix algebra & factor analysis

c_factor.mx

Plus a standardisation group so that our estimates can be compared to those from spss

Page 25: Ordinal data, matrix algebra & factor analysis

What do we get?Factor Matrixa

.880

.639

.565

depression

anxiety

stress

1

Factor

Extraction Method: Maximum Likelihood.

1 factors extracted. 5 iterations required.a.

Page 26: Ordinal data, matrix algebra & factor analysis

What if our data was ordinal?

Depression Yes/No 0/1

Anxiety and Stress Low / Average / High 0/1/2

Page 27: Ordinal data, matrix algebra & factor analysis

Spss says no

Page 28: Ordinal data, matrix algebra & factor analysis

Mx can do this

Data file: ord.dat Five variables ID, Depression, Anxiety, Stress, Sex

Data is sorted to make it run faster!!!

Script file: o_factor.mx

Page 29: Ordinal data, matrix algebra & factor analysis

O_factor.mx

Page 30: Ordinal data, matrix algebra & factor analysis

O_factor.mx

Set to 0 because depression has 2 categories

Page 31: Ordinal data, matrix algebra & factor analysis

O_factor.mx

Page 32: Ordinal data, matrix algebra & factor analysis

Answer

Ordinal data Continuous data

Difference due to loss of information with ordinal data & slightly different fit function

Page 33: Ordinal data, matrix algebra & factor analysis

If we have time

Test to see if adding another factor improves the fit