BookmarkSubscribeRSS Feed
michtka
Fluorite | Level 6


Hi guys, there is any alternative way to create a classdata dataset,

not using cards, or datalines? Thanks in advance. V

I need to create a classdata dataset like this one:

dataset classdata:

1

2

3

4 REPLIES 4
Reeza
Super User

You need to provide more information on what you're trying to do.

You can use a do loop and output statement but I have no idea if that's what you're looking for.

data want;

do i=1 to 3;

output;

end;

run;

michtka
Fluorite | Level 6

The idea is that, I got this dataset:

cat population       trt    count    

A population_d      1   1

A total                  3   1

B population_d      1    1

B total                  3   1

C population_d      1   1

C total                  3   1

In terms of show the report, populationx_p (trt=2), count=0 is not appear, and rather to put it manually  (hardcode), I want to introduce it using classdata:

classdata population

population_d 

population_p

total

classdata trteatment

1

2

3

to get the final dataset:

A population1_d   1   1

A population2_p   2   0

A total                 3   1

B population1_d   1    1

B population2_p   2    0

B total                 3    1

C population1_d    1   1

C population2_p     2   0

C total                   3   1

michtka
Fluorite | Level 6

sorry that one:

A population_d   1   1

A population_p   2   0

A total                 3   1

B population_d   1    1

B population_p   2    0

B total                 3    1

C population_d    1   1

C population_p     2   0

C total                   3   1

Reeza
Super User

You posted a similar question a few days ago, regarding color and models.

The solution is similar, create an empty dataset and join via proc sql.

A better solution is to ensure the data is generated will all the values, using sparse option in proc freq or another option.

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
  • 4 replies
  • 765 views
  • 3 likes
  • 2 in conversation