*** Not spam !!!!! real programming question ** Thanks
I have data (2584 record) with three columns ( subject , Education level as Educ and income during 2005 as Income2005) and a category of five types under education level ( =12, 13-15 , 16, <12, >16) this is a bucket that contains income for each education distribution at Income2005 column . I want to draw Histogram and QQ plot of income 2005 distro side by side for each educ level . why this code is not working ? Thanks
proc import datafile='/folders/myfolders/ex0525.csv'
DBMS=csv out=IncomeData replace;
run;
proc print data=IncomeData;
run;
proc univariate data = incomedata;
class Educ;
var income2005;
run;
** the above code works fine but the below code doesn't plot the 5 histograms and 5 QQ plots of Income 2005 distribution for each Educ category
it just spits out Descriptive stat as Educ= 12 , ( there is no error but unneeded output)
proc univariate data = incomedata;
by Educ;
histogram income2005;
qqplot income2005;
run;
Note that PROC UNIVARIATE uses the formatted values of the CLASS variables to determine the classification levels, but uses the internal values for BY processing. Problems related to this difference typically generate errors in the SAS log.
There is no error generated , it just gives result ( descriptive stat) for the code shown. I want to generate histogram and qq plot side by side. I am expecting a result set showing all his and QQ under each category of Educ ( <12 yrs ,12yrs , 13-15 yrs , 16 yrs , >16 yrs ).Can you help me with a working solution using the code or any other way as an example.Thanks
Here is an example that works for me:
proc sort data=sashelp.heart out=sortedHeart; by smoking_status; run;
ods pdf file="Brook2_example.pdf";
proc univariate data = sortedHeart noprint;
where smoking_status is not missing;
by smoking_status;
histogram cholesterol;
qqplot cholesterol;
run;
ods pdf close;
Result pdf attached.
@PGStats Thanks for your time and help . But I am still missing three categories for Educ <12 , Educ 13-15 Educ >16 catagory , it is only giving me Educ =12 and Educ =16 , looks like it is not taking the less than or greater than or in between values
I reused the code you posted below ,here is the result
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: