logo_learn_stats

The way to Calculate Cruel, Median, & Form in SAS

Posted on
banner 336x280

You’ll usefulness proc univariate to temporarily calculate the ruthless, median, and method of variables in SAS.

This process makes use of refer to modest syntax:

banner 468x60
proc univariate information=my_data;
run;

Refer to instance presentations the way to usefulness this syntax in follow.

Instance: Calculate Cruel, Median & Form for All Variables

Assume now we have refer to dataset in SAS:

/*develop dataset*/
information my_data;
    enter staff $ issues rebounds assists;
    datalines;
A 25 10 8
B 18 4 5
C 18 7 10
D 24 12 4
E 27 11 5
F 30 8 7
G 12 8 5
;
run;

/*view dataset*/
proc print information=my_data;

We will usefulness refer to code to calculate the ruthless, median and method for all variables in our dataset:

/*calculate ruthless, median, method for each and every variable in my_data*/
proc univariate information=my_data;
run;

This code produces refer to output:

1. Cruel, Median & Form for Issues Variable

We will see:

  • The ruthless issues worth is 22.
  • The median issues worth is 24.
  • The method issues worth is 18.

2. Cruel, Median & Form for Rebounds Variable

We will see:

  • The ruthless rebounds worth is 8.57.
  • The median rebounds worth is 8.
  • The method rebounds worth is 8.

3. Cruel, Median & Form for Assists Variable

We will see:

  • The ruthless assists worth is 6.28.
  • The median assists worth is 5.
  • The method assists worth is 5.

Should you’d like to just calculate the ruthless, median and method for one explicit variable, you’ll usefulness refer to syntax:

/*calculate ruthless, median, and method just for issues variable*/
proc univariate information=my_data;
    var issues;
run;

The ruthless, median and method values will best be calculated for the issues variable.

Observe: You’ll in finding the whole documentation for PROC UNIVARIATE right here.

Supplementary Assets

Refer to tutorials provide an explanation for the way to carry out alternative ordinary duties in SAS:

The way to Calculate Correlation in SAS
The way to Determine Outliers in SAS
The way to Assemble Frequency Tables in SAS

banner 336x280

Leave a Reply

Your email address will not be published. Required fields are marked *