BookmarkSubscribeRSS Feed
sas1018
Fluorite | Level 6

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

 

 

7 REPLIES 7
Reeza
Super User

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
Fluorite | Level 6
Thanks for the reply Reeza. Yes, var1 has repeats.
Reeza
Super User
If you need the data summarized then you need to use a different statement then. Can you provide more details about your data and your desired graph?

This is a great set of examples here to help get you started otherwise:
https://robslink.com/SAS/ods2/aaaindex.htm
ballardw
Super User

@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
Fluorite | Level 6
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’.
ballardw
Super User

@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.

 

 

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2881 views
  • 0 likes
  • 3 in conversation