如何解决LMER测试来自何处?
我正在尝试对数据集(原始数据附加)执行LMER测试,所有列的行数相同(153)。但是,当我尝试拟合公式时,它给我一个错误
错误:每个分组因子的级别数必须为
dpun <- lmer (C2 ~ Consonant + Place + (1|Filename),data = pun_data)
即使更改固定和随机因素,该错误仍然相同。 “文件名”列指定了讲话者,而“ V1”,“ C2”和“ V2”列是“文件名”列中讲话者说出的测试词中辅音和元音的持续时间。
我的数据:
"Filename","Consonant","Manner","Voicing","Place","Gender","Beforevowel","C2.xsampa","C2","V1.xsampa","V1","V2.xsampa","V2"
"AK_chape.TextGrid","Singleton","Stop","Voiceless","Bilabial","F","Short","p",0.080042611,"@",0.059323219,"e:",0.090162588
"DS_chape.TextGrid","M",0.084378223,0.070595707,0.077437615
"MS_chape.TextGrid",0.083394356,0.068241136,"e: ",0.075200995
"NS_chape.TextGrid",0.088423147,0.064472947,0.082275418
"PS_chape.TextGrid",0.083825511,0.068070108,0.088299906
"RB_chape.TextGrid",0.03153568,0.072380665,0.093256049
"RJ_chape.TextGrid",0.059901696,0.074511565,0.086348038
"RL_chape.TextGrid",0.053055919,0.068229353,0.106420617
"RR_chape.TextGrid",0.05598852,0.106420617
"RS_chape.TextGrid",0.087676077,0.06156503,0.119033444
"RS1_chape.TextGrid",0.065995738,0.095309543
"SD_chape.TextGrid",0.108000723,0.067095676,0.075882479
"SK_chape.TextGrid",0.088362331,0.074699013,0.093881287
"SS2_chape.TextGrid",0.121307068,0.05314411,0.080787887
"SS_chape.TextGrid",0.094495163,0.057527086,0.1158376
"VG_chape.TextGrid",0.095932888,0.045631368,0.107748222
"VS_chape.TextGrid",0.0750986,0.0565392,0.096957258
"YP_chape.TextGrid",0.065231908,0.035393865,0.094684148
"AK_chappe.TextGrid","Geminate","p:",0.164554347,0.049063492,0.086199108
"DS_chappe.TextGrid",0.193487061,0.042937931,0.092506693
"MS_chappe.TextGrid",0.297477548,0.063837869,0.102937129
"PS_chappe.TextGrid",0.109370911,0.058301146,0.093773011
"RB_chappe.TextGrid",0.141575459,0.106805666
"RJ_chappe.TextGrid",0.120253656,0.075551945,0.079540514
"RL_chappe.TextGrid",0.126627788,0.046278333,0.079540514
"RR_chappe.TextGrid",0.144371796,0.055158945,0.053715922
"RS_chappe.TextGrid",0.171831708,0.035605235,0.097907127
"RS1_chappe.TextGrid",0.060864579,0.073781959
"SD_chappe.TextGrid",0.254818455,0.053464241,0.090889208
"SK_chappe.TextGrid",0.404017147,0.051295513,0.113892205
"VG_chappe.TextGrid",0.213768279,"U",0.073607761,0.109098312
"VS_chappe.TextGrid",0.208510537,0.06207953,0.090199928
"YP_chappe.TextGrid",0.179598742,0.05855083,0.109084841
"AK_kute.TextGrid","Dental/alveolar","t_d",0.05494054,0.096553556
"DS_kute.TextGrid",0.081345232,0.056651242,0.110866036
"MS_kute.TextGrid",0.066463105,0.069207283,0.083045533
"NS_kute.TextGrid",0.070069095,0.054456087,0.111350674
"PS_kute.TextGrid",0.066922298,0.047966444,0.088541492
"RB_kute.TextGrid",0.028220445,0.058493475,0.091924885
"RJ_kute.TextGrid",0.063985902,0.070652569,0.091924885
"RL_kute.TextGrid",0.070664851,0.127421821
"RR_kute.TextGrid",0.08713925,0.077999019,0.049593667
"RS_kute.TextGrid",0.076540283,0.042945242,0.076702926
"RS1_kute.TextGrid",0.041665787,0.058846014
"SD_kute.TextGrid",0.096503291,0.044968093,0.103459332
"SK_kute.TextGrid",0.075648312,0.059050244,0.089452658
"SS2_kute.TextGrid",0.085225473,0.039207081,0.115078727
"SS_kute.TextGrid",0.087304762,0.048676863,0.113500882
"VG_kute.TextGrid",0.071314559,0.038559587,0.099234229
"VS_kute.TextGrid",0.06382568,0.040247242,0.117456237
"YP_kute.TextGrid",0.070885475,0.047615098,0.11321812
"AK_kutte.TextGrid","t_d:",0.197175146,0.044980788,0.076704079
"DS_kutte.TextGrid",0.188453944,0.033653182,0.117986452
"MS_kutte.TextGrid",0.315141346,0.040246986,0.115527864
"PS_kutte.TextGrid",0.123376007,0.047676131,0.106225766
"RB_kutte.TextGrid",0.130207542,0.05322383,0.096120187
"RJ_kutte.TextGrid",0.129805129,0.048369155,0.096120187
"RL_kutte.TextGrid",0.29711073,0.046901222,0.117985886
"RS_kutte.TextGrid",0.151077251,0.032514631,0.06616236
"RS1_kutte.TextGrid",0.155931926,0.044997447,0.061196529
"SD_kutte.TextGrid",0.200307302,0.033319666,0.091199279
"SK_kutte.TextGrid",0.61709581,0.036363455,0.122806769
"VS_kutte.TextGrid",0.197066467,0.036830765,0.096870754
"YP_kutte.TextGrid",0.159100337,0.057985668,0.126980484
"AK_fati.TextGrid","Retroflex","t`",0.08422198,0.055312929,"i:",0.123438846
"MS_fati.TextGrid",0.101303456,0.031297441,0.119326769
"NS_fati.TextGrid",0.07964081,0.062462805,0.081596899
"PS_fati.TextGrid",0.059878136,0.052763106,0.091024488
"RB_fati.TextGrid",0.052763105,0.050238671,0.087581268
"RJ_fati.TextGrid",0.079189768,0.059023408,0.084298787
"RL_fati.TextGrid",0.070860979,0.066604374,0.11954347
"RR_fati.TextGrid",0.072826928,0.054070654,0.085732967
"RS_fati.TextGrid",0.083737739,0.071513683
"RS1_fati.TextGrid",0.050450539,0.071513683
"SK_fati.TextGrid",0.090034808,0.047104732,0.076840052
"SS2_fati.TextGrid",0.114043034,0.041793764,0.062806309
"SS_fati.TextGrid",0.07074892,0.044585039,0.068836788
"YP_fati.TextGrid",0.065094155,0.058838506,0.105220691
"AK_fatti.TextGrid","t`:",0.15216855,0.049362393,0.102798309
"DS_fatti.TextGrid",0.15856267,0.047868677,0.100846991
"MS_fatti.TextGrid",0.154153364,0.035076215,0.08416162
"NS_fatti.TextGrid",0.142475787,0.065367528,0.112987637
"PS_fatti.TextGrid",0.136898376,0.046253072,0.092946883
"RB_fatti.TextGrid",0.113903317,0.050472582,0.07260641
"RJ_fatti.TextGrid",0.119362767,0.057295,0.076093764
"RL_fatti.TextGrid",0.126923697,0.061567024,0.097976188
"RR_fatti.TextGrid",0.153710992,0.103590766
"RS_fatti.TextGrid",0.132728908,0.067103253,0.08035696
"RS1_fatti.TextGrid",0.04666169,0.08035696
"SD_fatti.TextGrid",0.152788943,0.050818998,0.092863089
"SK_fatti.TextGrid",0.272622313,0.033670525,0.08004031
"AK_katha.TextGrid","t_d_h",0.087118953,0.036376071,0.082733291
"DS_katha.TextGrid",0.126160778,0.040144076,0.086742939
"MS_katha.TextGrid",0.107629914,0.033544421,0.10096529
"NS_katha.TextGrid",0.131042335,0.06168022,"A:",0.113864323
"PS_katha.TextGrid",0.088907986,0.039033887,0.091561501
"RB_katha.TextGrid",0.051822364,0.063166253,0.092727311
"RJ_katha.TextGrid",0.080087856,0.055632832,0.080853799
"RL_katha.TextGrid",0.079770811,0.047300211,0.119600052
"RR_katha.TextGrid",0.127387134,0.059215612,0.102882635
"RS_katha.TextGrid",0.084381417,0.053924615,0.087612889
"RS1_katha.TextGrid",0.062804201,0.078151615
"SD_katha.TextGrid",0.120000337,0.085234274
"SK_katha.TextGrid",0.151374378,0.042088581,0.085234274
"SS2_katha.TextGrid",0.144031531,0.04602191,0.082569039
"SS_katha.TextGrid",0.126531003,0.034761264,0.055636406
"VG_katha.TextGrid",0.089339028,0.063813591,0.052626905
"VS_katha.TextGrid",0.128549141,0.071296162,0.052837123
"YP_katha.TextGrid",0.097070908,0.063461999,0.102101745
"DS_kattha.TextGrid","t_d_h:",0.184249058,0.047437072,0.084259102
"MS_kattha.TextGrid",0.152593152,0.052644637,0.101510403
"PS_kattha.TextGrid",0.165796687,0.065207188,0.099078116
"RB_kattha.TextGrid",0.156506556,0.04763243,0.096438871
"RJ_kattha.TextGrid",0.179683984,0.048679326,0.091327113
"RL_kattha.TextGrid",0.1724127,0.033815767,0.096020931
"RR_kattha.TextGrid",0.178429235,0.049143645,0.076598351
"RS_kattha.TextGrid",0.17675932,0.043693337,0.096938533
"RS1_kattha.TextGrid",0.095857832
"SD_kattha.TextGrid",0.232421525,0.06588677,0.095857832
"SK_kattha.TextGrid",0.727669604,0.040088857,0.076598351
"VS_kattha.TextGrid",0.205216779,0.034612947,0.062849824
"YP_kattha.TextGrid",0.172436825,0.035673669,0.065401727
"AK_saka.TextGrid","Velar","k",0.082999095,0.045966546,0.099594185
"DS_saka.TextGrid",0.079832433,0.055432118,0.081379067
"MS_saka.TextGrid",0.074699608,0.051555896,0.104549295
"NS_saka.TextGrid",0.071537008,0.054760697,0.114918
"RB_saka.TextGrid",0.035037395,0.055258074,0.104823813
"RJ_saka.TextGrid",0.070894219,0.05205498,0.077971282
"RL_saka.TextGrid",0.061954928,0.041357333,0.102834449
"RR_saka.TextGrid",0.064012585,0.053160186,0.079136186
"RS_saka.TextGrid",0.071062478,0.066267591,0.0733936
"RS1_saka.TextGrid",0.051256034,0.084360146
"SD_saka.TextGrid",0.082993345,0.050863099,0.085928502
"SK_saka.TextGrid",0.046994992,0.085928502
"SS2_saka.TextGrid",0.090827886,0.072159193,0.117426754
"SS_saka.TextGrid",0.068736897,0.04886283,0.072795644
"VS_saka.TextGrid",0.093149901,0.051090687,0.063863358
"YP_saka.TextGrid",0.065983106,0.039051862,0.067162304
"AK_sakka.TextGrid","k:",0.201309756,0.039380446,0.116549955
"DS_sakka.TextGrid",0.174189197,0.05179998,0.117704
"MS_sakka.TextGrid",0.136923826,0.039745773,0.109633842
"NS_sakka.TextGrid",0.169887835,0.053065367,0.091358116
"RB_sakka.TextGrid",0.135643631,0.05894072,0.109867582
"RJ_sakka.TextGrid",0.126292848,0.028484188,0.093634597
"RL_sakka.TextGrid",0.123301982,0.043527435,0.100481172
"RR_sakka.TextGrid",0.136636945,0.042886721,0.110322392
"RS1_sakka.TextGrid",0.136547834,0.039039127,0.092461091
"SD_sakka.TextGrid",0.152384501,0.046993736,0.088398365
"SK_sakka.TextGrid",0.129634718,0.032654821,0.082928171
"SS2_sakka.TextGrid",0.128603978,0.031685037,0.068961553
"SS_sakka.TextGrid",0.162946091,0.032649124,0.091058109
"VG_sakka.TextGrid",0.131130854,0.04834749,0.114825291
"YP_sakka.TextGrid",0.12967303,0.047719675,0.101663656
解决方法
假设您想让说话者具有随机效果,并进一步假设文件名实际上是根据说话者的姓名缩写和口语音素来标记的,那么您需要使用缩写仅在第一列显示您的随机效果。否则,您在随机效果的每个级别上只有一个观察结果,这没有多大意义。
因此,如果您这样做:
dpun <- lmer (C2 ~ Consonant + Place + (1|Filename),data = within(pun_data,Filename <- substr(Filename,1,2)))
然后您将得到一个明智的结果:
summary(dpun)
#> Linear mixed model fit by REML ['lmerMod']
#> Formula: C2 ~ Consonant + Place + (1 | Filename)
#> Data: within(pun_data,2))
#>
#> REML criterion at convergence: -382.5
#>
#> Scaled residuals:
#> Min 1Q Median 3Q Max
#> -2.1938 -0.3797 -0.1103 0.2766 7.2708
#>
#> Random effects:
#> Groups Name Variance Std.Dev.
#> Filename (Intercept) 0.001161 0.03408
#> Residual 0.003385 0.05818
#> Number of obs: 153,groups: Filename,16
#>
#> Fixed effects:
#> Estimate Std. Error t value
#> (Intercept) 0.19071 0.01429 13.347
#> ConsonantSingleton -0.10551 0.00963 -10.956
#> PlaceDental/alveolar 0.01575 0.01256 1.254
#> PlaceRetroflex -0.02201 0.01525 -1.443
#> PlaceVelar -0.03163 0.01468 -2.155
#>
#> Correlation of Fixed Effects:
#> (Intr) CnsnnS PlcDn/ PlcRtr
#> CnsnntSnglt -0.371
#> PlcDntl/lvl -0.561 -0.028
#> PlaceRtrflx -0.479 0.021 0.538
#> PlaceVelar -0.504 0.033 0.557 0.467
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。