Accelerating the pace of engineering and science

Documentation Center

• Trial Software
• Product Updates

disp

Class: LinearModel

Display linear regression model

display(mdl)

Description

display(mdl) displays the mdl linear model.

Input Arguments

 mdl Linear model, as constructed by fitlm or stepwiselm.

Examples

expand all

Display a Linear Regression Model

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.0806      0.11393    53.371    4.2509e-72
x1             1.1181       0.1154    9.6894    8.4046e-16
x2             2.0903      0.11378    18.372    7.2209e-33
x3             3.0926      0.10725    28.836    1.7967e-48
x4             3.9343      0.11489    34.244    6.9609e-55
x5             4.9538      0.10799    45.873    3.8195e-66

Number of observations: 100, Error degrees of freedom: 94
Root Mean Squared Error: 1.08
R-squared: 0.979,  Adjusted R-Squared 0.978
F-statistic vs. constant model: 891, p-value = 1.59e-77```

Alternatives

Enter mdl at the command line to obtain a display, where mdl is the name of your model.

How To

Was this topic helpful?