Attachment 'graff-script.R'
Download 1 #You will have to have languageR and Design installed to run this code.
2
3 library(languageR)
4 library(Design)
5
6 lrm = lrm(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+LengthOfTheme,data=verbs)
7 lrm
8 glm = glm(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+LengthOfTheme,data=verbs,family="binomial")
9 summary(glm)
10 lmer = lmer(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+LengthOfTheme+(1|Verb),data=verbs,family="binomial")
11 lmer
12
13 #LRM Stepwise
14
15 anova(lrm)
16
17 #LRM Comparison
18
19 lrm = lrm(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+LengthOfTheme,data=verbs)
20 lrm.length = lrm(RealizationOfRec~LengthOfTheme,data=verbs)
21 lrm.animac = lrm(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme,data=verbs)
22
23 dchisq(deviance(lrm.length)[2]-deviance(lrm)[2],lrm$stat[4]-lrm.length$stat[4])
24 dchisq(deviance(lrm.animac)[2]-deviance(lrm)[2],lrm$stat[4]-lrm.animac$stat[4])
25
26 #LMER Comparison
27
28 lmer = lmer(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+LengthOfTheme+(1|Verb),data=verbs,family="binomial")
29 lmer.length = lmer(RealizationOfRec~LengthOfTheme+(1|Verb),data=verbs,family="binomial")
30 lmer.animac = lmer(RealizationOfRec~AnimacyOfRec+AnimacyOfTheme+(1|Verb),data=verbs,family="binomial")
31
32 anova(lmer,lmer.length)
33 anova(lmer,lmer.animac)
34
35 d=read.csv(file="PluralComparisonMontreal.csv",header=T)
36
37 head(d)
38
39 #Your turn! Go nuts!
40
41 lmer(resp~(1|as.factor(d$subj))+(1|as.factor(d$item))+(1|as.factor(d$order))
42 +MatuRuys
43 +catMean
44 +probMean
45 ,data=d,family="binomial")
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.