Download presentation
Presentation is loading. Please wait.
Published byBenedicte Hoff Modified over 5 years ago
1
Outline READ DATA DATA STEPS MERGE DATA PROC IMPORT
PROC UNIVERIATE & PROC MEANS PROC FREQ & PROC GCHART ODS SYSTEM Probability ONE SAMPLE T-TEST TWO SAMPLE T-TEST & NON-PARAMETRIC TEST ANOVA CHI-SQUIRE TEST, FISHER’S EXACT TEST PROC CORR, PROC REG, PROC GLM
2
Read Data (I) DATA AA; INPUT ID $ X1-X3 GENDER $; DATALINES; M M M M ;
3
Read Data (II) – create new variables
DATA newdata; SET OLDDATA; NEWVAR=LOG(X); RUN;
4
Read Data (III) PROC IMPORT From excel, CVS, etc.
PROC IMPORT OUT= WORK.dat1 DATAFILE="datafile.xls" DBMS=EXCEL REPLACE; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN;
5
Read Data – Set, Merge DATA newdata; SET dat1 dat2; RUN; MERGE dat1 dat2; BY variables;
6
Generate data by SAS (simulation)
simulation study Example: DATA simunormal; DO X=1 to 100; Y=1+0.5*X+normal(-1); OUTPUT; END; RUN; PROC GLM; MODEL Y=X;
7
PROC UNIVERIATE & PROC MEANS
PROC UNIVERIATE DATA=mydata NORMAL; VAR var1 var2; RUN; PROC MEANS DATA=mydata MEAN STD Q1 MEDIAN Q3;
8
PROC FREQ & PROC GCHART PROC FREQ < options > ; BY variables ; EXACT statistic-options < / computation-options > ; OUTPUT < OUT=SAS-data-set > options ; TABLES requests < / options > ; WEIGHT variable < / option > ; PROC GCHART<DATA=input-data-set> BLOCK chart-variable(s) </ option(s)>; HBAR | HBAR3D | VBAR | VBAR3Dchart-variable(s) </ option(s)>; PIE | PIE3D | DONUT chart-variable(s) </ option(s)>;
9
ODS SYSTEM ods rtf file=‘filename’; ods output
10
Probability Randomization
11
ONE SAMPLE T-TEST PROC TTEST < options > ; CLASS variable ; PAIRED variables ; BY variables ; VAR variables ; FREQ variable ; WEIGHT variable ;
12
TWO SAMPLE T-TEST & NON-PARAMETRIC TEST
Independent sample Dependent sample – paired ttest PROC TTEST < options > ; CLASS variable ; PAIRED variables ; BY variables ; VAR variables ; FREQ variable ; WEIGHT variable ;
13
ANOVA PROC ANOVA < options > ; CLASS variables < / option > ; MODEL dependents=effects < / options > ; BY variables ;
14
CHI-SQUIRE TEST FISHER’S EXACT TEST
PROC FREQ < options > ; BY variables ; EXACT statistic-options < / computation-options > ; OUTPUT < OUT=SAS-data-set > options ; TABLES requests < / options > ; TEST options ; WEIGHT variable < / option > ; TABLES Statement Options AGREE, BINOMIAL, CHISQ, FISHER
15
PROC CORR, PROC REG, PROC GLM
PROC CORR; var x1-x10; run; PROC REG; model y=x1-x10; PROC GLM; class x1-x3; model y=x1-x10; PROC MIXED
16
PROC LOGISTIC Binary or ordinal data
PROC LOGISTIC; MODEL Y = X1 X2 X3; RUN; Nominal data PROC LOGISTIC; MODEL Y = X1 X2 X3 / link = glogit;
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.