16 | 0.26 | 16 | 0.26 |
655 | 10.80 | 671 | 11.06 |
182 | 3.00 | 853 | 14.06 |
573 | 9.45 | 1426 | 23.51 |
2254 | 37.16 | 3680 | 60.68 |
2385 | 39.32 | 6065 | 100.00 |
My variable name is education level. Considering low responses I want to add levels '1' and '2' together. help, please.
the easiest way might be to create a format that combines those two values. Assuming the values are numbers then the format definition might look like:
proc format ;
value edu_combo
1,2 = '1 or 2'
;
run;
Then just use that format with your PROC .
proc freq data=mydata ;
tables edu_lvl;
format edu_lvl edu_combo.;
run;
Something messed up. obs 1 = 16 and obs 2 = 655. I want to combine them into one observation.
So given this data, what does your desired result look like?
@vijay24 wrote:
Considering low responses I want to add levels '1' and '2' together.
I don't understand this sentence.
Please show us the results you want from this data.
In addition, it is best if you provide the data in a readable form, prefereably as a SAS data step, instructions are here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...
the easiest way might be to create a format that combines those two values. Assuming the values are numbers then the format definition might look like:
proc format ;
value edu_combo
1,2 = '1 or 2'
;
run;
Then just use that format with your PROC .
proc freq data=mydata ;
tables edu_lvl;
format edu_lvl edu_combo.;
run;
@Tom Thank you so much. This worked perfectly fine.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.