Upload
gwyn
View
26
Download
0
Embed Size (px)
DESCRIPTION
PC baseret dataanalyse og simulering Week2 B. SAS. Procedurer. Delmængder af data II PROCedurer. Eksempel: proc print; where koen=‘F’;. Procedurer. proc contents; proc print;. Procedurer. proc sort; by koen; proc means; proc means; by koen;. Procedurer. - PowerPoint PPT Presentation
Citation preview
11
PC baseret PC baseret dataanalyse og dataanalyse og simulering simulering
Week2 BWeek2 B
22
SASSAS
ProcedurerProcedurer
33
Delmængder af data II Delmængder af data II PROCedurer PROCedurer
• Eksempel:Eksempel:
• proc print;proc print;
where koen=‘F’;where koen=‘F’;
44
ProcedurerProcedurer
• proc contents;proc contents;
• proc print;proc print;
55
ProcedurerProcedurer
• proc sort;proc sort;
by koen;by koen;
• proc means;proc means;
• proc means;proc means;
by koen;by koen;
66
ProcedurerProcedurer • PROC MEANS;PROC MEANS;
• PROC MEANS options;PROC MEANS options;
VAR variables;VAR variables;
(PROC MEANS laver sit eget output)(PROC MEANS laver sit eget output)
77
ProcedurerProcedurer
• output out=;output out=;
• output out=B mean=meanx;output out=B mean=meanx;
• output out=mysas.helbred2 output out=mysas.helbred2
sum=sumx N=antal sum=sumx N=antal mean=mean;mean=mean;
88
ProcedurerProcedurer
• proc univariate;proc univariate;
• proc freq;proc freq;
• proc corr;proc corr;
99
Hente et datasæt, som så er Hente et datasæt, som så er defaultdefault
• Libname F_sas ‘f:\dataanalyse\week2\Libname F_sas ‘f:\dataanalyse\week2\SAS_F’;SAS_F’;
• Data temp;Data temp;
set F_sas.dat85tot;set F_sas.dat85tot;
1010
Proc freqProc freq
• proc freq;proc freq;
tables alder koen;tables alder koen;
• proc freq;proc freq;
tables alder * koen;tables alder * koen;
1111
Proc tabulateProc tabulate
• proc tabulate;proc tabulate;
class alder koen;class alder koen;
table alder, koen;table alder, koen;
1212
PProc corrroc corr
• proc corr;proc corr;
var hojde vaegt;var hojde vaegt;
Output:Output:
Rho = 0, nulhypoteseRho = 0, nulhypotese
P-værdi, test af om den sande correlation er P-værdi, test af om den sande correlation er 00
1313
Proc corr;Proc corr;
!-------------------------------!!-------------------------------!! Korrelations-koefficienter !! Korrelations-koefficienter !!--------------!----------------!!--------------!----------------!! r ! korrelation !! r ! korrelation !!--------------!----------------!!--------------!----------------!! 0.00 - 0.19 ! meget svag !! 0.00 - 0.19 ! meget svag !! 0.20 - 0.39 ! svag !! 0.20 - 0.39 ! svag !! 0.40 - 0.69 ! moderat !! 0.40 - 0.69 ! moderat !! 0.70 - 0.89 ! staerk !! 0.70 - 0.89 ! staerk !! 0.90 - 1.00 ! meget staerk !! 0.90 - 1.00 ! meget staerk !!--------------!----------------!!--------------!----------------!
1414
SASSAS
Put og FilePut og File
1515
SAS - put og fileSAS - put og file
Eksempel:Eksempel:
File print;File print;
*File “H:/mysas/udfil”;*File “H:/mysas/udfil”;
put navn 1-10 @12 foeddag persnr /;put navn 1-10 @12 foeddag persnr /;
1616
SASSAS
GrafikGrafik
1717
SAS / GraphSAS / Graph
• proc gplot;proc gplot;
• proc gchart;proc gchart;
• proc g3d;proc g3d;
• proc gslide;proc gslide;
1818
PProc gplotroc gplot
• proc corr;proc corr;
var hojde vaegt;var hojde vaegt;
symbol1 V=dot C=red I=RL CI=blue;symbol1 V=dot C=red I=RL CI=blue;
• Proc gplot;Proc gplot;
plot hoejde*vaegt=plot hoejde*vaegt=11 hoejde*diastole= hoejde*diastole=11;;
runrun;;
1919
SAS / Graph - æ, ø og åSAS / Graph - æ, ø og å
*goptions devmap=winansi *goptions devmap=winansi keymap=winansi;keymap=winansi;
proc gslide;proc gslide;
title F=swiss "Blåbærgrød";title F=swiss "Blåbærgrød";
run;run;
2020
SAS / Graph - fonte SAS / Graph - fonte med æ, ø og åmed æ, ø og å
SIMULATE SIMULATE
CENT**** (flere fonte) CENT**** (flere fonte)
SWISS**** (flere fonte) , SWISS**** (flere fonte) ,
f.eks. Swiss, Swissl m.fl. f.eks. Swiss, Swissl m.fl.
ZAPF**** (flere fonte) ZAPF**** (flere fonte)