Grant Brown.  AIDS patients – compliance with treatment  Binary response – complied or no  Attempt to find factors associated with better compliance.

Slides:



Advertisements
Similar presentations
Effecting Efficiency Effortlessly Daniel Carden, Quanticate.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
How SAS implements structured programming constructs
SAS Programming:File Merging and Manipulation. Reading External Files (review) data barf; * create the dataset BARF; infile ’s:\mysas\Table7.1'; * open.
Sorting Really Big Files Sorting Part 3. Using K Temporary Files Given  N records in file F  M records will fit into internal memory  Use K temp files,
Slide C.1 SAS MathematicalMarketing Appendix C: SAS Software Uses of SAS  CRM  datamining  data warehousing  linear programming  forecasting  econometrics.
A guide to the unknown…  A dataset is longitudinal if it tracks the same type of information on the same subjects at multiple points in time or space.
Outline Proc Report Tricks Kelley Weston. Outline Examples 1.Text that spans columnsText that spans columns 2.Patient-level detail in the titlesPatient-level.
Linear statistical models 2008 Binary and binomial responses The response probabilities are modelled as functions of the predictors Link functions: the.
Descriptive Statistics In SAS Exploring Your Data.
Logistic Regression Biostatistics 510 March 15, 2007 Vanessa Perez.
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Basic Concept of Data Coding Codes, Variables, and File Structures.
Chapter 18: Modifying SAS Data Sets and Tracking Changes 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Introduction to SAS Lecture 2 Brian Healy.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
STAT 3130 Statistical Methods II Missing Data and Imputation.
Chapter Sixteen Starting the Data Analysis Angel Gillis & Winston Jackson Research for Nurses: Research for Nurses: Methods and Interpretation.
SAS PROC REPORT PROC TABULATE
X 11 X 12 X 13 X 21 X 22 X 23 X 31 X 32 X 33. Research Question Are nursing homes dangerous for seniors? Does admittance to a nursing home increase risk.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
SAS SQL Part 2 Alan Elliott. Dealing with Missing Values Title "Dealing with Missing Values in SQL"; PROC SQL; select INC_KEY,GENDER, RACE, INJTYPE, case.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
18b. PROC SURVEY Procedures in SAS ®. 1 Prerequisites Recommended modules to complete before viewing this module  1. Introduction to the NLTS2 Training.
Quantify the Example Data First, code and quantify the data (assign column locations & variable names) Use the sample data to create a data set from the.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
Week 6 - Wednesday.  What did we talk about last time?  Exam 1 post-mortem  Recursive running time.
A Brief Introduction to PROC TRANSPOSE prepared by Voytek Grus for
Knowing Understanding the Basics Writing your own code SAS Lab.
April 6 Logistic Regression –Estimating probability based on logistic model –Testing differences among multiple groups –Assumptions for model.
CONTROL STRUCTURE The if, elseif, and else & switch Statements 1.
Using Weighted Data Donald Miller Population Research Institute 812 Oswald Tower, December 2008.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
1 Filling in the blanks with PROC FREQ Bill Klein Ryerson University.
How to start using SAS Tina Tian. The topics An overview of the SAS system Reading raw data/ create SAS data set Combining SAS data sets & Match merging.
1 Using the Magical Keyword “INTO” in PROC SQL Thiru Satchi Blue Cross and Blue Shield of Massachusetts Boston Area SAS Users Group April 5, 1999.
SAS Basics. Windows Program Editor Write/edit all your statements here. Log Watch this for any errors in program as it runs. Output Will automatically.
Summer SAS Workshop Lecture 3. Summer SAS Workshop Website
SAS Basics. Windows Program Editor Write/edit all your statement here.
14b. Accessing Data Files in SAS ®. 1 Prerequisites Recommended modules to complete before viewing this module  1. Introduction to the NLTS2 Training.
FORMAT statements can be used to change the look of your output –if FORMAT is in the DATA step, then the formats are permanent and stored with the dataset.
An Introduction to Proc Transpose David P. Rosenfeld HR Consultant, Workforce Planning & Data Management City of Toronto.
Multiple Imputation using SAS Don Miller 812 Oswald Tower
Querying Databases A query is a program that allows us to VIEW the data or operate on the data Several types of queries –Select query –Merge query –Summary.
Chapter 6: Modifying and Combining Data Sets  The SET statement is a powerful statement in the DATA step DATA newdatasetname; SET olddatasetname;.. run;
SAS Programming Training Instructor:Greg Grandits TA: Textbooks:The Little SAS Book, 5th Edition Applied Statistics and the SAS Programming Language, 5.
Computer Science & Engineering 2111 Database Objects 1 CSE 2111 Introduction to Database Management Systems.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapter 26 By Tasha Chapman, Oregon Health Authority.
Longitudinal Data Techniques: Looking Across Observations Ronald Cody, Ed.D., Robert Wood Johnson Medical School.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
Multiple Imputation using SAS Don Miller 812 Oswald Tower
Session 15 Merging Data in SPSS
Chapter 6: Modifying and Combining Data Sets
Programming Standards and Practices
Generalized Linear Models
Advanced Analytics Using Enterprise Miner
Chapter 18: Modifying SAS Data Sets and Tracking Changes
Quick Data Summaries in SAS
Merging in SAS These slides show alternatives regarding the merge of two datasets using the IN data set option (check in the SAS onlinedoc > “BASE SAS”,
Defining and Calling a Macro
Claire Osgood November 2017
3 Iterative Processing.
SPSS Propensity Score Matching: An overview
Outline READ DATA DATA STEPS MERGE DATA PROC IMPORT
Combining Data Sets in the DATA step.
Lab 3 and HRP259 Lab and Combining (with SQL)
Lesson 12: more on Equations
Passing Simple and Complex Parameters In and Out of Macros
MOON Data File Components
Enforcing Data Integrity with SAS Audit Trails
Presentation transcript:

Grant Brown

 AIDS patients – compliance with treatment  Binary response – complied or no  Attempt to find factors associated with better compliance.  Seems a natural choice for logistic regression

 Variable coding was problematic  Entirely composed of factors, many included.  Client had convergence problems.  Many ‘cells’ were empty, so no MLE could be found.

 Very simple to check where the errors are coming from, simply perform a proc freq on the factors in your model.  Start with simple frequencies to check for any extremely skewed groups.  Move on to cross-tab frequencies, which give lots of output, but show each cell. proc freq data=dataset; tables var1* var2 * var3; run; proc freq data=dataset; tables var1 var2 var3; run;

 Relational databases are ubiquitous.  Keys  Identifier fields ▪ Numbers ▪ Dates  Examples  Problems  Everything.  Databases grow over time, so problems can compound.

 The syntax is deceptively simple.  Issues:  Sorting  Catching non matched cases  Many-to-many woes  General advice:  Understand input datasets  Verify output datasets … merge DataSet1 DataSet2; by SomeVar1 SomeVar2; …

 Combines ‘uniquely’ matched records.  Matched by combination of ‘by’ variables.  Data set on the right side of the statement wins in cases of conflict.  If you need to understand it’s behavior more specifically, you are probably doing something wrong. (multiple instances of by variables in both data sets)

DATA Merged NotMerged1 NotMerged2; MERGE data1 (IN = in1) data2 (IN = in2); BY var1 var2 var3; IF (in1 AND in2) then output Merged; ELSE IF (in1 AND NOT in2) THEN OUTPUT NotMerged1; ELSE IF (in2 AND NOT in1) THEN OUTPUT NotMerged2; RUN; PROC SORT DATA = data1; BY var1 var2 var3; RUN; PROC SORT DATA = data2; BY var1 var2 var3; RUN;

DATA newdata; MERGE data1 data2; BY var1; RUN;

 Limit your input data sets to ‘by’ fields and information needed in the output before the merge.  Spot check your results.  Count observations in the logs.  Create a ‘unique’ variable beforehand if you are getting mysterious records.  If you are doing the same thing over and over and just changing variable names, spend 10 minutes looking at macro examples.