![Page 1: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/1.jpg)
Ordinal (yet again)
Sarah Medland – Boulder 2010
![Page 2: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/2.jpg)
This morning
Fitting the regression model with ordinal data
Factor Modelling Continuous Ordinal
![Page 3: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/3.jpg)
Including covariates
At the moment No missingness allowed in the
covariates If the person who is missing the cov is
also missing the phenotype(s) being modelled - ie incomplete twin pair
Replace with the mean
![Page 4: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/4.jpg)
From Tuesday...
Thresholds T ; 11t
Standard normal distribution
Mean = 0
SD =1
Non Smokers =53%
Threshold =.074
![Page 5: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/5.jpg)
How about age/sex correction? threshold_age_sex.R
![Page 6: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/6.jpg)
How about age/sex correction? threshold_age_sex.R
![Page 7: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/7.jpg)
AgeSexRucThresh expThresh
SexSexAgeAgeAgeSexR
![Page 8: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/8.jpg)
How about age/sex correction? threshold_age_sex.R
![Page 9: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/9.jpg)
What does this mean?
Age Beta = .007 For every 1 unit increase in Age the
threshold shifts .007
![Page 10: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/10.jpg)
What does this mean?
Beta = .007 Threshold is -.1118
38 is +1.38 SD from the mean age The threshold for 38 year olds
is: .1544= -.1118 + .007*38 22 is -1.38 SD from the mean age
The threshold for 38 year olds is: .0422= -.1118 + .007*22
![Page 11: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/11.jpg)
22 year olds
Threshold = .0422
38 year olds
Threshold =.1544
Is the age effect significant?
![Page 12: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/12.jpg)
How to interpret this
The threshold moved slightly to the right as age increases
This means younger people were more likely to have tried smoking than older people But this was not significant
![Page 13: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/13.jpg)
22 year olds
Threshold = .548
38 year olds
Threshold = 1.028
Is the age effect significant?
If Beta = .03
![Page 14: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/14.jpg)
How about the sex effect
Beta = -.05 Threshold = -.1118 Sex coded Male = 1, Female = 0
So the Male threshold is: -.1618= -.1118 + 1*-.05
The Female threshold is: -.1118 =-.1118 + 0*-.05
![Page 15: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/15.jpg)
Female
Threshold =-.1118
Male
Threshold =-.1618
Are males or females more likely to smoke?
![Page 16: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/16.jpg)
Both effects together
38 year old Males: .1042=-.1118 + 1*-.05 + .007*38
38 year old Females: .1542=-.1118 + 0*-.05 + .007*38
22 year old Males: -.0078=-.1118 + 1*-.05 + .007*22
22 year old Females: .0422=-.1118 + 0*-.05 + .007*22
![Page 17: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/17.jpg)
Polychotomous Data?
![Page 18: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/18.jpg)
Binary Data… adding a regression
51.6%
.0422
0422.
05.*1007.*221118.
(Male) 1Sex and 22ifAge
05.*007.*1118.
AgeSexRucThresh expThresh
SexSexAgeAgeAgeSexR
SexAge
![Page 19: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/19.jpg)
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 20: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/20.jpg)
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 21: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/21.jpg)
L*T + G@(B*D) =
11 * 1 * 1
( 11 21) * 1 * 1
t sex sex age age
t t sex sex age age
Adding a regression
AgeSexRDuplicate
ucThreshL expThresh
1)maxthresh,(unit 1
1 Duplicate
SexSexAgeAgeAgeSexR
![Page 22: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/22.jpg)
Multivariate models?
![Page 23: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/23.jpg)
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 24: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/24.jpg)
Factor Analysis….
Our data (simulated) Five variables – Three traits Depression, Anxiety & Stress Transformed to Z-scores
![Page 25: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/25.jpg)
In Spss…
![Page 26: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/26.jpg)
And we get…
![Page 27: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/27.jpg)
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 28: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/28.jpg)
What if our data was ordinal?
Depression Yes/No 0/1
Anxiety and Stress Low / Average / High 0/1/2
![Page 29: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/29.jpg)
Spss says no
![Page 30: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/30.jpg)
Factor Analysis
Suppose we asked people in a nightclub what their favourite drinks were Series of binary variables
South Hendriks Aviator
C
R1 R2 R3
Saphire
R4
![Page 31: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/31.jpg)
OrdinalFactors.r
![Page 32: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/32.jpg)
Adding Sex and Age effects
![Page 33: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/33.jpg)
Setting up the factor model and the ‘residual’ thresholds
![Page 34: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/34.jpg)
AgeSexRDuplicate
ucThreshL expThresh
1)maxthresh,(unit 1
1 Duplicate
SexSexAgeAgeAgeSexR
![Page 35: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/35.jpg)
Deliberate Error...
CODE RED Do NOT pass go do NOT collect $200
Change start values in script Use values in the code red solution as a
guide mxMatrix( type="Full", nrow=maxthresh,
ncol=nvar, free=TRUE, values=c(0,-.7,.6,-.5), lbound=-4,name="cutpoints"),
![Page 36: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/36.jpg)
Other useful things...
![Page 37: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/37.jpg)
Debugging
check.r Can check algebra etc without including
data
![Page 38: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/38.jpg)
Ploting etc using mxEval
![Page 39: Ordinal (yet again) Sarah Medland – Boulder 2010](https://reader035.vdocuments.mx/reader035/viewer/2022070400/56649eca5503460f94bd83fa/html5/thumbnails/39.jpg)
Goodbye & Good Luck