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

Dear All,

I am new to proc report and am trying to create a report which would have means of variables going across columns,
and then "traffic lighted" based on variables that contains p-values to assess whether they are statistically significant. In this
regards, I have been able to do this.

However, I have a 'twist' in that I want that if one cell in one row is greater than another cell in another row and the p-value is significant
I want a certain color, but if that same cell in that same row is less than another cell in another row and the p-value is significant
I want a different color.  

So for example, if a p-value is statistically significant and the mean for a variable representing female is greater than a mean for a variable representing male I want the color red, but if male is greater than female I want the color blue.  In essence, what I think I am asking is I know that individual columns can be referred to as _c1_, _c2_, _c3_ etc..., but can individual rows be referred to as _r1_, _r2_, etc. instead of just _row_. Then I could use logical conditions to refer to say column 6, _c6_, and row 4, _r4_, and column 6, and row 5, for instance.  It seems like all I have found online is _row_, but I could be mistaken.

Below is coding that successfuly does the traffic lighting based based on p-values, but not with the 'twist'.

Thank you for any help you are willing to offer and let me know if I can clarify anything. Also I am using SAS 9.4 for Windows.

Sincerely,


Craig Ziegler

1 ACCEPTED SOLUTION

Accepted Solutions
chzieg01
Fluorite | Level 6

BallardW,

 

Thank you for your helpful suggestion.  I've been playing around with the datastep/lag function and should be able to get what I need.

 

Sincerely,

 

Craig

View solution in original post

2 REPLIES 2
ballardw
Super User

 

There really isn't a reason to attach SAS code. Paste it from your editor into a code box opened on the forum using the {I} icon.

 

Because Proc report builds columns left to right you would have to have the calculation and comparisons done before any of the highlighted columns appear in the report output. If your data is not already summarized before going into proc report you might consider that so that all of the values needed are already available. Then possibly create additional variable to hold values that can be referenced.

 

 

 

 

chzieg01
Fluorite | Level 6

BallardW,

 

Thank you for your helpful suggestion.  I've been playing around with the datastep/lag function and should be able to get what I need.

 

Sincerely,

 

Craig

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 693 views
  • 0 likes
  • 2 in conversation