Syntax for fitlm: + versus *
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Walter Roberson
on 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.
More Answers (0)
See Also
Categories
Find more on Linear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!