Hi,
I am creating a table, but there are no values for two trt groups. How can I add them?
Below is the example, c3 and c4 are missing.
Thanks in advance!
Adi
"How" would typically involve a data step.
The picture you have implies there are no variables C3, C4 (and possibly C6, C7 and C8). If that is correct an there are no values in the data set and you want to add variables that have missing values it could be as simple as:
data want; set have; C3=.; C4=.; run;
But, since you show what I consider pretty poor data, as in two values in each of those variables one might ask exactly what properties you expect to see for the two added variables. While answering that I would suggest looking where this came from and perhaps there is something that needs to be addressed earlier as this looks like possibly the result of transposing or something else to an existing data.
Yes, I am transposing the results which are coming from proc means. I got it now, I have created dummy dataset with all possible trt groups and added before transposing the dataset. Now it looks good. Thanks!
Depending on your data since you are using Proc means or summary you may want to look at the documentation of the COMPLETETYPES procedure option if you are using Class variables. That will create all the combinations for all the class variables so this may help prevent this in the future. May not. But if you are sub-setting data and transposing it may be helpful.
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!
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.