- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- 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
- 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.