BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello All
I am using the following code to generate a count meaning for each Plan there are 1 or more Households attached and for each household there are 1 or more accounts attached to it.

The following proc summary is iving me the same count for all the 3 variables - plans, households and accounts.

Question
Since N in the code signifies count - How would I be able to use a count-distinct for just the plans and a normal count for the remaining 2 variables?

Code
proc summary data = workpks.temp13 N;
var Plan
Household
Account
;
class RSPNSBY_CNTR_ID;
output out = workpks.temp13_smry N= Plan Household Account;
run;

Thanks for all your help.

Pappu.
1 REPLY 1
LinusH
Tourmaline | Level 20
I'm not sure, but I don't think that summary offers the count distinct construct.
So an advice is to go for proc sql instead where this can easily ca be achieved.

/Linus
Data never sleeps

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!

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.

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
  • 1 reply
  • 560 views
  • 0 likes
  • 2 in conversation