Proc Freq – Points to remember

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49379
    rlochan2021
    Keymaster

    Specifically used for Categorical variables as it can be summarized using a frequency table.
    PROC FREQ < options > ;
    TABLES requests < / options > ;
    BY variables ;
    WEIGHT variable < / option > ;
    TEST options ;
    EXACT statistic-options < / computation-options > ;
    OUTPUT < OUT=SAS-data-set > options ;
    RUN;

    Default output is – one way frequency tables.
    contents are:- frequency, percent,cumutative frequency, cumutative percent

    if tables statement is removed:- then we get one way freq table created for all the vars.

    By statement – requirement- by vars should be sorted or indexed. use to group analysis results

    options used:-

    to suppress statistics- tables a1 / nocum nopercent;

    nlevels- to check distinct values, so used for checking duplicates

    noprint- no displays of frequency counts (with table statement)

    order=freq –

    it will order is descending frequency so can also be used to check duplicates

    uses of proc freq:-

    1.chi square tests for one way to n-way tables.
    2.test and measurement of agreement for contingency tables.
    3.for data validation-provides all discrete values, with nlevels all distinct values, reports missing values.

    proc freq data=xyz nlevels;
    tables _all_/noprint;
    run;

    #49381
    rlochan2021
    Keymaster

    crosstabulation tables:-

    proc freq data=xyz;
    tables a1*a2;
    run;

    options- norow , nocol

    #49382
    rlochan2021
    Keymaster

    proc freq data=xyz order=freq;
    tables a1 / nocum nopercent;
    run;

    a1 freq
    2 1
    3 3
    3 1
    4 2
    3 1

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.