BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

Hello, is there any procedure to check if two points in a data agree or disagree as below:

If in a regression line between b and c, the points are within .95CI then they agree, otherwise they disagree.

In a simple linear regression between b and c, not all data points will fall within two standards of the line. The points that are within two standard deviation agree, while those outside, disagree.

 

This is the DATA:

Data A ;

Input  b c;

Cards;

4     5

6     7

4      4

10   2

9    1

4   5

;

Run;

 

THIS IS POTENTIAL OUTPUT.

Output D

b    c      f

4     5     agree

6     7      agree

4      4     agree

10   2      disagree

9    1       disagree

4   5       agree

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc reg data=a;
    model b=c;
    output out=preds ucl=ucl lcl=lcl;
run;
quit;

data want;
    set preds;
    if lcl<=b<=ucl then agree=1;
    else agree=0;
run;
--
Paige Miller

View solution in original post

10 REPLIES 10
PaigeMiller
Diamond | Level 26

Please explain the logic by which you can determine "Agree" or "Disagree"

--
Paige Miller
desireatem
Pyrite | Level 9

Hello, is there any procedure to check if two points in a data agree or disagree as below:

If the point in the line between B and C is within a 95CI then the points agree otherwise they disagree.

 

This is the DATA:

Data A ;

Input  b c;

Cards;

4     5

6     7

4      4

10   2

9    1

4   5

;

Run;

 

THIS IS POTENTIAL OUTPUT.

Output D

b    c      f

4     5     agree

6     7      agree

4      4     agree

10   2      disagree

9    1       disagree

4   5       agree

PaigeMiller
Diamond | Level 26

What 95% CI? CI for what statistic? How is it computed? Where is it stored?

 

If the point in the line between B and C

 

What point in the line?

--
Paige Miller
desireatem
Pyrite | Level 9

Hello, is there any procedure to check if two points in a data agree or disagree as below:

If in a regression line between b and c, the points are within .95CI then they agree, otherwise they disagree.

In a simple linear regression between b and c, not all data points will fall within two standards of the line. The points that are within two standard deviations agree, while those outside, disagree.

PaigeMiller
Diamond | Level 26

@desireatem wrote:

Hello, is there any procedure to check if two points in a data agree or disagree as below:

If in a regression line between b and c, the points are within .95CI then they agree, otherwise they disagree.

In a simple linear regression between b and c, not all data points will fall within two standards of the line. The points that are within two standard deviations agree, while those outside, disagree.


 

If you do a regression using variables b and c, which is the response variable and which is the predictor variable?

--
Paige Miller
desireatem
Pyrite | Level 9

THe dependent variable is b and the independent variable is c

 

 

 

desireatem
Pyrite | Level 9

The response is b and independent is c.

PaigeMiller
Diamond | Level 26
proc reg data=a;
    model b=c;
    output out=preds ucl=ucl lcl=lcl;
run;
quit;

data want;
    set preds;
    if lcl<=b<=ucl then agree=1;
    else agree=0;
run;
--
Paige Miller
desireatem
Pyrite | Level 9

Thank you, this works.  It is possible to be able to change the confidence interval to limit 99% CI rather than the default 99% CI?

PaigeMiller
Diamond | Level 26
proc reg data=a alpha=0.01;
--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 2293 views
  • 1 like
  • 2 in conversation