Documentation

Anova.

班级:GeneralizeLmixedModel.

Analysis of variance for generalized linear mixed-effects model

Syntax

统计= ANOVA(GLME)
统计= ANOVA(GLME,名称,价值)

描述

example

stats= anova(格林)returns a table,stats, that contains the results ofF-tests to determine if all coefficients representing each fixed-effects term in the generalized linear mixed-effects model格林等于0。

stats= anova(格林,名称,价值)returns a table,stats, using additional options specified by one or more名称,价值对论点。例如,您可以指定用于计算近似分母自由度的方法F-tests.

输入参数

展开全部

Generalized linear mixed-effects model, specified as aGeneralizeLmixedModel.目的。有关此对象的属性和方法,请参阅GeneralizeLmixedModel.

名称值对参数

Specify optional comma-separated pairs of名称,价值论点。Nameis the argument name and价值is the corresponding value.Namemust appear inside single quotes (' ')。您可以以任何顺序指定多个名称和值对参数Name1,Value1,...,NameN,ValueN

展开全部

计算近似衡定度自由度的方法F-test,指定为逗号分隔的配对组成'dfmethod'and one of the following.

价值 描述
'剩余的' 假设自由度是恒定的并且等于np, 在哪里n是观察人数和pis the number of fixed effects.
'没有' 所有自由度都设定为无穷大。

分母的自由度F- 符合列DF2in the output structurestats

例子:'dfmethod','none'

Output Arguments

展开全部

Results ofF- 用于固定效果术语,作为每个固定效果项的一行作为表返回的表格林and the following columns.

列名称 描述
Term Name of the fixed-effects term
FStat F-统计for the term
DF1 分子自由度F-统计
DF2 Denominator degrees of freedom for theF-统计
pvalue. p-value for the term

Each fixed-effects term is a continuous variable, a grouping variable, or an interaction between two or more continuous or grouping variables. For each fixed-effects term,Anova.performs anF- 最低(边缘测试)以确定表示固定效应项的所有系数是否等于0。

在拟合推广线性混合效果模型时对III型假设进行测试Fitglme., you must use the'效果'对比的'DummyVarCoding'name-value pair argument.

例子

展开全部

Navigate to the folder containing the sample data. Load the sample data.

cd(matlabroot) cd('help/toolbox/stats/examples') 加载mfr

This simulated data is from a manufacturing company that operates 50 factories across the world, with each factory running a batch process to create a finished product. The company wants to decrease the number of defects in each batch, so it developed a new manufacturing process. To test the effectiveness of the new process, the company selected 20 of its factories at random to participate in an experiment: Ten factories implemented the new process, while the other ten continued to run the old process. In each of the 20 factories, the company ran five batches (for a total of 100 batches) and recorded the following data:

  • Flag to indicate whether the batch used the new process (newprocess.)

  • 处理时间为每批次,以小时为单位(时间)

  • 温度批量,以摄氏度(temp)

  • Categorical variable indicating the supplier (A,B, orC) of the chemical used in the batch (供应商)

  • Number of defects in the batch (缺陷)

数据还包括time_dev.andtemp_dev,这分别从20摄氏度为3小时的过程标准来表示时间和温度的绝对偏差。

使用广义的线性混合效果模型使用newprocess.,time_dev.,temp_dev, 和供应商as fixed-effects predictors. Include a random-effects term for intercept grouped byfactory, to account for quality differences that might exist due to factory-specific variations. The response variable缺陷has a Poisson distribution, and the appropriate link function for this model is log. Use the Laplace fit method to estimate the coefficients. Specify the dummy variable encoding as'效果',使虚拟变量系数总和为0。

The number of defects can be modeled using a Poisson distribution

$$ \ mbox {缺陷} _ {ij} \ infthe \ mbox {poisson}(\ mu_ {ij})$$

This corresponds to the generalized linear mixed-effects model

$$\log \mu_{ij} = \beta_0 + \beta_1 \mbox{newprocess}_{ij} + \beta_2
\mbox{time\_dev}_{ij} + \beta_3 \mbox{temp\_dev}_{ij} + \beta_4
\mbox{supplier}_{C_{ij}} + \beta_5 \mbox{supplier}_{B_{ij}}+b_i,$$

