Lecture_4

# Lecture_4 - Lecture4 TTests Where&Set Tuesday February 9th...

This preview shows pages 1–12. Sign up to view the full content.

Lecture 4 T – Tests Tuesday February 9 th 9:05 – 9:55 am “Computer science is a grab bag of tenuously related areas thrown together by  an accident of history, like Yugoslavia.”  – ‘Hackers & Painters’ by Paul Graham

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Today’s Outline Working with Permanent SAS Datasets Where Statements
Working with Permanent  SAS Datasets

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Creating Permanent SAS Datasets Libname statement: libname  <Library Name>  <Library Path> ; libname stat480 "F:\Data\Teaching\Stat480\" ; libname stat200 "F:\Data\Teaching\Stat200\" ; libname dowJones "F:\Data\Finance\DJIA\" ; libname bankHolding "F:\Data\Finance\ChicagoBH\" ;
Referencing Permanent SAS  Datasets Data statement data = <Library Name> . <Dataset Name> ; data =dowJones.dailyClose; data =stat480.initialSurvey; data =stat200.complete; data =bankHolding.chicago;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Modifying A Permanent Dataset Living Situation Variable Apartment Fraternity Campus Dorm At Home Say we want to examine “effects” of living in a Fraternity. We can recode the Living Situation variable.
Recoding Living Situation Method I /* Recode Live to get Frat or Not Frat */ if ( ~missing(live) ) then liveAtFrat = "No " ; if ( live = "Frat" ) then liveAtFrat = "Yes" ; Method II /* Recode Live to get Frat / Non-Frat where missing values are treated as Non-Frat */ liveAtFrat2 = "No " ; if ( live = "Frat" ) then liveAtFrat2 = "Yes" ; Missing are still Missing Missing are Non-Frat

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Let’s use Method I, where do we put the code? 1. Create another dataset 2. Set statement imports an already defined dataset Data fratAnalysis; set stat200.complete; run ;
Set Statement set   <Library Name> . <Dataset Name> ; /* Create Temporary Dataset with Frat Variable */ Data fratAnalysis; set stat200.complete; /* Recode Live to get Frat or Not Frat */ if ( ~missing(live) ) then liveAtFrat = "No " ; if ( live = "Frat" ) then liveAtFrat = "Yes" ; run ;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Store Permanent Datasets to document each Analysis Can use libnames to store modified dataset Data gss.ageCoding1; Data gss.ageCoding2; Data gss.ageCoding3; Data nlsy.wave1Revision7b; Data nlsy.wave3Revision4a;
Benefits / Drawbacks Benefits Can test multiple response codings / groupings Don’t bloat the original dataset “Guarantees” reproducibility

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 46

Lecture_4 - Lecture4 TTests Where&Set Tuesday February 9th...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online