- Standardize your input variables (X_m) and target variable (Y_m) by subtracting the mean and dividing by the standard deviation.
- Fit the linear model using the standardized variables.
- The coefficients from this model will be the standardized coefficients.
Effects of linear model estimates
9 views (last 30 days)
Show older comments
Hey everyone!
I have a problem with the interpretation of a linear regression model I generated with the function fitlm. The model has three input variables, stored in the columns of X_m and one target variable which are stored in Y_m.
The model works perfectly fine, however I am trying to find out what the standardizied effect of each of the terms of the linear model is on my target variable. After reading the documentation of fitlm function the p-value seems to only tell me the probaliliy that the certain estimate is not equal to zero.
I have found a similiar question on this topic here in the mathlab cummunity (-> comm_question), but I was not able to solve my problem, since the factors in that perticular quistion have 2 factorsteps each, and my factors have 7 steps in the first column, 16 steps in for the second and four steps in the third column of X_m.
I have attached a file with the matching .csv file to this post
clear
clear all
A=readmatrix('data.csv')
X_m=A(:,1:3);
Y_m=A(:,4);
mdl=fitlm(X_m, Y_m,'poly222','RobustOpts','on');
Any help or hints would be much appreciatet! Thanks in advance
Lukas
0 Comments
Answers (1)
Kartik Saxena
on 15 Jan 2024
Hi,
The 'fitlm' function in MATLAB does not directly provide standardized coefficients, but you can calculate them manually. Here's how you can do it:
To visualize the standardized effects similar to a Pareto chart, you can create a bar chart with the absolute values of the standardized coefficients.
For more information on interpreting linear models in MATLAB, you can refer to the following MathWorks documentation:
I hope this resolves your issue.
0 Comments
See Also
Categories
Find more on Copula Distributions and Correlated Samples 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!