Syntax for fitlm: + versus *
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lydia
am 14 Apr. 2019
Kommentiert: Lydia
am 15 Apr. 2019
What is the difference between the following syntax:
model(10).results = fitlm(tbl,'Acceleration ~ id * Weight');
and
model(10).results = fitlm(tbl,'Acceleration ~ id + Weight');
I am trying to run a linear model but allowing the intercept to vary per the "id" or identity of each observation.
Many thanks!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 15 Apr. 2019
id + Weight includes both id and Weight as linear terms, it appears.
id * Weight includes id, Weight, and id times Weight terms, if I understand correctly.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Regression finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!