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
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;
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
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
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.