做HLM一些注意點(diǎn)【沐風(fēng)教育】
做做HLM的一些注意點(diǎn)的一些注意點(diǎn)賈良定1嚴(yán)選1HLM中選項(xiàng)中選項(xiàng)nHLM other setting 選:Controlling estimationFull maximum likelihood2嚴(yán)選1注意注意1.Restricted maximum likelihood方法只評價(jià)random的方差好壞,所以會出錯(cuò)。對deviance產(chǎn)生影響2.Sig R2是level 1的R2.Level 2的R2在variance components中。3.Deviance是HLM變化的最好報(bào)告值。4.報(bào)告所有的variance相加之和,報(bào)告它的變化情況而不報(bào)告各自變化情況。5.為什么要看final estimation of fixed effects(with robust standard errors)。主要是數(shù)據(jù)分布很難達(dá)到正態(tài)分布。Robust estimation放松了此假設(shè)。如果確信數(shù)據(jù)正態(tài)分布,看上面的表也可以。3嚴(yán)選1注意注意6.一般只報(bào)告shapiro-wilk值做正態(tài)分布檢驗(yàn)7.有人說sobel test只適合single level的檢驗(yàn)。8.Monte carlo method適合單、跨層次的mediation檢驗(yàn)。有樣本自助法和參數(shù)自助法bootstrapping兩種方法9.Proclin方法做mediation testing4嚴(yán)選1Incremental modeln在第1層次用grand mean centering。nLevel 1 variance=between+within+randomnLevel 2 variance=between+randomn在level 1用grand mean centering時(shí),level 1上保留了between和within的方差,又減少了random variance.X 2X 1Y1Level 2Level 15嚴(yán)選1Mediational modeln若X1存在,則grand mean centeringn若X1不存在,僅做X2 M1,則grand mean centering 或 group mean centering,效果一樣。n若X1,X2 Y1,則必須用grand mean centering。X 2X 1Y1Level 2Level 1M 16嚴(yán)選1Moderational modeln此時(shí),level 1 必須用group mean centering.因?yàn)閘evel 1上有三部分的方差,between+within+random。此時(shí)group mean centering就把level 1的方差干凈為within+random,所以level 2的X2是對within variance的調(diào)節(jié)。n若在 level 1上用grand mean centering,由level 1上還存在between+within+random三部分方差。此時(shí)X2的調(diào)節(jié)作用分不清是對between的影響,還是within的影響。X 2X 1Y1Level 2Level 17嚴(yán)選1Separate modeln用group mean centering,與incremental model相同。8嚴(yán)選1SPSS data preparationnData Clean注意:有的變量名太長,另存為.sd7 version時(shí)候,進(jìn)入HLM不能進(jìn)入mdm之中。所以,變量名不能多于8個(gè)字符。n不同層次的ID:變成numeric從小到大排序9嚴(yán)選1用用HLM分析高級分析高級SPSS版本數(shù)據(jù)版本數(shù)據(jù)n先將SPSS數(shù)據(jù)另存為sas v7-8,.sd7(short-term)nMake new MDM file stata package inputn在Input File Type中選Anything else(stat/transfer)10嚴(yán)選111嚴(yán)選112嚴(yán)選113嚴(yán)選1n輸完第一層次的數(shù)據(jù)后,missing data Yes;running analysisn每個(gè)層次的數(shù)據(jù)選擇完成后,給mdm一個(gè)文件名,并給保存的路徑nMake mdm Check Stats:認(rèn)真研究一下這個(gè)TXT文件的statistics,問為什么不同層次的樣本是這么多?回去再看看數(shù)據(jù)。n都完成了,Done:出現(xiàn)下面的頁面14嚴(yán)選115嚴(yán)選1這個(gè)頁面叫:null model16嚴(yán)選1Null model:Step 1 in Table 1 of Aguinis et al.(2013,JoM),or Table 2 of Chang et al.(2014,JAP)n只有dependent variable,沒有任何predictors;n這個(gè)模型是看每個(gè)層次能夠解釋因變量的方差比重。nRun Analysis-runn于是出現(xiàn)一個(gè)DOS運(yùn)行頁面,然后自動消失17嚴(yán)選118嚴(yán)選1Results Final estimation of fixed effects(with robust standard errors)-Standard Approx.Fixed Effect Coefficient Error T-ratio d.f.P-value-For INTRCPT1,P0 For INTRCPT2,B00 INTRCPT3,G000 4.101265 0.064731 63.359 25 0.000-Final estimation of level-1 and level-2 variance components:-Random Effect Standard Variance df Chi-square P-value Deviation Component-INTRCPT1,R0 0.34884 0.12169 23 165.51585 0.000 level-1,E 0.33156 0.10993-Final estimation of level-3 variance components:-Random Effect Standard Variance df Chi-square P-value Deviation Component-INTRCPT1/INTRCPT2,U00 0.17353 0.03011 24 34.32270 0.079-Statistics for current covariance components model-Deviance =285.220776Number of estimated parameters=419嚴(yán)選1n有三個(gè)層次的variance,we can calculate the DVs variance proportion that each level can explain.nDV total variance=0.10993(L1)+0.12169(L2)+0.03011(L3)=0.26173n%L1=0.10993/0.26173=42%n%L2=0.12169/0.26173=46%n%L3=0.03011/0.26173=12%20嚴(yán)選1Control model:Step 2 in Table 2 of Chang et al.(2014,JAP)21嚴(yán)選1Random intercept and fixed slope model:Step 2 in Table 1 of Aguinis et al.(2013,JoM),or Step 3 in Table 2 of Chang et al.(2014,JAP)22嚴(yán)選1Random intercept and Random slope model:Step 3 in Table 1 of Aguinis et al.(2013,JoM),or Step 4 in Table 2 of Chang et al.(2014,JAP)23嚴(yán)選1n Slope(L2)variancen Intercept-slope(L2)covariancen上面兩個(gè)值都可以在Results 中的Tau(beta)矩陣中有。n注意:variance is not negative;co-variance may be negative or positive or zero.24嚴(yán)選1Cross-Level Interaction:Random intercept and random slope,Step 4 in Table 1 of Aguinis et al.(2013,JoM),or Step 5 or 6 in Table 2 of Chang et al.(2014,JAP)25嚴(yán)選126嚴(yán)選1n如果需要畫圖和計(jì)算線的slope and their significance,需要在HLM的other setting中的output setting中選擇輸出Variance-covariance matrix。n去www.quantpsy.org:去計(jì)算slope and their significance http:/www.jeremydawson.co.uk/slopes.htm:去畫圖27嚴(yán)選1