0% found this document useful (0 votes)
39 views

For Slide 21 Data Dale01 Input x1 x2 5 x3 x1 100 Cards 2 3 Proc Print Run

This document contains summaries of multiple SAS code examples: 1) Two examples showing how to create and print simple SAS datasets with different input values. 2) An example creating a SAS dataset from an Excel file and printing the results. 3) An example exporting a SAS dataset to an Excel file. 4) An example performing a regression analysis on two variables from a dataset and plotting the results. 5) An example with a simple two-group dataset.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

For Slide 21 Data Dale01 Input x1 x2 5 x3 x1 100 Cards 2 3 Proc Print Run

This document contains summaries of multiple SAS code examples: 1) Two examples showing how to create and print simple SAS datasets with different input values. 2) An example creating a SAS dataset from an Excel file and printing the results. 3) An example exporting a SAS dataset to an Excel file. 4) An example performing a regression analysis on two variables from a dataset and plotting the results. 5) An example with a simple two-group dataset.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

For Slide 21

data dale01;
input x1;
x2=5;
x3= x1*100;
cards;
2
3
;
proc print;
run;

For Slide 31
data dale01;
imput x1;
x3=5;
cards;
2
3
4
;
proc print;
run;

For Slide 32

data SSIE605;
input employee_id name $ age weight;
cards;
53 Mike 42 141
54 Charlie 46 155
;
TITLE 'Hello, world';
proc print data = ssie605;
For Slide 36
***********excel data************
Name weight height
dale 160 172
Khalid 200 180
*****************
data dale01;
infile 'H:\SSIE605\1234.txt' firstobs =2 dlm = '09'x;
input Name $ weight height;
proc print;
run;
For Slide 38
Excel data
Name weight height
dale 160 172
Khalid

180

Awni 150 175

For Slide 42
Data example_3;
input student_id $ score1-score4;
total = sum(score1,score2,score3,score4); /* sum(of score1-score4)*/
cards;
b001 80 63 79 92
b002 93 . 76 87
b003 83 95 . 82
;
proc export data = example_3
outfile = 'H:\ssie605\jackson.xls' replace;
run;

For Slide 43
DATA hits;
INPUT Height Distance @@;
cards;
50 110 49 135 48 129 53 150 48 124
50 143 51 126 45 107 53 146 50 154
47 136 52 144 47 124 50 133 50 128
50 118 48 135 47 129 45 126 48 118
45 121 53 142 46 122 47 119 51 134
49 130 46 132 51 144 50 132 50 131
;
* Perform regression analysis, plot observed values with regression line;

PROC REG DATA = hits;


MODEL Distance = Height;
PLOT Distance * Height;
TITLE 'Results of Regression Analysis';
RUN;

For Section 6
Data example_2;
input group_id time;
cards;
1 80
1 93
1 83
1 89
1 98
2 100
2 103
2 104
2 99
2 102
;

You might also like