BookmarkSubscribeRSS Feed
Mic35
Obsidian | Level 7

Hello,

After doing a lot of research, and reading a lot of things on the forum, I wish a little help please...

I am looking to optimize my data set for reporting.


The table is obtained after a lot of proc transposes and merges with different tables (which can vary according to the configuration of the macro: uni/bivariate analysis, OR, test,...).

 

Currently I have made a lot of progress on a lot of small things but there is still the problem of the p-value of var cat which is located at the last level of the modality.

 

I tried to act at the data stage before the merge in order to link the p-value to the 1st modality...
Then I tried to implement several techniques directly on the final dataset (reverse lag, try to assign to each modality the p-value initially given to one then apply an ARRAY /lag method to keep the 1st p-value appearing for each variable...). 
I think I missed something.

The photo illustrates what I am getting now and what I want to get (p-value on the same line than the 1st modality, in automated version) 

 

If anyone has an idea, I'm a subscriber.

 

I will be very grateful for yours answers


Mic

image.jpg

 

2 REPLIES 2
Reeza
Super User

You'd have to show us your code for us to be able to help here. We can call it using an example data set - I'm assuming you're writing a generic macro?

 

Here's an example of something I did that's pretty similar, except for one way frequency tables via chi square. I've done logistic regression ones but that code's buried somewhere. If you search on lexjansen.com for clinical reports you'll find many code examples. 

https://gist.github.com/statgeek/0ff46bbd76bcc101e40945816b232303


@Mic35 wrote:

Hello,

After doing a lot of research, and reading a lot of things on the forum, I wish a little help please...

I am looking to optimize my data set for reporting.


The table is obtained after a lot of proc transposes and merges with different tables (which can vary according to the configuration of the macro: uni/bivariate analysis, OR, test,...).

 

Currently I have made a lot of progress on a lot of small things but there is still the problem of the p-value of var cat which is located at the last level of the modality.

 

I tried to act at the data stage before the merge in order to link the p-value to the 1st modality...
Then I tried to implement several techniques directly on the final dataset (reverse lag, try to assign to each modality the p-value initially given to one then apply an ARRAY /lag method to keep the 1st p-value appearing for each variable...). 
I think I missed something.

The photo illustrates what I am getting now and what I want to get (p-value on the same line than the 1st modality, in automated version) 

 

If anyone has an idea, I'm a subscriber.

 

I will be very grateful for yours answers


Mic

image.jpg

 


 

Mic35
Obsidian | Level 7

Thank you for your answer.

It was enough to replace a word in the program...
Why try to make it complicated when you can make it simple... Man LOL

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 917 views
  • 2 likes
  • 2 in conversation