Posts Tagged ‘ Getting Started ’

Read data into vectors or into a matrix: Which is better?

February 8, 2016
By
Read data into vectors or into a matrix: Which is better?

In the SAS/IML language, you can read data from a SAS data set into a set of vectors (each with their own name) or into a single matrix. Beginning programmers might wonder about the advantages of each approach. When should you read data into vectors? When should you read data

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Read data into vectors or into a matrix: Which is better?

Group processing in SAS: The NOTSORTED option

February 1, 2016
By
Group processing in SAS: The NOTSORTED option

Novice SAS programmers quickly learn the advantages of using PROC SORT to sort data, followed by a BY-group analysis of the sorted data. A typical example is to analyze demographic data by state or by ZIP code. A BY statement enables you to produce multiple analyses from a single procedure

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Group processing in SAS: The NOTSORTED option

What is a moving average?

January 25, 2016
By
What is a moving average?

A moving average (also called a rolling average) is a satistical technique that is used to smooth a time series. Moving averages are used in finance, economics, and quality control. You can overlay a moving average curve on a time series to visualize how each value compares to a rolling

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on What is a moving average?

Create a SAS macro variable that contains a list of values

January 18, 2016
By

Parameters in SAS procedures are specified a list of values that you manually type into the procedure syntax. For example, if you want to specify a list of percentile values in PROC UNIVARIATE, you need to type the values into the PCTLPTS= option as follows: proc univariate data=sashelp.cars noprint; var

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Create a SAS macro variable that contains a list of values

Compute a weighted mean in SAS

January 6, 2016
By
Compute a weighted mean in SAS

Weighted averages are all around us. Teachers use weighted averages to assign a test more weight than a quiz. Schools use weighted averages to compute grade-point averages. Financial companies compute the return on a portfolio as a weighted average of the component assets. Financial charts show (linearly) weighted moving averages

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Compute a weighted mean in SAS

Tabulate counts when there are unobserved categories

October 7, 2015
By
Tabulate counts when there are unobserved categories

Suppose that you are tabulating the eye colors of students in a small class (following Friendly, 1992). Depending upon the ethnic groups of these students, you might not observe any green-eyed students. How do you put a 0 into the table that summarizes the number of students who have each

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Tabulate counts when there are unobserved categories

Ten “one-liners” that create test matrices for statistical programmers

September 28, 2015
By

You've had a long day. You've implemented a custom algorithm in the SAS/IML language. But before you go home, you want to generate some matrices and test your program. If you are like me, you prefer a short statement—one line would be best. However, you also want the flexibility to

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Ten “one-liners” that create test matrices for statistical programmers

Excluding variables: Read all but one variable into a matrix

September 21, 2015
By
Excluding variables: Read all but one variable into a matrix

Dear Rick, I have a data set with 1,001 numerical variables. One variable is the response, the others are explanatory variable. How can I read the 1,000 explanatory variables into an IML matrix without typing every name? That's a good question. You need to be able to perform two sub-tasks:

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Excluding variables: Read all but one variable into a matrix

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com



Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.