inspection of linearity of data?

4 Ansichten (letzte 30 Tage)
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan am 24 Okt. 2022
Hello ! I want to check the linearity between two data set named as L_comp and L? please find attached. How can I check the trend of the following dataset? Many thanks !

Akzeptierte Antwort

Chunru
Chunru am 25 Okt. 2022
load(websave("check_linearity.mat","https://www.mathworks.com/matlabcentral/answers/uploaded_files/1167363/check_linearity.mat"))
whos
Name Size Bytes Class Attributes L 122x1 976 double L_comp 122x1 976 double cmdout 1x33 66 char
% use curve fitting toolbox
f = fit(L, L_comp, 'poly1')
f =
Linear model Poly1: f(x) = p1*x + p2 Coefficients (with 95% confidence bounds): p1 = -0.2864 (-0.3991, -0.1736) p2 = 0.2222 (0.199, 0.2455)
plot(f, L, L_comp)
  1 Kommentar
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan am 26 Okt. 2022
Many thanks! Could you please explain the output a bit ? How we can save the slope, and then test all the slopes within each group against 0 via the ttest function?
Linear model Poly1:
f(x) = p1*x + p2
Coefficients (with 95% confidence bounds):
p1 = -0.2864 (-0.3991, -0.1736)
p2 = 0.2222 (0.199, 0.2455)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by