where

  • $ \ mbox {缺陷} _ {ij} $is the number of defects observed in the batch produced by factory$i$在批处理期间$j$

  • $\mu_{ij}$is the mean number of defects corresponding to factory$i$(在哪里$i = 1, 2, ..., 20$) during batch$j$(在哪里$j =   1, 2, ..., 5$)。

  • $\mbox{newprocess}_{ij}$,$\mbox{time\_dev}_{ij}$, 和$\mbox{temp\_dev}_{ij}$是每个变量对应于工厂的测量值$i$在批处理期间$j$。例如,$\mbox{newprocess}_{ij}$indicates whether the batch produced by factory$i$在批处理期间$j$使用了新过程。

  • $\mbox{supplier}_{C_{ij}}$and$ \ mbox {供应商} _ {b_ {ij}} $are dummy variables that use effects (sum-to-zero) coding to indicate whether companyCorB分别为工厂生产的批量提供工艺化学品$i$在批处理期间$j$

  • $ b_ {i}〜n(0,\ sigma_ {b} ^ {2})$is a random-effects intercept for each factory$i$that accounts for factory-specific variation in quality.

glme = fitglme(制造商,'缺陷〜1 + newprocess + time_dev + temp_dev +供应商+(1 |工厂)',。。。'Distribution','泊松','关联','log','FitMethod','laplace','DummyVarCoding','效果')
GLME =广义线性混合效果模型适合ML型号信息:观测数量100固定效果系数6随机效果系数20协方差参数1分布泊松链路Log Fitmethod Laplace公式:缺陷〜1 + NewProcess + Time_Dev + Temp_dev +供应商+(1 |工厂)型号拟合统计:AIC BIC loglikelihiale Deviance 416.35 434.58 -201.17 402.35固定效果系数(95%CIS):名称估计SE TSTAT DF PVALUE'1.4689 0.15988 9.1875 94 9.8194E-15'NewProcess'-0.36766'newprocess'-0.367660.17755 -2.0708 94 0.041122 'time_dev' -0.094521 0.82849 -0.11409 94 0.90941 'temp_dev' -0.28317 0.9617 -0.29444 94 0.76907 'supplier_C' -0.071868 0.078024 -0.9211 94 0.35936 'supplier_B' 0.071072 0.07739 0.91836 94 0.36078下限上限1.1515 1.7864 -0.72019  -0.015134 -1.7395 1.5505 -2.1926 1.6263 -22679 0.083051 -0.082588 0.22473随机效果协方差参数:组:工厂(20级)Name1 Name2型估计'(拦截)''(拦截)''std'0.31381组:错误名称估计'SQRT(Dispersion)'1

Perform an$F$- 确定所有固定效果系数是否等于0。

统计= ANOVA(GLME)
统计=边际测试:方差分析DFMETHOD = '残余' Term FStat DF1 DF2 pValue '(Intercept)' 84.41 1 94 9.8194e-15 'newprocess' 4.2881 1 94 0.041122 'time_dev' 0.013016 1 94 0.90941 'temp_dev' 0.086696 1 94 0.76907 'supplier' 0.59212 2 94 0.5552

The$ P $.-values for the intercept,newprocess.,time_dev., 和temp_devare the same as in the coefficient table of the格林DISP.lay. The small$ P $.- 拦截和拦截和newprocess.表明这些是5%重要水平的重要预测因子。大$ P $.-values fortime_dev.andtemp_devindicate that these are not significant predictors at this level.

The$ P $.- 0.5552的值为供应商测量代表分类变量的两个系数的组合意义供应商。This includes the dummy variables供应商_C.and供应商_B.as shown in the coefficient table of the格林DISP.lay. The large$ P $.-value indicates that供应商is not a significant predictor at the 5% significance level.

提示

  • For each fixed-effects term,Anova.performs anF- 最低(边缘测试)以确定表示固定效应项的所有系数是否等于0。

    When fitting a generalized linear mixed-effects (GLME) model usingFitglme.and one of the maximum likelihood fit methods ('laplace'or'ApproximateLaplace'):

    • 如果您指定了'CovarianceMethod'名称值对参数为'conditional', then theF-tests are conditional on the estimated covariance parameters.

    • 如果您指定了'CovarianceMethod'name-value pair as'JointHessian', then theF-tests account for the uncertainty in estimation of covariance parameters.

    When fitting a GLME model usingFitglme.以及伪可能的方法之一('MPL'or'rempl'),Anova.uses the fitted linear mixed effects model from the final pseudo likelihood iteration for inference on fixed effects.

这个主题有用吗?