Skip to content

Instantly share code, notes, and snippets.

@drammock
Last active August 29, 2015 14:23
Show Gist options
  • Save drammock/bf7a6d634bbd179b328f to your computer and use it in GitHub Desktop.
Save drammock/bf7a6d634bbd179b328f to your computer and use it in GitHub Desktop.
issues setting up cumulative-link mixed model
## "reduction" is the response variable (ordered factor, none < devoiced < deleted)
table(cleandata$reduction)
## none devoiced deleted
## 20776 360 420
## "speaker" is a nuisance predictor, which I intend to model as a random effect
with(cleandata, table(reduction, speaker))
## speaker
## reduction F1 F2 F3 M1 M2 M3
## none 3559 3482 3325 3569 3360 3481
## devoiced 9 48 123 25 105 50
## deleted 15 50 160 5 123 67
## "word" will be modeled as a random effect (1204 levels, 8-18 obs. per word, i.e. 0-3 obs. per speaker per word).
table(with(cleandata, table(word)))
## 8 11 13 14 15 16 17 18
## 1 1 3 4 6 6 38 1145
## vowel is not exactly a nuisance predictor, but also not the chief interest
with(cleandata, table(reduction, vowel))
## vowel
## reduction ɐ ɪ ʊ æ ǝ i o ɔ œ u
## none 4129 566 3156 276 3038 1672 2342 3151 356 2090
## devoiced 138 4 39 20 22 24 23 54 3 33
## deleted 135 6 40 9 36 62 31 50 1 50
## preceding and following consonant type are what we really care about
with(cleandata, table(reduction, precedingCons))
## precedingCons
## reduction glide liquid nasal fric affric stop
## none 780 322 3258 5304 3300 7812
## devoiced 13 0 11 92 111 133
## deleted 12 0 12 126 111 159
with(cleandata, table(reduction, precedingCons))
## followingCons
## reduction glide liquid nasal fric affric stop
## none 4368 1963 3234 4145 5037 2029
## devoiced 87 58 124 51 24 16
## deleted 112 95 129 39 32 13
## following consonant has a complicating factor that we also want to model:
## whether or not it is intervocalic (i.e., is the consonant-vowel pattern
## CvCV... or CvCC... where lower-case v is the vowel that may have been reduced).
## this is called "coda" and is true for the CvCC... pattern.
ftable(with(cleandata, table(reduction, followingCons, coda)))
## coda FALSE TRUE
## reduction followingCons
## none gli 993 1036
## liq 2380 2657
## nas 1021 3124
## fri 1681 1553
## afr 1021 942
## stp 1868 2500
## devoiced gli 1 15
## liq 4 20
## nas 18 33
## fri 71 53
## afr 29 29
## stp 44 43
## deleted gli 5 8
## liq 5 27
## nas 12 27
## fri 81 48
## afr 60 35
## stp 64 48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment