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?
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.