This document contains examples of SAS code for performing common statistical analyses and data management tasks. It includes examples of importing data, sorting, calculating summary statistics, linear and nonlinear regression, ANOVA, plotting graphs, and combining SAS data sets. The examples progress from basic to more advanced analyses and demonstrate important SAS procedures like PROC PRINT, PROC SORT, PROC MEANS, PROC REG, PROC GLM, PROC PLOT and more.
These are photos from the 2012 Thai National Seminar on Community Forestry, which took place on 13-14 November 2012 in Nakhon Nayok, Thailand and was organized by RECOFTC's Thailand Country Program. The theme of 2012's National Seminar was: “Community Forest: A Movement to Protect Local Ecologies and Community Rights.”
These are photos from the 2012 Thai National Seminar on Community Forestry, which took place on 13-14 November 2012 in Nakhon Nayok, Thailand and was organized by RECOFTC's Thailand Country Program. The theme of 2012's National Seminar was: “Community Forest: A Movement to Protect Local Ecologies and Community Rights.”
SAS codes and tricks Comprehensive all codessrizrazariz
https://www.dropbox.com/sh/s12ibnz9e14sn7d/AADmeewvF8Q2gfHwRMKMd_Jda?dl=0
sas useful codes and tricks
https://www.dropbox.com/sh/s12ibnz9e14sn7d/AADmeewvF8Q2gfHwRMKMd_Jda?dl=0
Random stability in systemVerilog and UVM based testbenchKashyap Adodariya
All about random stability in sv and UVM based testbench including examples. Represent through example and dig. Also explain how any process get seed for randomize.
SAS codes and tricks Comprehensive all codessrizrazariz
https://www.dropbox.com/sh/s12ibnz9e14sn7d/AADmeewvF8Q2gfHwRMKMd_Jda?dl=0
sas useful codes and tricks
https://www.dropbox.com/sh/s12ibnz9e14sn7d/AADmeewvF8Q2gfHwRMKMd_Jda?dl=0
Random stability in systemVerilog and UVM based testbenchKashyap Adodariya
All about random stability in sv and UVM based testbench including examples. Represent through example and dig. Also explain how any process get seed for randomize.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Sas code for examples from a first course in statistics
1. SAS Code for Examples from a First Course in Statistics
If you are running in batch mode, set options at the start of each script so that
output will be formatted to fit on a letter size page.
options linesize=64 pagesize=55;
Do a simple probability calculation and display the result
data race;
pr = probnorm(-15/sqrt(325));
run;
proc print data=race;
var pr;
run;
Do a simple probability calculation and display the result with PROC IML
proc iml;
FF = FINV(0.05/32,2,29);
print FF;
quit;
Compute, display and plot the ratio of confidence limits for a normal variance
(Try writing a simpler version of this using PROC IML.)
data chisq;
input df;
chirat = cinv(.995,df)/cinv(.005,df);
datalines;
20
21
22
23
24
25
26
27
28
29
30
;
run;
proc print data=chisq;
var df chirat;
run;
proc plot data=chisq;
2. plot chirat*df;
run;
Do a 2-Factor ANOVA, data entered in the script
data copper;
input id warp temp pct;
datalines;
1 17 50 40
2 20 50 40
3 16 50 60
4 21 50 60
5 24 50 80
6 22 50 80
9 12 75 40
10 9 75 40
11 18 75 60
12 13 75 60
13 17 75 80
14 12 75 80
25 21 125 40
26 17 125 40
27 23 125 60
28 21 125 60
29 23 125 80
30 22 125 80
;
proc anova data=copper;
class temp pct;
model warp= temp | pct;
run;
Do a Simple Linear Regression and plot the result from PROC REG
(Plotting from PROC REG does not work in batch mode)
data crack;
input id age load;
datalines;
1 20 11.45
2 20 10.42
3 20 11.14
4 25 10.84
5 25 11.17
6 25 10.54
7 31 9.47
8 31 9.19
9 31 9.54
;
proc reg data=crack;
model load = age;
plot predicted. * age = 'P' load * age = '*' / overlay;
3. run;
Scatter plot in batch mode
data crack;
input id age load;
datalines;
1 20 11.45
2 20 10.42
3 20 11.14
4 25 10.84
5 25 11.17
6 25 10.54
7 31 9.47
8 31 9.19
9 31 9.54
;
proc plot data=crack;
plot load * age = "*";
run;
Simple Linear Regression and scatter plot with overlay in batch mode
data crack;
input id age load;
datalines;
1 20 11.45
2 20 10.42
3 20 11.14
4 25 10.84
5 25 11.17
6 25 10.54
7 31 9.47
8 31 9.19
9 31 9.54
;
proc reg data=crack;
model load = age / p;
output out=crackreg p=pred r=resid;
run;
proc plot data=crackreg;
plot load*age="*" pred*age="+"/ overlay;
run;
Simple Linear Regression ANOVA with non-linearity test, scatter plot with
overlay in batch mode
data crack;
input id age load agef;
datalines;
1 20 11.45 20
4. 2 20 10.42 20
3 20 11.14 20
4 25 10.84 25
5 25 11.17 25
6 25 10.54 25
7 31 9.47 31
8 31 9.19 31
9 31 9.54 31
;
proc glm data=crack;
class agef;
model load = age agef / p;
output out=crackreg p=pred r=resid;
run;
proc plot data=crackreg;
plot load*age="*" pred*age="+"/ overlay;
run;
Two-Factor ANOVA, data entered in the script
data toxic;
input life poison $ treatment $;
datalines;
0.31 I A
0.45 I A
0.46 I A
0.43 I A
0.36 II A
0.29 II A
0.40 II A
0.23 II A
0.22 III A
0.21 III A
0.18 III A
0.23 III A
0.82 I B
1.10 I B
0.88 I B
0.72 I B
0.92 II B
0.61 II B
0.49 II B
1.24 II B
0.30 III B
0.37 III B
0.38 III B
0.29 III B
0.43 I C
0.45 I C
0.63 I C
0.76 I C
0.44 II C
0.35 II C
0.31 II C
5. 0.40 II C
0.23 III C
0.25 III C
0.24 III C
0.22 III C
0.45 I D
0.71 I D
0.66 I D
0.62 I D
0.56 II D
1.02 II D
0.71 II D
0.38 II D
0.30 III D
0.36 III D
0.31 III D
0.33 III D
;
run;
proc anova data=toxic;
class poison treatment;
model life = poison treatment poison*treatment;
run;
Two-Factor ANOVA, data from a comma-delimited text file
data toxic;
infile "toxic.dat" dlm=",";
input life poison $ treatment $;
run;
proc anova data=toxic;
class poison treatment;
model life = poison treatment poison*treatment;
run;
SAS Program
*** EXAMPLE 1 ********************;
*** Data input, sort and print ***;
**********************************;
OPTIONS PS=55 LS=77 NOCENTER NODATE NONUMBER;
DATA paintdry; INFILE CARDS MISSOVER;
INPUT status $ luster hardness timeoday $;
CARDS; RUN;
Fresh 7 3 Early
Dried 8 9 Early
Fresh 6 3
Dried 8 7 Late
Fresh 5 6 Late
;
PROC SORT; BY status luster hardness; RUN;
PROC PRINT; RUN;
6. *** EXAMPLE 2 ******************************;
*** Data input and means on two variables ***;
*** Output statement ***;
********************************************;
OPTIONS PS=51 LS=78 NOCENTER NODATE NONUMBER;
data one; infile cards;
input x y;
cards; run;
1 1
2 3
3 4
4 4
4 5
5 7
7 6
9 7
;
proc means MIN MAX SUM STD USS; var x y; run;
Proc print data=one; run;
OPTIONS PS=31 LS=80;
Proc plot data=one; plot x*y; run;
OPTIONS PS=52;
*** EXAMPLE 3 ********************;
*** Data input, sort and print ***;
**********************************;
OPTIONS PS=53 LS=79 NOCENTER NODATE NONUMBER;
DATA NEW3; INFILE CARDS MISSOVER;
INPUT day number type $ model $;
CARDS; RUN;
17 9 TRUCKS SEMI
18 8 TRUCKS SEMI
19 2 TRUCKS PICKUP
22 4 TRUCKS SEMI
16 3 CARS COUPE
17 2 CARS COUPE
18 3 CARS SEDAN
19 1 CARS SEDAN
22 5 CARS SEDAN
17 1 VANS 5DOOR
17 4 VANS 4DOOR
19 2 VANS 5DOOR
;
PROC SORT DATA=NEW3; BY type model day number; RUN;
TITLE1 'My raw data is listed below';
PROC PRINT DATA=NEW3 double; VAR type model day number; RUN;
PROC SORT DATA=NEW3; BY TYPE; RUN;
TITLE1 'Selected means are provided below';
PROC MEANS DATA=NEW3; BY type; VAR number day; RUN;
PROC SORT DATA=NEW3; BY type; RUN;
PROC MEANS DATA=NEW3 NOPRINT; BY type; VAR number day;
OUTPUT OUT=THREE N=NNo DNo MEAN=NMEAN DMEAN VAR=NVAR DVAR; RUN;
TITLE1 'Outputted means are listed below';
7. PROC PRINT DATA=THREE; VAR TYPE NNo DMEAN NVAR DNo NMEAN DVAR; RUN;
*** EXAMPLE 4 ********************************************;
*** Reading a file and saving a permanent SAS data set ***;
**********************************************************;
OPTIONS PS=55 LS=77 NOCENTER NODATE NONUMBER;
libname mylib 'A:';
DATA mylib.OLD_DATA; INFILE CARDS MISSOVER;
INPUT MONTH DAY YEAR STATION $ SPECIES $ NUMBER;
LABEL STATION = 'Sample stations';
LABEL SPECIES = 'Species common name';
LABEL STATION = 'Number caught';
CARDS; RUN;
01 8 97 North Spot 8
01 8 97 North Croaker 3
01 8 97 South Spot 11
03 23 97 North Spot 2
03 23 97 South Spot 5
05 15 97 North Spot 1
05 15 97 North Croaker 3
05 15 97 South Spot 17
05 15 97 South Croaker 2
08 12 97 North Spot 8
08 12 97 North Croaker 3
08 12 97 North RedDrum 1
08 12 97 North Spot 8
08 12 97 North Croaker 9
;
*** EXAMPLE 5 **************************;
*** Reading a permanent SAS data set ***;
*** Concatenating SAS data sets ***;
****************************************;
OPTIONS PS=55 LS=77 NOCENTER NODATE NUMBER PAGENO=1;
libname mylib 'A:';
TITLE1 'Example program #5';
DATA NEW_DATA; INFILE CARDS MISSOVER;
INPUT MONTH DAY YEAR STATION $ SPECIES $ NUMBER;
CARDS; RUN;
01 14 98 North Spot 12
01 14 98 North Croaker 1
01 14 98 North RedDrum 4
01 14 98 South Spot 5
03 6 98 South Spot 3
03 6 98 South Croaker 9
05 26 98 North Spot 11
05 26 98 North Croaker 12
05 26 98 South Spot 4
07 29 98 North Spot 24
07 29 98 North Croaker 16
07 29 98 North Spot 12
07 29 98 North Croaker 7
;
DATA MYLIB.ALL_DATA; SET mylib.old_data NEW_DATA;
sasdate = mdy(month, day, year); format sasdate date7.;
8. RUN;
PROC SORT DATA=MYLIB.ALL_DATA; BY SPECIES YEAR MONTH DAY; RUN;
PROC PRINT DATA=MYLIB.ALL_DATA;
TITLE2 'Raw data listing sorted by species y m d';
VAR SPECIES sasdate STATION NUMBER;
RUN;
PROC FREQ DATA=MYLIB.ALL_DATA; BY SPECIES; WEIGHT NUMBER;
TITLE2 'Species frequency (weighted by number)';
TABLE MONTH*STATION;
RUN;
PROC FREQ DATA=MYLIB.ALL_DATA; WEIGHT NUMBER;
TITLE2 'Species frequency - chi square test';
TABLE MONTH*STATION / chisq cellchi2 norow nocol nopercent;
RUN;
proc plot data=mylib.all_data;
TITLE2 'Scatter plot of number by date';
plot number*sasdate=species;
run;
proc chart data=mylib.all_data; by species;
TITLE2 'Horizontal bar chart';
hbar species / sumvar=number group=station type=sum;
run;
OPTIONS PS=30 LS=88;
proc chart data=mylib.all_data;
TITLE2 'Histogram';
vbar species / sumvar=number type=mean;
run;
SAS Log
1 *** EXAMPLE 1 ********************;
2 *** Data input, sort and print ***;
3 **********************************;
4 OPTIONS PS=55 LS=77 NOCENTER NODATE NONUMBER;
5 DATA paintdry; INFILE CARDS MISSOVER;
6 INPUT status $ luster hardness timeoday $;
7 CARDS;
NOTE: The data set WORK.PAINTDRY has 5 observations and 4 variables.
NOTE: The DATA statement used 0.05 seconds.
7 RUN;
13 ;
14 PROC SORT; BY status luster hardness; RUN;
NOTE: The data set WORK.PAINTDRY has 5 observations and 4 variables.
NOTE: The PROCEDURE SORT used 0.05 seconds.
15 PROC PRINT; RUN;
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: The PROCEDURE PRINT used 0.05 seconds.
16
17
18 *** EXAMPLE 2 ******************************;
9. 19 *** Data input and means on two variables ***;
20 *** Output statement ***;
21 ********************************************;
22 OPTIONS PS=51 LS=78 NOCENTER NODATE NONUMBER;
23 data one; infile cards;
24 input x y;
25 cards;
NOTE: The data set WORK.ONE has 8 observations and 2 variables.
NOTE: The DATA statement used 0.05 seconds.
25 run;
34 ;
35 proc means MIN MAX SUM STD USS; var x y; run;
NOTE: The PROCEDURE MEANS printed page 2.
NOTE: The PROCEDURE MEANS used 0.0 seconds.
36 Proc print data=one; run;
NOTE: The PROCEDURE PRINT printed page 3.
NOTE: The PROCEDURE PRINT used 0.0 seconds.
37 OPTIONS PS=31 LS=80;
38 Proc plot data=one; plot x*y; run;
39 OPTIONS PS=52;
40
41 *** EXAMPLE 3 ********************;
42 *** Data input, sort and print ***;
43 **********************************;
44 OPTIONS PS=53 LS=79 NOCENTER NODATE NONUMBER;
NOTE: The PROCEDURE PLOT printed page 4.
NOTE: The PROCEDURE PLOT used 0.0 seconds.
45 DATA NEW3; INFILE CARDS MISSOVER;
46 INPUT day number type $ model $;
47 CARDS;
NOTE: The data set WORK.NEW3 has 12 observations and 4 variables.
NOTE: The DATA statement used 0.05 seconds.
47 RUN;
60 ;
61 PROC SORT DATA=NEW3; BY type model day number; RUN;
NOTE: The data set WORK.NEW3 has 12 observations and 4 variables.
NOTE: The PROCEDURE SORT used 0.05 seconds.
62 TITLE1 'My raw data is listed below';
63 PROC PRINT DATA=NEW3 double; VAR type model day number; RUN;
NOTE: The PROCEDURE PRINT printed page 5.
NOTE: The PROCEDURE PRINT used 0.0 seconds.
64
65 PROC SORT DATA=NEW3; BY TYPE; RUN;
NOTE: Input data set is already sorted, no sorting done.
NOTE: The PROCEDURE SORT used 0.0 seconds.
66 TITLE1 'Selected means are provided below';
67 PROC MEANS DATA=NEW3; BY type; VAR number day; RUN;
NOTE: The PROCEDURE MEANS printed page 6.
NOTE: The PROCEDURE MEANS used 0.0 seconds.
68
69 PROC SORT DATA=NEW3; BY type; RUN;
NOTE: Input data set is already sorted, no sorting done.
NOTE: The PROCEDURE SORT used 0.0 seconds.
70 PROC MEANS DATA=NEW3 NOPRINT; BY type; VAR number day;
71 OUTPUT OUT=THREE N=NNo DNo MEAN=NMEAN DMEAN VAR=NVAR DVAR; RUN;
NOTE: The data set WORK.THREE has 3 observations and 9 variables.
NOTE: The PROCEDURE MEANS used 0.0 seconds.
10. 72 TITLE1 'Outputted means are listed below';
73 PROC PRINT DATA=THREE; VAR TYPE NNo DMEAN NVAR DNo NMEAN DVAR;
RUN;
NOTE: The PROCEDURE PRINT printed page 7.
NOTE: The PROCEDURE PRINT used 0.0 seconds.
74
75
76 *** EXAMPLE 4 ********************************************;
77 *** Reading a file and saving a permanent SAS data set ***;
78 **********************************************************;
79 OPTIONS PS=55 LS=77 NOCENTER NODATE NONUMBER;
80 libname mylib 'A:';
NOTE: Libref MYLIB was successfully assigned as follows:
Engine: V612
Physical Name: A:
81 DATA mylib.OLD_DATA; INFILE CARDS MISSOVER;
82 INPUT MONTH DAY YEAR STATION $ SPECIES $ NUMBER;
83 LABEL STATION = 'Sample stations';
84 LABEL SPECIES = 'Species common name';
85 LABEL STATION = 'Number caught';
86 CARDS;
NOTE: The data set MYLIB.OLD_DATA has 14 observations and 6 variables.
NOTE: The DATA statement used 5.21 seconds.
86 RUN;
101 ;
102
103 *** EXAMPLE 5 **************************;
104 *** Reading a permanent SAS data set ***;
105 *** Concatenating SAS data sets ***;
106 ****************************************;
107 OPTIONS PS=55 LS=77 NOCENTER NODATE NUMBER PAGENO=1;
108 libname mylib 'A:';
NOTE: Libref MYLIB was successfully assigned as follows:
Engine: V612
Physical Name: A:
109
110 TITLE1 'Example program #5';
111 DATA NEW_DATA; INFILE CARDS MISSOVER;
112 INPUT MONTH DAY YEAR STATION $ SPECIES $ NUMBER;
113 CARDS;
NOTE: The data set WORK.NEW_DATA has 13 observations and 6 variables.
NOTE: The DATA statement used 0.05 seconds.
113 RUN;
127 ;
128 DATA MYLIB.ALL_DATA; SET mylib.old_data NEW_DATA;
129 sasdate = mdy(month, day, year); format sasdate date7.;
130 RUN;
NOTE: The data set MYLIB.ALL_DATA has 27 observations and 7 variables.
NOTE: The DATA statement used 4.55 seconds.
131 PROC SORT DATA=MYLIB.ALL_DATA; BY SPECIES YEAR MONTH DAY; RUN;
NOTE: The data set MYLIB.ALL_DATA has 27 observations and 7 variables.
NOTE: The PROCEDURE SORT used 4.16 seconds.
132 PROC PRINT DATA=MYLIB.ALL_DATA;
133 TITLE2 'Raw data listing sorted by species y m d';
134 VAR SPECIES sasdate STATION NUMBER;
135 RUN;
NOTE: The PROCEDURE PRINT printed page 1.
11. NOTE: The PROCEDURE PRINT used 0.0 seconds.
136 PROC FREQ DATA=MYLIB.ALL_DATA; BY SPECIES; WEIGHT NUMBER;
137 TITLE2 'Species frequency (weighted by number)';
138 TABLE MONTH*STATION;
139 RUN;
NOTE: The PROCEDURE FREQ printed pages 2-4.
NOTE: The PROCEDURE FREQ used 0.05 seconds.
140 PROC FREQ DATA=MYLIB.ALL_DATA; WEIGHT NUMBER;
141 TITLE2 'Species frequency - chi square test';
142 TABLE MONTH*STATION / chisq cellchi2 norow nocol nopercent;
143 RUN;
NOTE: The PROCEDURE FREQ printed page 5.
NOTE: The PROCEDURE FREQ used 0.05 seconds.
144
145 proc plot data=mylib.all_data;
146 TITLE2 'Scatter plot of number by date';
147 plot number*sasdate=species;
148 run;
NOTE: The PROCEDURE PLOT printed page 6.
NOTE: The PROCEDURE PLOT used 0.0 seconds.
149 proc chart data=mylib.all_data; by species;
150 TITLE2 'Horizontal bar chart';
151 hbar species / sumvar=number group=station type=sum;
152 run;
NOTE: The PROCEDURE CHART printed pages 7-9.
NOTE: The PROCEDURE CHART used 0.05 seconds.
153 OPTIONS PS=30 LS=88;
154 proc chart data=mylib.all_data;
155 TITLE2 'Histogram';
156 vbar species / sumvar=number type=mean;
157 run;
NOTE: The PROCEDURE CHART printed page 10.
NOTE: The PROCEDURE CHART used 0.0 seconds.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
SAS Output
The SAS System
OBS STATUS LUSTER HARDNESS TIMEODAY
1 Dried 8 7 Late
2 Dried 8 9 Early
3 Fresh 5 6 Late
4 Fresh 6 3
5 Fresh 7 3 Early
The SAS System
Variable Minimum Maximum Sum Std Dev USS
------------------------------------------------------------------------------
X 1.0000000 9.0000000 35.0000000 2.6152028 201.0000000
Y 1.0000000 7.0000000 37.0000000 2.0658793 201.0000000
------------------------------------------------------------------------------
12. The SAS System
OBS X Y
1 1 1
2 2 3
3 3 4
4 4 4
5 4 5
6 5 7
7 7 6
8 9 7
The SAS System
Plot of X*Y. Legend: A = 1 obs, B = 2 obs, etc.
X ‚
‚
9 ˆ A
‚
8 ˆ
‚
7 ˆ A
‚
6 ˆ
‚
5 ˆ A
‚
4 ˆ A A
‚
3 ˆ A
‚
2 ˆ A
‚
1 ˆ A
‚
Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒˆƒƒ
1 2 3 4 5 6 7
Y
My raw data is listed below
OBS TYPE MODEL DAY NUMBER
1 CARS COUPE 16 3
2 CARS COUPE 17 2
3 CARS SEDAN 18 3
4 CARS SEDAN 19 1
5 CARS SEDAN 22 5
13. 6 TRUCKS PICKUP 19 2
7 TRUCKS SEMI 17 9
8 TRUCKS SEMI 18 8
9 TRUCKS SEMI 22 4
10 VANS 4DOOR 17 4
11 VANS 5DOOR 17 1
12 VANS 5DOOR 19 2
Selected means are provided below
TYPE=CARS
Variable N Mean Std Dev Minimum Maximum
--------------------------------------------------------------------
NUMBER 5 2.8000000 1.4832397 1.0000000 5.0000000
DAY 5 18.4000000 2.3021729 16.0000000 22.0000000
--------------------------------------------------------------------
TYPE=TRUCKS
Variable N Mean Std Dev Minimum Maximum
--------------------------------------------------------------------
NUMBER 4 5.7500000 3.3040379 2.0000000 9.0000000
DAY 4 19.0000000 2.1602469 17.0000000 22.0000000
--------------------------------------------------------------------
TYPE=VANS
Variable N Mean Std Dev Minimum Maximum
--------------------------------------------------------------------
NUMBER 3 2.3333333 1.5275252 1.0000000 4.0000000
DAY 3 17.6666667 1.1547005 17.0000000 19.0000000
--------------------------------------------------------------------
Outputted means are listed below
OBS TYPE NNO DMEAN NVAR DNO NMEAN DVAR
1 CARS 5 18.4000 2.2000 5 2.80000 5.30000
2 TRUCKS 4 19.0000 10.9167 4 5.75000 4.66667
3 VANS 3 17.6667 2.3333 3 2.33333 1.33333
Example program #5 1
Raw data listing sorted by species y m d
OBS SPECIES SASDATE STATION NUMBER
1 Croaker 08JAN97 North 3
2 Croaker 15MAY97 North 3
3 Croaker 15MAY97 South 2
14. 4 Croaker 12AUG97 North 3
5 Croaker 12AUG97 North 9
6 Croaker 14JAN98 North 1
7 Croaker 06MAR98 South 9
8 Croaker 26MAY98 North 12
9 Croaker 29JUL98 North 16
10 Croaker 29JUL98 North 7
11 RedDrum 12AUG97 North 1
12 RedDrum 14JAN98 North 4
13 Spot 08JAN97 North 8
14 Spot 08JAN97 South 11
15 Spot 23MAR97 North 2
16 Spot 23MAR97 South 5
17 Spot 15MAY97 North 1
18 Spot 15MAY97 South 17
19 Spot 12AUG97 North 8
20 Spot 12AUG97 North 8
21 Spot 14JAN98 North 12
22 Spot 14JAN98 South 5
23 Spot 06MAR98 South 3
24 Spot 26MAY98 North 11
25 Spot 26MAY98 South 4
26 Spot 29JUL98 North 24
27 Spot 29JUL98 North 12
Example program #5 2
Species frequency (weighted by number)
Species common name=Croaker
TABLE OF MONTH BY STATION
MONTH STATION(Number caught)
Frequency‚
Percent ‚
Row Pct ‚
Col Pct ‚North ‚South ‚ Total
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
1 ‚ 4 ‚ 0 ‚ 4
‚ 6.15 ‚ 0.00 ‚ 6.15
‚ 100.00 ‚ 0.00 ‚
‚ 7.41 ‚ 0.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
3 ‚ 0 ‚ 9 ‚ 9
‚ 0.00 ‚ 13.85 ‚ 13.85
‚ 0.00 ‚ 100.00 ‚
‚ 0.00 ‚ 81.82 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
5 ‚ 15 ‚ 2 ‚ 17
‚ 23.08 ‚ 3.08 ‚ 26.15
‚ 88.24 ‚ 11.76 ‚
‚ 27.78 ‚ 18.18 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
15. 7 ‚ 23 ‚ 0 ‚ 23
‚ 35.38 ‚ 0.00 ‚ 35.38
‚ 100.00 ‚ 0.00 ‚
‚ 42.59 ‚ 0.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
8 ‚ 12 ‚ 0 ‚ 12
‚ 18.46 ‚ 0.00 ‚ 18.46
‚ 100.00 ‚ 0.00 ‚
‚ 22.22 ‚ 0.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
Total 54 11 65
83.08 16.92 100.00
Example program #5 3
Species frequency (weighted by number)
Species common name=RedDrum
TABLE OF MONTH BY STATION
MONTH STATION(Number caught)
Frequency‚
Percent ‚
Row Pct ‚
Col Pct ‚North ‚ Total
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
1 ‚ 4 ‚ 4
‚ 80.00 ‚ 80.00
‚ 100.00 ‚
‚ 80.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
8 ‚ 1 ‚ 1
‚ 20.00 ‚ 20.00
‚ 100.00 ‚
‚ 20.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
Total 5 5
100.00 100.00
Example program #5 4
Species frequency (weighted by number)
Species common name=Spot
TABLE OF MONTH BY STATION
MONTH STATION(Number caught)
Frequency‚
Percent ‚
Row Pct ‚
Col Pct ‚North ‚South ‚ Total
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
17. STATISTICS FOR TABLE OF MONTH BY STATION
Statistic DF Value Prob
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Chi-Square 4 79.641 0.001
Likelihood Ratio Chi-Square 4 98.373 0.001
Mantel-Haenszel Chi-Square 1 35.363 0.001
Phi Coefficient 0.629
Contingency Coefficient 0.533
Cramer's V 0.629
Sample Size = 201
Example program #5 6
Scatter plot of number by date
Plot of NUMBER*SASDATE. Symbol is value of SPECIES.
NUMBER ‚
‚
24 ˆ S
23 ˆ
22 ˆ
21 ˆ
20 ˆ
19 ˆ
18 ˆ
17 ˆ S
16 ˆ C
15 ˆ
14 ˆ
13 ˆ
12 ˆ S C S
11 ˆ S S
10 ˆ
9 ˆ C C
8 ˆ S S
7 ˆ C
6 ˆ
5 ˆ S S
4 ˆ R S
3 ˆ C C C S
2 ˆ S C
1 ˆ S R C
‚
Šƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒ
17DEC96 27MAR97 05JUL97 13OCT97 21JAN98 01MAY98 09AUG98
SASDATE
NOTE: 1 obs hidden.
Example program #5 7
Horizontal bar chart
18. Species common name=Croaker
STATION Species common name NUMBER
Freq Sum
‚
North Croaker ‚*************************** 8 54.00000
‚
South Croaker ‚****** 2 11.00000
‚
Šƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒ
10 20 30 40 50
NUMBER Sum
Example program #5 8
Horizontal bar chart
Species common name=RedDrum
STATION Species common name NUMBER
Freq Sum
‚
North RedDrum ‚************************* 2 5.000000
‚
Šƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆ
1 2 3 4 5
NUMBER Sum
Example program #5 9
Horizontal bar chart
Species common name=Spot
STATION Species common name NUMBER
Freq Sum
‚
North Spot ‚********************************** 9 86.00000
‚
South Spot ‚****************** 6 45.00000
‚
Šƒƒƒˆƒƒƒˆƒƒƒˆƒƒƒˆƒƒƒˆƒƒƒˆƒƒƒˆƒƒƒˆƒƒ
10 20 30 40 50 60 70 80
NUMBER Sum
Example program #5 10
Histogram
NUMBER Mean
‚ *****
8 ˆ *****
‚ *****
‚ *****
‚ ***** *****