Lab 3 and HRP259 Lab and Combining (with SQL)

Slides:



Advertisements
Similar presentations
Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
Advertisements

Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Working with Data in Windows HRP223 – 2010 October 4 th, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 SAS Formats and SAS Macro Language HRP223 – 2011 November 9 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
Beginning Data Manipulation HRP Topic 4 Oct 19 th 2011.
1 Merging with SQL HRP223 – 2011 October 31, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
1 Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 Combining (with SQL) HRP223 – 2010 October 27, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
1 Creating and Tweaking Data HRP223 – 2010 October 24, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 Database Theory and Normalization HRP223 – 2010 November 14 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Concepts of Database Management Sixth Edition
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
Concepts of Database Management, Fifth Edition
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
HPR Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Working with Data in Windows HRP223 – 2009 Sept 28 th, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Analyzing Data For Effective Decision Making Chapter 3.
Concepts of Database Management Seventh Edition
Concepts of Database Management Seventh Edition
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Lab 2 and Merging Data (with SQL) HRP223 – 2009 October 19, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
1 Summary HRP223 – 2009 November 1 st, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
T7-1 LEARNING OUTCOMES – ACCESS PROBLEM SOLVING 1.Describe the process of using the Simple Query Wizard using Access 2.Describe the process of using the.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Lab 1 HRP223 – 2011 Oct 10, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Printing Reports. Creating Reports  Reports are the best way to put information from database onto paper, PDF files, and other formats.  In a report,
1 Lab 1 HRP223 – 2009 October 5, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Beginning Data Manipulation HRP Topic 4 Oct 14 th 2012 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and international.
Summary HRP223 – 2009 October 28, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Chapter 6: Set Operators
Practical Office 2007 Chapter 10
Basic Database Concepts
Plug-In T7: Problem Solving Using Access 2007
Querying a Database Using the Select Query Window
Working with Data in Windows
SAS Output Delivery System
Microsoft Office Access 2003
Database Queries.
MODULE 7 Microsoft Access 2010
Microsoft Office Access 2003
Combining (with SQL) HRP223 – 2013 October 30, 2013
Microsoft Official Academic Course, Access 2016
Lab 2 and Merging Data (with SQL)
Combining (with SQL) HRP223 – 2012 November 05, 2011
Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Access: Queries III Participation Project
Lab 1 HRP223 – 2009 October 5, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
A Bit About SAS/Macro Language Database Theory and Normalization
File Sharing and Processing Grouped Data
Data Manipulation (with SQL)
Working with Data in Windows and Descriptive Statistics
Processing Grouped Data
Shelly Cashman: Microsoft Access 2016
New Perspectives on Microsoft
Presentation transcript:

Lab 3 and HRP259 Lab and Combining (with SQL) October 26, 2009 Copyright © 1999-2009 Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and international treaties. Unauthorized reproduction of this presentation, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted to maximum extent possible under the law.

But it used to work… This project worked fine. Then I closed it and reopened it. The code stopped working. When the flowchart is run again, it fails to notice that the airport2 table is needed. So, airport2 is created after this code node is attempted. Draw in an arrow so that airport2 leads to this node.

With the arrow saved in the project, EG gets the logic correct and builds the airport2 table before it attempts to make the analysis table. The next time the process flow is run, it will run completely.

And now for something completely different…. Here are a few thoughts on simulations and stuff for the HRP 259 students. Use putlog instead of put Leverage the point and click stuff even for simulations.

SAS as a Calculator There is a put function and a put statement. To avoid confusion, use the putlog statement to display information in the log.

The _NULL_ dataset is not created in work but the instructions inside of the data step are done.

Describe the shape of the normal curve with these values.

Display the values formatted to show 6 characters, 4 after the decimal place.

Calculate the PDF values starting at -3 out to 3 by Calculate the PDF values starting at -3 out to 3 by .01 and put them into a data set.

Select the Data windowpane. Drag & Drop

The probability of getting the score if the data is a standard normal (Mean =0, Standard Deviation = 1)

Show Central Limit Theorem Make data: 1000 samples of the same size. Calculate the means on the 1000 samples. Plot the means.

Sample size = 1 Use sample size of 5

Sample size = 5 Sample size = 5000 Sample size = 30

Prompts Instead of having to change the code with every run, it makes sense to ask the person running the code to type the sample size and number of samples they want to collect into a dialog box.

Setting up prompts is easy… Right click on the program and choose properties. Choose the Prompts windowpane. Click Prompt Manager… Click Add…

Note the ? in the upper right corner. Precede the prompt name with an & and follow it with a . with no spaces. This is called a macro variable. Note the ? in the upper right corner. If you can’t see the Prompt Manager, find it on the View menu.

PROC SQL - Set Operators NO GUI (“noh gooey”) Outer Union Corresponding concatenates Unions unique rows from both queries Except rows that are part of first query Intersect rows common to both queries

outer union corresponding You can concatenate data files. I rarely use it. proc sql; create table isOuter as select dude from baseline outer union corresponding select dude from followup; quit;

union You can also concatenate data files and keep unique records: proc sql; create table isUnion as select dude from baseline union select dude from followup; quit;

except Say you needed everyone who did not come back. Start out with the baseline group and remove the people who came back. proc sql; select id from baseline except select id from followup; quit;

intersect Say you wanted to know who came back. In other words, what IDs are in both files? proc sql; select id from baseline intersect select id from followup; quit;

PROC SQL - Set Operators When you have tables (with more than one column) with the same structure, you can combine them with these set operators. Be extremely careful because SAS/SQL is forgiving about the structure of the tables and you may not notice problems in the data. For this to work as intended, the two tables must have the same variables, in the same order, and the variables must be of the same type (variables with the same name must both be character or both be numeric). Use the key word corresponding to have it match like-named variables.

corresponding The columns do not need to have matching names or even the same length and it will still operate on them. Use corresponding to help spot this problem.

Working with Repeated Keys A file tracking diagnoses or treatments will have multiple records for some people. If you want to count the number of records for a person, specify what variable(s) are used to group by. Count records in the group with count(*) or count not missing values with count(variableName)

Repeat Counting I want to know: how many people I have how many diagnoses each person has how many distinct diagnoses each person has You can sort the data and count or use the SQL commands on grouped data.

How many records? Select ID to be included in the new data set. Add an Advanced expression as a Computed Column and select the count() function.

It automatically groups the data by ID when you do the count( It automatically groups the data by ID when you do the count(*) function.

Other Aggregates To get the counts of diagnoses and/or the distinct diagnoses, drag the diagnosis (DX) variable over to the select variable list and choose the appropriate summary statistic.