Upgrade to Pro — share decks privately, control downloads, hide ads and more …

一般化線形混合モデル入門の入門/ An introduction to LME

Yu Tamura
December 06, 2014

一般化線形混合モデル入門の入門/ An introduction to LME

2014.12.6. Nagoya.R #12
外国語教育研究の仮想データを用いてRのlme4パッケージやlmerTestパッケージを使ってみるというような主旨の発表です。もともとslideshare ( https://www.slideshare.net/yutamura1/ss-42303827 )に資料をあげていたのですが,slideshareだとひと手間かけないと資料をダウンロードできなくなってしまったので,こちらにも同じ資料をあげることにしました。

Yu Tamura

December 06, 2014
Tweet

More Decks by Yu Tamura

Other Decks in Research

Transcript

  1. ಺༰ʹೖΔલʹ • ۙ೥ͷSLAݚڀ͸ྔతݚڀʹภΓ͕ͪ ʢMizumoto, Urano, & Maeda, 2014ʣ • ಛʹ෼ࢄ෼ੳʢANOVA)ͱt

    ݕఆ͕ଟ͍ʢ૲ಽɼ ਫຊˍ஛಺, 2014ʣ • ฏۉ஋ʹجͮ͘ύϥϝτϦοΫݕఆʹཔΓ͕ͪ ʢPlonsky, 2011; Plonsky & Gass, 2011)
  2. σʔληοτͱRͷεΫϦϓτ ΛआΓΔ࿦จ Cunnings, I. (2012). An overview of mixed-effects statistical

    models for second language researchers. Second Language Research, 28, 369-382.
  3. Ծ૝σʔλ • ඃݧऀ • 24ਓͷඇӳޠ฼ޠ࿩ऀʢେֶੜʣ˞L1͸ڞ༗ • ߲໨ • ӳޠʹ͓͚ΔओޠͱಈࢺͷҰகʢSubject-Verb Agreement)

    • ํ๏ • ༰ೝ౓λεΫ(Acceptability Judgment Task) • 1(unacceptable)-10(acceptable)ͰධՁ • 20ϖΞͷจ๏จɾඇจ๏จʢશ40จʣ • ϥϯμϚΠζͨ͠2छྨͷςετΛ࡞Γ20จʢG10ɾUG10ʣʹ෼͚Δ • RQɿจ๏จͱඇจ๏จͰ༰ೝ౓ʹҧ͍͕͋Δ͔
  4. ͳͥࠞ߹ޮՌϞσϧͳͷ͔ʁ • ݻఆޮՌͱͯ͠ಠཱม਺Λෳ਺ઃఆՄೳ • ΧςΰϦΧϧσʔλʢe.g., NS vs NNS, ߴख़ୡ౓ vs

    ௿ख़ ୡ౓ʣ • ࿈ଓσʔλʢe.g., ೥ྸɼख़ୡ౓ͱͯ͠ͷςετείΞʣ • ͋Δ͍͸྆ํͱ΋ • ैଐม਺ • ࿈ଓσʔλʢe.g., ೥ྸɼςετείΞɼ൓Ԡ࣌ؒʣ • ΧςΰϦΧϧσʔλʢจ๏ੑ൑அ, ༰ೝੑ൑அ etc.ʣ
  5. ͳͥࠞ߹ޮՌϞσϧͳͷ͔ʁ • ࢀՃऀͷֶੜ • ಉ͡ूஂ͔ΒαϯϓϦϯά͞Εֶͨੜ͕ҧ͏ Ϋϥεʹ͍Δ ฼ूஂA ฼ूஂB ΫϥεA ΫϥεB

    ΫϥεC ΫϥεD ΫϥεE ΫϥεG ੜె2 ੜె1 ੜె3 ੜె4 ੜె5 ੜె6 ੜెa ੜెb ੜెc ੜెd ੜెe
  6. ΍Γํ جຊతͳೖྗ๏͸ҎԼͷͱ͓Γʢx=ैଐม਺, y=ಠ ཱม਺ʢݻఆޮՌʣ, z=มྔޮՌ, dataʹ࢖͏σʔλ ηοτΛ͍ΕΔʣ >lmer(x ~ y

    + z, data=ratings) >model1 <- lmer(zrating ~ condition + (1|subject) + (1|item),data=ratings) ()಺ʹcrossed random effectsΛ͍ΕΔ conditionͰzratingʹҧ͍͕͋Δ͔ΛΈ͍ͨ ੾ย ઃఆ͢Δม਺
  7. ΍Γํ >model1 <- lmer(zrating ~ condition + (1|subject) + (1|item),data=ratings)

    • ্هͷϞσϧʹΑͬͯɼࢀՃऀͱ߲໨ΛϥϯμϜ ੾ยͱͯ͠૊ΈࠐΉ͜ͱ͕Ͱ͖ͨ →ࢀՃऀݸਓͷ܏޲ΛߟྀͰ͖Δ
  8. 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6

    0.8 1.0 ϥϯμϜ੾ย ܏͖͸ಉ͡Ͱ੾ย͕ҧ͏
  9. 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6

    0.8 1.0 ϥϯμϜ܏͖ ੾ย͸ಉ͡Ͱ܏͖͕ҧ͏
  10. 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6

    0.8 1.0 ϥϯμϜ܏͖&ϥϯμϜ੾ย ੾ย΋܏͖΋ҧ͏
  11. ͖ͭͮ • จ௕ͷݻఆޮՌ͸จ๏ੑʢconditionʣͱަޓ࡞༻͕͋Δ͔ ΋ʁ • ྫɿਖ਼จͩͱจ௕ͷӨڹ͕͋ͬͯɼඇจͩͱจ௕ͷӨڹ͕ ͳ͍ >model6 <- lmer(zrating

    ~ condition + clength + cprof + condition:clength + (1+condition|subject) + (1+condition| item),data=ratings) ίϩϯ͸ަޓ࡞༻
  12. ͖ͭͮ • ख़ୡ౓ͷݻఆޮՌ͸จ๏ੑʢconditionʣͱަޓ࡞༻͕͋Δ ͔΋ʁ • ྫɿਖ਼จͩͱख़ୡ౓ͷӨڹ͕͋ͬͯɼඇจͩͱख़ୡ౓ͷӨ ڹ͕ͳ͍ >model7 <- lmer(zrating

    ~ condition + clength + condition:clength + condition:cprof + (1+condition|subject) + (1+condition| item),data=ratings) ίϩϯ͸ަޓ࡞༻
  13. ͖ͭͮ • ΋͔͢͠Δͱɼจ௕ͱख़ୡ౓΋ަޓ࡞༻͋Δ͔΋ʁ • ྫɿख़ୡ౓͕ߴ͍ͱจ௕ͷӨڹ͕ͳͯ͘ɼख़ୡ౓͕ ௿͍ͱจ௕ͷӨڹ͕͋Δ >model8 <- lmer(zrating ~

    condition + clength + condition:clength + condition:cprof + clength:cprof + (1+condition|subject) + (1+condition|item),data=ratings) ίϩϯ͸ަޓ࡞༻
  14. ͖ͭͮ • ߟ͑ΒΕΔ3ͭͷཁҼͷ͢΂ͯͷݻఆޮՌͱަޓ ࡞༻Λ͍ΕΔͱ͖ʹ͸ΞελϦεΫ(*)Λ࢖͏ >model9 <- lmer(zrating ~ condition *

    clength * cprof + (1+condition|subject) + (1+condition|item),data=ratings) ΞελϦεΫ͸ߟ͑ΒΕΔ͢΂ͯͷཁҼͷݻఆޮՌͱަޓ࡞༻ condition*clength͸ɼcondition + clength +condition:clengthͱಉ͡
  15. t஋͔Βp஋Λܭࢉ • t෼෍ͷ෼෍ؔ਺Ͱ͋Δpt()ؔ਺Λ࢖͏ • 2 * (1 - pt(abs(t஋), σʔλ਺

    - ݻఆޮՌͷ਺)) • จ๏ੑͷӨڹ > 2 * (1 - pt(abs(-4.980), 480 - 3)) • จ௕ͷӨڹ > 2 * (1 - pt(abs(-2.151), 480 - 3))
  16. t஋͔Βp஋Λܭࢉ • t෼෍ͷ෼෍ؔ਺Ͱ͋Δpt()ؔ਺Λ࢖͏ • 2 * (1 - pt(abs(t஋), σʔλ਺

    - ݻఆޮՌͷ਺)) • ͨͩ͜͠ͷํ๏ͩͱɼσʔλ਺͕গͳ͍ͱ༗ҙ͕ࠩͰ ΍͘͢ͳΔͷͰ஫ҙʢType Ⅰ errorͷةݥੑʣ
  17. ࢀߟจݙ Baayen, R. H. (2008). Analyzing linguistic data. A practical

    introduction to statistics using R. Baayen H,, Davidson D,, & Bates, D. (2008). Mixed-effects modeling with crossed random effects for subjects and items. Journal of Memory and Language, 59, 390–412. Clark, H. (1973). The language-as-fixed-effect fallacy: A critique of language statistics in psychology research. Journal of Verbal Learning and Verbal Behavior 12: 335–59. Cunnings, I. (2012). An overview of mixed-effects statistical models for second language researchers. Second Language Research, 28, 369-382. Jaeger, F. (2008). Categorical data analysis: Away from ANOVAs (transformation or not) and towards logit mixed models. Journal of Memory and Language 59: 434–46. ૲ಽ๜޿ɾਫຊಞɾ஛಺ཧ.(2014)ɹʮ೔ຊͷ֎ࠃޠڭҭݚڀʹ͓͚ΔޮՌྔɾݕఆྗɾඪຊαΠζ: Language Education & Technologyܝࡌ࿦ จΛର৅ʹͨ͠ࣄྫ෼ੳʯୈ54ճ֎ࠃޠڭҭϝσΟΞֶձશࠃݚڀେձ, ෱Ԭେֶ ٱอ୓໻ (2012) σʔλղੳͷͨΊͷ౷ܭϞσϦϯάೖ໳: ҰൠԽઢܗϞσϧɾ֊૚ϕΠζϞσϧɾMCMC. ؠ೾ॻళ. Mizumoto, A., Urano, K., & Maeda, H. (2014). A systematic review of published articles in ARELE 1-24: Focusing on their themes, methods, and outcomes. Annual Review of English Language Education, 25, 33-48. Plonsky, L. (2011) Study quality in SLA: A cumulative and developmental assessment of designs, analyses, reporting practices, and outcomes in quantitative L2 research. Unpublished doctoral thesis, Michigan State University, MI, USA. Plonsky, L., $ Gass, S. (2011). Quantitative research methods, study quality, and outcomes: The case of interaction research. Language Learning, 61, 325–66. Quene, H., & van den Bergh, H. (2008). Examples of mixed-effects modelling with crossed random effects and with binomial data. Journal of Memory and Language, 59, 413–25. ਗ਼ਫ༟࢜ (2014) ݸਓͱूஂͷϚϧνϨϕϧ෼ੳ. φΧχγϠग़൛.