Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

disp

Class: CompactLinearModel

Display linear regression model

Syntax

display(mdl)

Description

display(mdl) displays the mdl linear model.

Input Arguments

expand all

Linear model object, specified as a full LinearModel object constructed using fitlm or stepwiselm, or a compacted CompactLinearModel object constructed using compact.

Examples

expand all

Create and display a linear regression model.

Create a linear regression model.

X = randn(100,5);
y = X*[1;2;3;4;5] + 6 + randn(100,1);
mdl = fitlm(X,y);

Display the model.

disp(mdl)
Linear regression model:
    y ~ 1 + x1 + x2 + x3 + x4 + x5

Estimated Coefficients:
                   Estimate       SE       tStat       pValue  
                   ________    ________    ______    __________

    (Intercept)     6.0382     0.099458     60.71    3.2792e-77
    x1             0.92794     0.087307    10.628    8.5494e-18
    x2              1.9244      0.10044     19.16    3.1678e-34
    x3              2.8965     0.099879        29    1.1117e-48
    x4              4.0453      0.10832    37.346    3.4862e-58
    x5              5.0029      0.11799    42.401     4.452e-63


Number of observations: 100, Error degrees of freedom: 94
Root Mean Squared Error: 0.972
R-squared: 0.976,  Adjusted R-Squared 0.975
F-statistic vs. constant model: 778, p-value = 8e-75

Alternatives

Type the name of your model (for example, mdl) at the command line to obtain a display.

Was this topic helpful?