Hi
I am getting below warning for sgplot procedure.
WARNING: The data for a BARCHARTPARM statement are not appropriate. The BARCHARTPARM statement expects summarized data. The bar chart might not be drawn correctly.
What will be the reason for this type of warnings? My code looks something like below:
proc sgplot data=name;
hbarparm category=var1 response=var2 / group=var3 outline fill barwidth=.7 dataskin=none
clusterwudth=0.1;
run;
TIA
How is your data structured? Do you have repeats for VAR1 for example?
EDIT: the warning indicates an issue with your data not with your code.
@sas1018 wrote:
Hi
I am getting below warning for sgplot procedure.
WARNING: The data for a BARCHARTPARM statement are not appropriate. The BARCHARTPARM statement expects summarized data. The bar chart might not be drawn correctly.
What will be the reason for this type of warnings? My code looks something like below:
proc sgplot data=name;
hbarparm category=var1 response=var2 / group=var3 outline fill barwidth=.7 dataskin=none
clusterwudth=0.1;
run;
TIA
@sas1018 wrote:
Hi
I am getting below warning for sgplot procedure.
WARNING: The data for a BARCHARTPARM statement are not appropriate. The BARCHARTPARM statement expects summarized data. The bar chart might not be drawn correctly.
What will be the reason for this type of warnings? My code looks something like below:
proc sgplot data=name;
hbarparm category=var1 response=var2 / group=var3 outline fill barwidth=.7 dataskin=none
clusterwudth=0.1;
run;
TIA
The hbarparm and vbarparm, related to the Graphics template language Barchartparm (same error message for all of these plots) means that you can only have one combination of the category and group variable with a single value as the response. Two small examples you can run. Note that the second generates the warning you mention because the x=1 and y=2 has two values.
data example; input x y z; datalines; 1 1 23 1 2 33 1 3 18 ; proc sgplot data=example; hbarparm category=x response=z/ group=y; run; data example2; input x y z; datalines; 1 1 23 1 2 33 1 2 16 1 3 18 ; proc sgplot data=example2; hbarparm category=x response=z/ group=y; run;
If your data looks like the Example2 above then you use an HBAR plot, the Response variable is then an option after the /. By default the Hbar or Vbar would Sum the response variable values, you could request other statistics.
@sas1018 wrote:
Thanks for the reply Ballardw. My data looks something like example2(also have repeats of x). I tried to use the Response variable after the /, it is giving me an error like ‘expecting a RESPONSE’.
ANY time you get an error, copy the text from the log the code and all messages related to the procedure or data step. Then on the forum open a text box using the </> icon and paste all of the text.
The text box is important because the forum main windows will reformat text which may move diagnostic characters that often appear with errors making the text less useful.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.