BookmarkSubscribeRSS Feed
Thalitacosta
Obsidian | Level 7

 

proc freq data=base noprint;

tables var*def/ measures;

by date;

output out=Resul_GINI measures;

run;

 

 

I am doubting the variables used, because I have a database that has all the observations, in which: date = month/year, var = rating (category From A to H) and def = default marking (0 or 1).

 

I have another basis which is the frequency of these cases, on which date, var, and def = amount of "1".

 

This right of which way?

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I don't understand the question.

 

You say you are doubting the variables used, but you don't explain why you are doubting them or what makes you doubtful. You also don't explain what this analysis is supposed to do, and what you would like to learn from this analysis.

--
Paige Miller
ballardw
Super User

When you use a tables statement like

tables var*def/ measures;

If either Var or Def has missing values then both value from that record will be excluded. Did you see anything in your output about "missing values"?

So if you compare the counts from something else that does the variables alone the count will not match.

 

Run this code for a brief example:

data example;
   input x y;
datalines;
1 2
1 3
1 .
2 1
. 2
2 2
;

proc freq data = example;
   tables x y;
   tables x*y;
run;

The tables that have the individual counts of x and y both say there are 5 values of each. But the table from X*Y only shows 4 each because of the missing values in the pairs.

If you want to force the counts to match you can add the /missing  option to the Tables statement. However that means that missing becomes a category in the analysis and may not be desired for other reasons.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register 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
  • 2 replies
  • 1197 views
  • 3 likes
  • 3 in conversation