appearance of regression line

Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
Can anyone explain the uneven appearance of the regression line in this plot?
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [dashdotted] table [x=a, y=create col/linear regression=y=b] data;
endaxis
endtikzpicture
enddocument


pgfplots
add a comment |Â
up vote
4
down vote
favorite
Can anyone explain the uneven appearance of the regression line in this plot?
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [dashdotted] table [x=a, y=create col/linear regression=y=b] data;
endaxis
endtikzpicture
enddocument


pgfplots
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Can anyone explain the uneven appearance of the regression line in this plot?
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [dashdotted] table [x=a, y=create col/linear regression=y=b] data;
endaxis
endtikzpicture
enddocument


pgfplots
Can anyone explain the uneven appearance of the regression line in this plot?
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [dashdotted] table [x=a, y=create col/linear regression=y=b] data;
endaxis
endtikzpicture
enddocument


pgfplots
pgfplots
asked 1 hour ago
Gareth Walker
66028
66028
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Pgfplots decomposes the regression line into small overlapping segments. Luckily it computes the parameters of the regression line and stores them into pgfplotstableregressionb and pgfplotstableregressiona, which allows one to draw the regression line as an ordinary single-stroke plot.
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [draw=none] table [x=a,
y=create col/linear regression=y=b] data;
addplot[dashdotted,domain=3:8] pgfplotstableregressionb+pgfplotstableregressiona*x;
endaxis
endtikzpicture
enddocument

add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Pgfplots decomposes the regression line into small overlapping segments. Luckily it computes the parameters of the regression line and stores them into pgfplotstableregressionb and pgfplotstableregressiona, which allows one to draw the regression line as an ordinary single-stroke plot.
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [draw=none] table [x=a,
y=create col/linear regression=y=b] data;
addplot[dashdotted,domain=3:8] pgfplotstableregressionb+pgfplotstableregressiona*x;
endaxis
endtikzpicture
enddocument

add a comment |Â
up vote
3
down vote
accepted
Pgfplots decomposes the regression line into small overlapping segments. Luckily it computes the parameters of the regression line and stores them into pgfplotstableregressionb and pgfplotstableregressiona, which allows one to draw the regression line as an ordinary single-stroke plot.
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [draw=none] table [x=a,
y=create col/linear regression=y=b] data;
addplot[dashdotted,domain=3:8] pgfplotstableregressionb+pgfplotstableregressiona*x;
endaxis
endtikzpicture
enddocument

add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Pgfplots decomposes the regression line into small overlapping segments. Luckily it computes the parameters of the regression line and stores them into pgfplotstableregressionb and pgfplotstableregressiona, which allows one to draw the regression line as an ordinary single-stroke plot.
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [draw=none] table [x=a,
y=create col/linear regression=y=b] data;
addplot[dashdotted,domain=3:8] pgfplotstableregressionb+pgfplotstableregressiona*x;
endaxis
endtikzpicture
enddocument

Pgfplots decomposes the regression line into small overlapping segments. Luckily it computes the parameters of the regression line and stores them into pgfplotstableregressionb and pgfplotstableregressiona, which allows one to draw the regression line as an ordinary single-stroke plot.
documentclass[border=0.5cm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
usepackagepgfplotstable
pgfplotstableread[col sep=comma]
a,b
5,14
4,13
6,11
8,12
8,10
5,9
3,12
data
begindocument
begintikzpicture
beginaxis
addplot [only marks] table [x=a, y=b] data;
addplot [draw=none] table [x=a,
y=create col/linear regression=y=b] data;
addplot[dashdotted,domain=3:8] pgfplotstableregressionb+pgfplotstableregressiona*x;
endaxis
endtikzpicture
enddocument

answered 34 mins ago
marmot
68.4k475147
68.4k475147
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456707%2fappearance-of-regression-line%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
