SAS/Descriptive Statistics

From Wikibooks, the open-content textbooks collection

< SAS
Jump to: navigation, search

Contents

[edit] List and describe your data

Describe your data

 proc contents data=lib_name.data_name;
 title "Describe the content of a database";
 run;

List your data in the output

 proc print data=lib_name.data_name (firstobs=30 obs=40);
 title "Partial Listing";
 run;

[edit] Discrete Variables

 proc freq data=lib_name.data_name;
 tables x1 x2 ;
 title "frequence table";
 run;
  • weight specify weights
 proc freq data=lib_name.data_name;
 weight extri;
 tables x1 / out=temp4 outexpect;
 run;

[edit] Contingency Tables

 proc freq data=lib_name.data_name;
 tables x1*x2 ;
 title "contingency table";
 run;

[edit] Continuous Variables

 proc means data=lib_name.data_name;
 var x1 x2;
 class sexe;
 weight extri;
 run;
 proc univariate data=lib_name.data_name;
 var x1;
 histogram / normal(color=red mu=0 sigma=0.045) kernel(color=blue);
 title "Proc Univariate";
 run;

[edit] Kernel and Histograms

 proc capability data=lib_name.data_name;
 histogram x1 / normal(color=red mu=0 sigma=0.045)
 kernel(color=blue);
 title "Proc Capability";
 run;
 proc corr data=lib_name.data_name;
 var x1 x2 x3;
 weight extri;
 title3 "Linear correlation";
 run;

[edit] T Test

proc ttest data = taille h0=1.75 alpha=0.05;
var x;
run;