Skip to content

Instantly share code, notes, and snippets.

@abhishekdagarit
abhishekdagarit / lists in r.md
Last active October 30, 2017 18:32
Lists in R

Creating a list

A list is like a super data type that can hold any other data type inside it.

# Vector with numerics from 12 up to 100
my_vector <- 12:100 

# Matrix with numerics from 1 up to 8
my_matrix &lt;- matrix(1:8, ncol = 2)
@abhishekdagarit
abhishekdagarit / Merging datasets in SAS.md
Last active September 27, 2017 15:42
Merging datasets in SAS

Merging datasets in SAS

The process is straight forward.

Data 1

data d1;
input name$ age;
@abhishekdagarit
abhishekdagarit / SQL select statement.md
Last active September 27, 2017 15:26
Basic SQL commands to be used in SAS as well as any other place.

SQL select statement

Select

Simplest Select satament

proc sql;
select * 
@abhishekdagarit
abhishekdagarit / Global statements in SAS.md
Last active September 23, 2017 08:33
Global statements in SAS

Global statements in SAS

List of global statements in SAS

  1. title
  2. options
  3. footnote

Properties of global statements in SAS

@abhishekdagarit
abhishekdagarit / Frequency in SAS.md
Last active September 23, 2017 08:36
Frequency in SAS

Frequency in SAS

Used using the proc freq statement

complete frequency table

proc freq data=work.test;
run;
@abhishekdagarit
abhishekdagarit / Special cases.md
Last active September 22, 2017 15:50
Special cases

Special cases

Maximum number of decimal places

proc print data=work.temp maxdec=2;
run;

labels in SAS

@abhishekdagarit
abhishekdagarit / Calculating mean in SAS.md
Last active September 23, 2017 08:36
Calculating mean in SAS

Calculating mean in SAS

To calculate mean simply use proc means

proc means data = work.test;
var ratings;
run;
@abhishekdagarit
abhishekdagarit / Sum of variables.md
Last active September 21, 2017 15:33
Sum of variables

Sum of single variable

Simply write sum followed by the variable name.

proc print data=test;
sum salary;
run;
@abhishekdagarit
abhishekdagarit / Sort function in SAS.md
Last active September 22, 2017 12:48
Sort function in SAS

Sort function in SAS

By

Basic sort function. Uses by.

proc sort data=work.test;
by Salary;
@abhishekdagarit
abhishekdagarit / SAS rules.md
Last active October 12, 2017 10:12
SAS rules

SAS rules

Case sensitive

SAS in not case sensitive.

proC PrinT daTa = woRK.IntrO;
WHerE Rating = 2;
run;