Navigate to a folder containing sample data.

cd(matlabroot)
cd('help/toolbox/stats/examples')

Load the sample data.

load shift

The data shows the 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 deviation of the quality characteristics from the target
value. This is simulated data.

`Shift` and `Operator` are
nominal variables.

shift.Shift = nominal(shift.Shift);
shift.Operator = nominal(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)');

Compute the 99% confidence intervals for fixed-effects
coefficients, using the residual method to compute the degrees of
freedom. This is the default method.

[~,~,stats] = fixedEffects(lme,'alpha',0.01)

stats =
Fixed effect coefficients: DFMethod = 'Residual', Alpha = 0.01
Name Estimate SE tStat DF pValue Lower Upper
'(Intercept)' 3.1196 0.88681 3.5178 12 0.0042407 0.41081 5.8284
'Shift_Morning' -0.3868 0.48344 -0.80009 12 0.43921 -1.8635 1.0899
'Shift_Night' 1.9856 0.48344 4.1072 12 0.0014535 0.5089 3.4623

Compute the 99% confidence intervals for fixed-effects
coefficients, using the Satterthwaite approximation to compute the
degrees of freedom.

[~,~,stats] = fixedEffects(lme,'DFMethod','Satterthwaite','alpha',0.01)

stats =
Fixed effect coefficients: DFMethod = 'Satterthwaite', Alpha = 0.01
Name Estimate SE tStat DF pValue Lower Upper
'(Intercept)' 3.1196 0.88681 3.5178 6.123 0.01214 -0.14122 6.3804
'Shift_Morning' -0.3868 0.48344 -0.80009 10 0.44225 -1.919 1.1454
'Shift_Night' 1.9856 0.48344 4.1072 10 0.00212 0.45343 3.5178

The Satterthwaite approximation usually produces smaller `DF` values
than the residual method. That is why it produces larger *p*-values
(`pValue`) and larger confidence intervals (see `Lower` and `Upper`).