Hi experts,
I just start to use SAS and have a task to create a crosstab table. The table 1 below is the dataset with all dummy variables and how could I use SAS to generate the table like table 2? Table 2 shows that how many observation have both A&B or B&C or A&C.
Hi!
Do you know anything about statistics?
in this case the crosstab = table of the sums of squares and crossproducts he sums of squares and crossproducts
data TEST;
input A B C;
datalines;
1 0 1
0 1 0
0 0 1
1 0 1
1 1 1
0 1 1
1 0 1
1 0 0
0 1 0
0 1 1
;
run;
proc corr data=TEST SSCP outp=SSCP noprint;
var A B C;
run;proc corr data=TEST SSCP outp=SSCP(drop = INTERCEPT where=(_TYPE_ ="SSCP" and _NAME_ ne "Intercept")) noprint;
var A B C;
run;
Hi!
Do you know anything about statistics?
in this case the crosstab = table of the sums of squares and crossproducts he sums of squares and crossproducts
data TEST;
input A B C;
datalines;
1 0 1
0 1 0
0 0 1
1 0 1
1 1 1
0 1 1
1 0 1
1 0 0
0 1 0
0 1 1
;
run;
proc corr data=TEST SSCP outp=SSCP noprint;
var A B C;
run;proc corr data=TEST SSCP outp=SSCP(drop = INTERCEPT where=(_TYPE_ ="SSCP" and _NAME_ ne "Intercept")) noprint;
var A B C;
run;Thank you so much for your response, that solve the problem perfectly.
So do I have any chance to reorder the SSCP table? Like reorder A B C by their frequency.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.