Presentation is loading. Please wait.

Presentation is loading. Please wait.

Beginning Data Manipulation HRP 223 - Topic 4 Oct 19 th 2011.

Similar presentations


Presentation on theme: "Beginning Data Manipulation HRP 223 - Topic 4 Oct 19 th 2011."— Presentation transcript:

1 Beginning Data Manipulation HRP 223 - Topic 4 Oct 19 th 2011

2 Some fake data Procedures Functions Procedures summarize over a dataset Functions work on a within a record of a dataset. Notice SAS remembers the capitalization

3 Print a Dataset

4 What SAS writes

5 Labels fix these Formats fix these I changed the capitalization.

6

7

8 Average months treatment Calculate a mean

9 Average 3 labs Search the function list in onlineDoc for a function that does average.

10

11

12 Modifying datasets with SQL

13

14 I like to split my.egp file into several process flowcharts. One sets the libraries and formats. One does cleaning. One (or several) for analyses. Right click here and choose Properties. Label this process flow Make data. Note the name.

15 Note the new name.

16 Automatically Make Libraries and/or Formats You can make a process flow that runs whenever you start up your project. Just name the process flow autoexec.

17 User Defined Formats I typically create my formats with code but if you want to use the GUI.

18 Set this A short name

19

20 After pushing Run fix the node name to match the format.

21 Make At Least 1 Analysis Process Flow If you have an autoexec file you don’t need to include the library in the analysis sheet but I like to see it:

22 Moving Between Process Flows Here Or here

23 Need a new variable? You can check a value using an if statement in a data step:

24 else If the value is not greater than or equal to 175 then set the result to be good: New character variables are 8 letters wide if you use an input statement. Otherwise it uses the first reference to set the length. It gets the length for existing variables from the first reference in the source dataset.

25 Change this to "Bad " or use a length statement.

26 Missing values are negative infinity….

27

28

29

30 You can get the same result with SQL.

31 Showing Combinations Often I am asked to show sets of treatments or sets of drugs. This quickly gets too complex for contingency tables (for 5 treatments you need 2x2x2x2x2 tables). I use binary lists. For example, common cancer treatments include Chemo, Radiation, Surgery (but you can use this same system for fine distinctions). Somebody who got Chemo and Surgery but no radiation can be represented as CrS. Code everybody like that and count the combinations.

32

33

34


Download ppt "Beginning Data Manipulation HRP 223 - Topic 4 Oct 19 th 2011."

Similar presentations


Ads by Google