disp
显示线性混合效应模型
Syntax
Input Arguments
lme
—Linear mixed-effects model
LinearMixedModel
object
线性混合效应模型,指定为LinearMixedModel
使用的对象fitlme
或者fitlmematrix
。
例子
Randomized Block Design
加载样本数据。
load('shift.mat');
The dataset array shows the absolute deviations from the target quality characteristic measured from the products that five operators manufacture during three shifts, morning, evening, and night. This is a randomized block design, where the operators are the blocks. The experiment is designed to study the impact of the time of shift on the performance. The performance measure is the absolute deviation of the quality characteristics from the target value. This is simulated data.
Shift
和Operator
是名义变量。
shift.shift =名义(shift.shift);shift.operator =名义(shift.operator);
Fit a linear mixed-effects model with a random intercept grouped by operator to assess if performance significantly differs according to the time of the shift.
lme = fitlme(Shift,'QCDev ~ Shift + (1|Operator)');
显示模型。
disp(lme)
Linear mixed-effects model fit by ML Model information: Number of observations 15 Fixed effects coefficients 3 Random effects coefficients 5 Covariance parameters 2 Formula: QCDev ~ 1 + Shift + (1 | Operator) Model fit statistics: AIC BIC LogLikelihood Deviance 59.012 62.552 -24.506 49.012 Fixed effects coefficients (95% CIs): Name Estimate SE tStat DF pValue {'(Intercept)' } 3.1196 0.88681 3.5178 12 0.0042407 {'Shift_Morning'} -0.3868 0.48344 -0.80009 12 0.43921 {'Shift_Night' } 1.9856 0.48344 4.1072 12 0.0014535 Lower Upper 1.1874 5.0518 -1.4401 0.66653 0.93227 3.0389 Random effects covariance parameters (95% CIs): Group: Operator (5 Levels) Name1 Name2 Type Estimate {'(Intercept)'} {'(Intercept)'} {'std'} 1.8297 Lower Upper 0.94915 3.5272 Group: Error Name Estimate Lower Upper {'Res Std'} 0.76439 0.49315 1.1848
This display includes the model performance statistics,Akaike and Bayesian Information Criteria,Akaike and Bayesian Information Criteria, loglikelihood, and偏差。
固定效应系数表包括前两列中系数的名称和估计值。第三列SE
shows the standard errors of the coefficients. The columntStat
includes the
-statistic values that correspond to each coefficient.DF
是剩余的自由度,pValue
是个
- 对应于相应的值
-statistic value. The columnsLower
和Upper
display the lower and upper limits of a 95% confidence interval for each fixed-effects coefficient.
The first table for the random effects shows the types and the estimates of the random effects covariance parameters, with the lower and upper limits of a 95% confidence interval for each parameter. The display also shows the name of the grouping variable, operator, and the total number of levels, 5.
随机效应的第二个表显示了观察误差的估计值,其下限和上限为95%置信区间。
More About
Akaike and Bayesian Information Criteria
Akaike information criterion (AIC) isAIC= –2*logLM+ 2*(NC+p+ 1),在哪里日志LM是模型的最大对数可能性(或最大化受限的日志可能性),和NC+p+ 1 is the number of parameters estimated in the model.p是固定效应系数的数量,并且NC是不包括残差方差的随机效应协方差中的参数总数。
Bayesian information criterion (BIC) isBIC= –2*logLM+ ln(neff)*(NC+p+ 1),在哪里日志LM是模型的最大对数可能性(或最大化受限的日志可能性),neff是个effective number of observations, and (NC+p+ 1)是模型中估计的参数数。
If the fitting method is maximum likelihood (ML), thenneff=n, wheren是观察的数量。
If the fitting method is restricted maximum likelihood (REML), thenneff=n–p。
较低的偏差值表示更好的拟合度。随着偏差的价值的降低,AIC和BIC都倾向于降低。AIC和BIC都基于估计参数的数量,包括惩罚条款,p。因此,当参数的数量增加时,AIC和BIC的值也会增加。在比较不同的模型时,AIC或BIC值最低的模型被认为是最佳拟合模型。
偏差
LinearMixedModel
计算模型的偏差M由于减去该模型的loglikelione的两倍。让LM表示模型的可能性函数的最大值M。Then, the deviance of modelM是
较低的偏差值表示更好的拟合度。认为M1和M2are two different models, whereM1被嵌套了M2。Then, the fit of the models can be assessed by comparing the deviances开发1和开发2这些模型。的均NCe of the deviances is
通常,这种差异的渐近分布具有卡方分布,自由度v等于在一个模型中估计但在另一个模型中估算的参数数量。也就是说,它等于M中估计的参数数量的差1和m2。你可以得到p-value for this test using1 – chi2cdf(Dev,V)
, where开发=开发2–开发1。
However, in mixed-effects models, when some variance components fall on the boundary of the parameter space, the asymptotic distribution of this difference is more complicated. For example, consider the hypotheses
H0: D是aq-经过-q对称阳性半决矩阵。
H1:D是(q+1)-by-((q+1) symmetric positive semidefinite matrix.
That is,H1states that the last row and column ofD与零不同。在这里,更大的模型M2hasq+ 1个参数和较小的模型M1hasqparameters. And开发has a 50:50 mixture ofχ2q和χ2(q+ 1)分布(Stram和Lee,1994)。
参考
[1] Hox, J.多级分析,技术和应用。Lawrence Erlbaum Associates, Inc., 2002.
[2] Stram D. O. and J. W. Lee. “Variance components testing in the longitudinal mixed-effects model”.Biometrics, Vol. 50, 4, 1994, pp. 1171–1177.
See Also
MATLAB 명령
다음matlab명령명령해당링크를했습니다했습니다。
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
美洲
- AméricaLatina(Español)
- 加拿大(英语)
- 美国(英语)