Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- SMDCR - measures - proc freq

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-22-2022 04:12 PM
(1133 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

**Available on demand!**

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

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.