BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tpham
Quartz | Level 8

This is my SAS code, basically I did some analysis and generated a final table.

 

proc format;
	value grouplabel 1="Overall" 2="Scrolling vs. Non-Scrolling" 3="BYOD vs Non-Scrolling" 4="Intelligent vs Non-intelligent";
run;

data have;
length score $ 50.;
input  score grouplabel1 estcirel ProbF;
cards;
score1	1	0.79	.
score1	2	0.80	0.45
score1	3	0.75	0.98
score1	4	0.78	0.45
score2	1	0.79	.
score2	2	0.80	0.45
score2	3	0.75	0.98
score2	4	0.78	0.45
;
run;

data have;
set have;
format grouplabel1 grouplabel.;
run;

proc report data=have;
column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL;

run;

This is the output

image.png

 

If you look at the table above, the overall has 2 colmns. I want it to only show the estcriel colmn and the the probf column is all missing (no p-value as there is no comparisons). So it is not useful to have that column in my final table.  I am fairly new to proc report, how do I structure the dataset and set up my proc report  for the overall group to just show the estcriel while the other groupings to show both columns (so other grouping is correct)?

 

Want: 

 

image.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Try filtering those out with a WHERE clause?

 

proc report data=have;
where not (score='score1' and missing(probF));

column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL;

run;

@Tpham wrote:

This is my SAS code, basically I did some analysis and generated a final table.

 

proc format;
	value grouplabel 1="Overall" 2="Scrolling vs. Non-Scrolling" 3="BYOD vs Non-Scrolling" 4="Intelligent vs Non-intelligent";
run;

data have;
length score $ 50.;
input  score grouplabel1 estcirel ProbF;
cards;
score1	1	0.79	.
score1	2	0.80	0.45
score1	3	0.75	0.98
score1	4	0.78	0.45
score2	1	0.79	.
score2	2	0.80	0.45
score2	3	0.75	0.98
score2	4	0.78	0.45
;
run;

data have;
set have;
format grouplabel1 grouplabel.;
run;

proc report data=have;
column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL;

run;

This is the output

image.png

 

If you look at the table above, the overall has 2 colmns. I want it to only show the estcriel colmn and the the probf column is all missing (no p-value as there is no comparisons). So it is not useful to have that column in my final table.  I am fairly new to proc report, how do I structure the dataset and set up my proc report  for the overall group to just show the estcriel while the other groupings to show both columns (so other grouping is correct)?

 

Want: 

 

image.png

 


 

View solution in original post

4 REPLIES 4
Reeza
Super User

Try filtering those out with a WHERE clause?

 

proc report data=have;
where not (score='score1' and missing(probF));

column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL;

run;

@Tpham wrote:

This is my SAS code, basically I did some analysis and generated a final table.

 

proc format;
	value grouplabel 1="Overall" 2="Scrolling vs. Non-Scrolling" 3="BYOD vs Non-Scrolling" 4="Intelligent vs Non-intelligent";
run;

data have;
length score $ 50.;
input  score grouplabel1 estcirel ProbF;
cards;
score1	1	0.79	.
score1	2	0.80	0.45
score1	3	0.75	0.98
score1	4	0.78	0.45
score2	1	0.79	.
score2	2	0.80	0.45
score2	3	0.75	0.98
score2	4	0.78	0.45
;
run;

data have;
set have;
format grouplabel1 grouplabel.;
run;

proc report data=have;
column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL;

run;

This is the output

image.png

 

If you look at the table above, the overall has 2 colmns. I want it to only show the estcriel colmn and the the probf column is all missing (no p-value as there is no comparisons). So it is not useful to have that column in my final table.  I am fairly new to proc report, how do I structure the dataset and set up my proc report  for the overall group to just show the estcriel while the other groupings to show both columns (so other grouping is correct)?

 

Want: 

 

image.png

 


 

ballardw
Super User

Or perhaps a format to use with ProbF that will show text like "No comparison" for missing values?

 

I have to say that seeing something that you state means no comparisons when there are 3 other comparisons involving the same variable looks very odd. If there is something else going on for those missing values perhaps a description is appropriate, or a symbol such as * and a footnote referencing that to explain why missing.

Ksharp
Super User

NOZERO option.

 

proc report data=have nowd;
column  score grouplabel1,(estcirel ProbF);
define score/group "Score";
define grouplabel1/across " " order=INTERNAL nozero;

run;
Reeza
Super User
Nice option there! Have to remember that for the future.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 952 views
  • 4 likes
  • 4 in conversation