Data Analysis [8-15]
Working with Multiple Analysis Variables
(Proc Means)
You can analyze multiple variable(s) simultaneously using Proc Means.
Example
Example
The SALES data set contains the first 10 sales made by two salespersons.
Let's compare the sales performance between the two.
Example
Proc Means Data=Sales;
Var Sales1 Sales2;
Run;
The VAR statement has two variables: Sales1 and Sales2.
The statistics are computed for both variables:
Additional Statistics
You can also request other statistics to be computed, just like when you have only 1 variable:
Example
Proc Means Data=Sales Mean CLM;
Var Sales1 Sales2;
Run;
The Mean and the 95% Confidence Limits will be computed instead:
Exercise
Copy and run the STOCKS data set below:
Copy and run the STOCKS data set below:
The STOCKS data set contains the stock prices for Microsoft Corporation (MSFT) from October 12, 2015 to October 23, 2015.
Below are the list of variables from the STOCKS data set:
- Date
- Open: Opening Price
- High: Highest Price
- Low: Lowest Price
- Close: Closing Price
Compute the 5 default statistics (N, Mean, STD, Min and Max) on the 4 prices.
Need some help?
HINT:
List all of the variables to be analyzed in the VAR statement.
SOLUTION:
Proc Means Data=Stocks;
Var Open High Low Close;
Run;
Fill out my online form.