SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
robertrao
Quartz | Level 8

Hello,

 

I have the data in this format shown below and i have given examples for 2 ID's.

Each domain may have several questions and each ID may be either Established or NEW.

How do i find if there is a correlation of scores between Established and NEW.

 

I tried the following:

 

/*FOR ESTABLISHED*/
proc transpose data=Have(where=(Appointment_Type="ESTABLISHED")) out=test_transpose_Established prefix=EST_;
by ID question;
var score;
id DOMAIN;
run;


/*NEW PATIENTS*/
proc transpose data=Have(where=(Appointment_Type="NEW")) out=test_transpose_NEW prefix=NEW_;
by id question;
var score;
id Domain;
run;

 

 

/*Both Together*/


data new_EST;
set test_transpose_Established test_transpose_NEW;
run;

 

proc corr data=NEW_EST;
run;

 

ID              DOMAIN                                                                      QUESTION                                                             SCORE                        APPOINTMENT_TYPE

101             Med Practice: Care Provider                                 Med Practice: CP Concern                                   100                                    Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Explanation                            100                                    Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Discuss treatments              100                                     Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Efforts                                      100                                    Estblished

101             Med Practice: Access                                            Med Practice: Ease of contacting                         100                                   Estblished

101             Med Practice: Access                                             Med Practice: Ease of scheduling                       100                                   Estblished

101             Med Practice: Access                                              Med Practice: CP Efforts                                      100                                   Estblished

102            Med Practice: Care Provider                                 Med Practice: CP Concern                                   100                                    New

102             Med Practice: Care Provider                                 Med Practice: CP Explanation                            100                                    New

102             Med Practice: Care Provider                                 Med Practice: CP Discuss treatments              100                                    New

102             Med Practice: Care Provider                                 Med Practice: CP Efforts                                      100                                    New

102             Med Practice: Access                                            Med Practice: Ease of contacting                         100                                  New

102             Med Practice: Access                                             Med Practice: Ease of scheduling                       100                                  New

102            Med Practice: Access                                              Med Practice: CP Efforts                                      100                                  New

7 REPLIES 7
MarkusWeick
Barite | Level 11

Hi @robertrao, would "are the average scores of the new IDs significantly different from the average scores of the established IDs?" be an alternative to "what is the correlation between average scores of the new IDs and their appointment type?" for you?

Best Regards

Markus

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
robertrao
Quartz | Level 8

Thank you, Marcus

Did you mean i have to perform a ttest to look at the difference in Mean scores?

Would you be able to show th sample SAS code for my example to 

 

Proc ttest;

class Appointment_Type;

var score;

run;

 

MarkusWeick
Barite | Level 11

Starting with yout table new_EST I would calculate the average score per ID and then start the ttest:

 

proc sql;
create table TTest_2 as
select
ID, APPOINTMENT_TYPE, avg(SCORE) as AVERAGE_SCORE
from new_EST
group by ID;
quit;

proc ttest data=TTest_2;
   class APPOINTMENT_TYPE;
   var AVERAGE_SCORE;
run;
Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
robertrao
Quartz | Level 8

Hello MArkus,

 

It looks like they already know that the mean scores are different . This analysis provided information that the means are statistically significant.

The established had given a higher rating than the new patients.

 

Additionally, the important question that we need answer to is:

 

Between the two groups , is there a statistical difference between the questions they answered? !

 

Was Med Practice: Ease of scheduling higher in one group than the other???

 

MarkusWeick
Barite | Level 11

 @robertrao , could you please provide the full text of your task.

Best

Markus

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
robertrao
Quartz | Level 8

Hello MArkus,

I did not post the entire data since its huge and so i pasted a sample.

It was identified the Established category gave high rtings for the questions compared to NEW patients.
I changed the original sample to reflect those now -see below as i couldnt change the original post).

Our goal is to find if there is a statistical diffference if any for a question between Established and NEW!!!

 

 

ID              DOMAIN                                                                      QUESTION                                                             SCORE                        APPOINTMENT_TYPE

101             Med Practice: Care Provider                                 Med Practice: CP Concern                                   100                                    Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Explanation                            100                                    Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Discuss treatments              100                                     Estblished

101             Med Practice: Care Provider                                 Med Practice: CP Efforts                                      100                                    Estblished

101             Med Practice: Access                                            Med Practice: Ease of contacting                         100                                   Estblished

101             Med Practice: Access                                             Med Practice: Ease of scheduling                       100                                   Estblished

101             Med Practice: Access                                              Med Practice: CP Efforts                                      100                                   Estblished

102            Med Practice: Care Provider                                 Med Practice: CP Concern                                   96                                  New

102             Med Practice: Care Provider                                 Med Practice: CP Explanation                            82                                    New

102             Med Practice: Care Provider                                 Med Practice: CP Discuss treatments              75                                    New

102             Med Practice: Care Provider                                 Med Practice: CP Efforts                                     70                                    New

102             Med Practice: Access                                            Med Practice: Ease of contacting                         100                                 New

102             Med Practice: Access                                             Med Practice: Ease of scheduling                      95                                  New

102            Med Practice: Access                                              Med Practice: CP Efforts                                      99                             New

Ksharp
Super User
Check " intraclass correlation measures":
https://support.sas.com/kb/25/031.html

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 7 replies
  • 7516 views
  • 2 likes
  • 3 in conversation