BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Rhodochrosite | Level 12

Hello Experts,

 

I'm wondering if it is possible to calculate the cv wit proc tabulate for all variables.

When i try my code it does not work :


proc tabulate data=bdd;
	class departement;
	var _all_;
	table nom_departement, (_all_)*cv;
run;

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Kathryn_SAS
SAS Employee

Please send your complete SAS log from the code below and the results of the PROC CONTENTS and PROC FREQ as attachments (not partial screenshots).

proc contents data=bdd;
run;

proc tabulate data=bdd;
class departement;
var Nmbr_de_lgm;
table departement, (Nmbr_de_lgm)*(cv);
run;

proc freq data=bdd;
tables Nmbr_de_lgm / missing;
run;

View solution in original post

9 REPLIES 9
Sa_S
SAS Employee

Hi @SASdevAnneMarie ,

you can use  _NUMERIC_ (not _ALL_) because variables listed in the VAR statement of PROC TABULATE must be numeric, and CV is a valid TABULATE statistic keyword.



proc tabulate data=bdd;
  class nom_departement;
  var _numeric_;
  table nom_departement, (_numeric_)*(cv);
run;

Please consider the following documentation for additional details:
SAS Elementary Statistics Procedures : Keywords and Formulas
SAS Help Center: Syntax: PROC TABULATE TABLE Statement

Hope this helps you!

SASdevAnneMarie
Rhodochrosite | Level 12
It is strange, but I have no output even for 1 variable :
29 proc tabulate data=bdd;
30 class departement;
31 var Nmbr_de_lgm;
32 table departement, (Nmbr_de_lgm)*(cv);
33 run;

WARNING: A logical page containing only missing values has been deleted from the output.
NOTE: There were 100 observations read from the data set WORK.BDD.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
Kathryn_SAS
SAS Employee

You would get this message if your numeric variable, Nmbr_de_lgm, has all missing values. To check, run the following:

proc freq data=bdd;
tables Nmbr_de_lgm / missing;
run;
SASdevAnneMarie
Rhodochrosite | Level 12
I don't have the missing values in variables.
Kathryn_SAS
SAS Employee

Can you send the results of the PROC FREQ I suggested?

SASdevAnneMarie
Rhodochrosite | Level 12

My data does not have the missing values, I can not understand why the proc tabulate does not work ( :

 

SASdevAnneMarie_0-1771263787944.png

 

Kathryn_SAS
SAS Employee

Please send your complete SAS log from the code below and the results of the PROC CONTENTS and PROC FREQ as attachments (not partial screenshots).

proc contents data=bdd;
run;

proc tabulate data=bdd;
class departement;
var Nmbr_de_lgm;
table departement, (Nmbr_de_lgm)*(cv);
run;

proc freq data=bdd;
tables Nmbr_de_lgm / missing;
run;
SASdevAnneMarie
Rhodochrosite | Level 12
Thank you, Kathryn!
ballardw
Super User

@SASdevAnneMarie wrote:
I don't have the missing values in variables.

How about all 0 values for Nmbr_de_lgm for one or more departement levels? The CV function has some issues with that I believe. 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 770 views
  • 5 likes
  • 4 in conversation