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

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

View Full Document Right Arrow Icon
    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
Background image of page 1

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

View Full DocumentRight Arrow Icon
    Today’s Outline Working with Permanent SAS Datasets Where Statements
Background image of page 2
    Working with Permanent  SAS Datasets
Background image of page 3

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

View Full DocumentRight Arrow Icon
    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\" ;
Background image of page 4
    Referencing Permanent SAS  Datasets Data statement data = <Library Name> . <Dataset Name> ; data =dowJones.dailyClose; data =stat480.initialSurvey; data =stat200.complete; data =bankHolding.chicago;
Background image of page 5

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

View Full DocumentRight Arrow Icon
    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.
Background image of page 6
    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
Background image of page 7

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

View Full DocumentRight Arrow Icon
    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 ;
Background image of page 8
    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 ;
Background image of page 9

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

View Full DocumentRight Arrow Icon
    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;
Background image of page 10
    Benefits / Drawbacks Benefits Can test multiple response codings / groupings Don’t bloat the original dataset “Guarantees” reproducibility
Background image of page 11

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

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 46

Lecture_4 - Lecture4 TTests Where&amp;Set Tuesday February...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online