Slide C.1 SAS MathematicalMarketing Appendix C: SAS Software Uses of SAS  CRM  datamining  data warehousing  linear programming  forecasting  econometrics.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Using Matrices in Real Life
Advanced Piloting Cruise Plot.
1
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
1 Discreteness and the Welfare Cost of Labour Supply Tax Distortions Keshab Bhattarai University of Hull and John Whalley Universities of Warwick and Western.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
1.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Turing Machines.
PP Test Review Sections 6-1 to 6-6
Data Structures Using C++
EU market situation for eggs and poultry Management Committee 20 October 2011.
Bright Futures Guidelines Priorities and Screening Tables
Yong Choi School of Business CSU, Bakersfield
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
2 |SharePoint Saturday New York City
Green Eggs and Ham.
VOORBLAD.
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Equations of Lines Equations of Lines
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Constant, Linear and Non-Linear Constant, Linear and Non-Linear
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Januar MDMDFSSMDMDFSSS
Analyzing Genes and Genomes
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
1 Chapter 13 Nuclear Magnetic Resonance Spectroscopy.
Energy Generation in Mitochondria and Chlorplasts
1 General Structural Equation (LISREL) Models Week 3 #2 A.Multiple Group Models with > 2 groups B.Relationship to ANOVA, ANCOVA models C.Introduction to.
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
Slide C.1 SAS MathematicalMarketing Appendix C: SAS Software Uses of SAS  CRM  datamining  data warehousing  linear programming  forecasting  econometrics.
7x7=.
Presentation transcript:

Slide C.1 SAS MathematicalMarketing Appendix C: SAS Software Uses of SAS  CRM  datamining  data warehousing  linear programming  forecasting  econometrics  nonlinear parameter estimation Data Types SAS Can Deal with  massaging  sorting  merging  lookups  reporting  Web log data  questionnaires  scanner data Ideal When You Are …  simulation  marketing models  statistical analysis  panel data  relational databases  transforming  manipulating

Slide C.2 SAS MathematicalMarketing Two Types of SAS Routines  DATA Steps Read and Write Data Create a SAS dataset Manipulate and Transform Data Open-Ended - Procedural Language Presence of INPUT statement creates a Loop  PROC Steps Analyze Data Canned or Preprogrammed Input and Output

Slide C.3 SAS MathematicalMarketing A Simple Example data my_study ; input id gender $ green recycle ; cards ; 001m42 002m31 003f32 ; proc reg data=my_study ; class gender ; model recycle = green gender ;

Slide C.4 SAS MathematicalMarketing The Sequence Depends on the Need data step to read in scanner data; data step to read in panel data ; data step to merge scanner and panel records ; data step to change the level of analysis to the household ; proc step to create covariance matrix ; data step to write covariance matrix in LISREL compatable format ;

Slide C.5 SAS MathematicalMarketing The INPUT Statement - Character Data  List input $ after a variable - character var input last_name $ first_name $ initial $ ;  Formatted input $w. after a variable input last_name $22. first_name $22. initial $1.  Column input $ start-column - end-column input last_name $ first_name $ initial $ 45 ;

Slide C.6 SAS MathematicalMarketing The INPUT Statement - Numeric Data  List input input score_1 score_2 score_3 ;  Formatted input w.d (field width and number of digits after an implied decimal point) after a variable input score_1 $10. score_2 $10. score_3 10.  Column input $ start-column - end-column input score_ score_ score_ ;

Slide C.7 SAS MathematicalMarketing Grouped INPUT Statements input (var1-var3) ( ) ; input (var1-var3) (3*10.) ; input (var1-var3) (10.) ; input (name var1-var3) ($10. 3*5.1) ;

Slide C.8 SAS MathematicalMarketing The Column Pointer in the INPUT Statement var1 10. ; input ; if more then x1 x2 ; x x2 ;

Slide C.9 SAS MathematicalMarketing Documenting INPUT Statements green1 4. /* greeness scale first item green2 4. /* greeness scale 2nd item aware1 5. /* awareness scale first item aware2 5. ; /* awareness scale 2nd item */

Slide C.10 SAS MathematicalMarketing The Line Pointer input x1 x2 x3 / x4 x4 x6 ; input x1 x2 x3 #2 x4 x5 x6 ; input x1 x2 x3 #2 x4 x5 x6 ;

Slide C.11 SAS MathematicalMarketing The PUT Statement put _all_ ; put a= b= ; put _infile_ ; put _page_ ; col1 = 22 ; col2 = 14 ; var246 ; put x1 x2 ; input x4 ; put x4 ; put x1 #2 x2 ; put x1 / x2 ;

Slide C.12 SAS MathematicalMarketing Copying Raw Data infile in ′c:\old.data′ ; file out ′c:\new.data′ ; data _null_ ; infile in ; outfile out ; input ; put _infile_ ;

Slide C.13 SAS MathematicalMarketing SAS Constants '21Dec1981'D 'Charles F. Hofacker'

Slide C.14 SAS MathematicalMarketing Assignment Statement x = a + b ; y = x / 2. ; prob = 1 - exp(-z**2/2) ;

Slide C.15 SAS MathematicalMarketing The SAS Array Statement array y {20} y1-y20 ; do i = 1 to 20 ; y{i} = 11 - y{i} ; end ;

Slide C.16 SAS MathematicalMarketing The Sum Statement variable+expression ; retain variable ; variable = variable + expression ; n+1 ; cumulated + x ;

Slide C.17 SAS MathematicalMarketing IF Statement if a >= 45 then a = 45 ; if 0 < age < 1 then age = 1 ; if a = 2 or b = 3 then c = 1 ; if a = 2 and b = 3 then c = 1 ; if major = "FIN" ; if major = "FIN" then do ; a = 1 ; b = 2 ; end ;

Slide C.18 SAS MathematicalMarketing More IF Statement Expressions name ne 'smith' name ~= 'smith' x eq 1 or x eq 2 x=1 | x=2 a = c a le b or a ge c a1 and a2 or a3 (a1 and a2) or a3 if then etc ;

Slide C.19 SAS MathematicalMarketing Concatenating Datasets Sequentially data both ; set first second ; first: id x y second: id x y both: id x y

Slide C.20 SAS MathematicalMarketing Interleaving Two Datasets proc sort data=store1 ; by date ; proc sort data=store2 ; by date ; data both ; set store1 store2 ; by date ;

Slide C.21 SAS MathematicalMarketing Concatenating Datasets Horizontally data both ; merge left right ; left: id y1 y right: id x1 x both: id y1 y2 x1 x

Slide C.22 SAS MathematicalMarketing Table LookUp proc sort data=database out=sorted by part ; data both ; merge table sorted ; by part ; table: part desc 0011 hammer 0012 nail 0013 bow database: id part both: id part desc hammer hammer bow The last observations is repeated if one of the input data sets is smaller

Slide C.23 SAS MathematicalMarketing Update master: part desc 0011 hammer 0012 nail 0013 bow transaction: Part desc 0011 jackhammer data new_master ; update master transaction ; by part ; new_master: part desc 0011 jackhammer 0012 nail 0013 bow

Slide C.24 SAS MathematicalMarketing Changing the Level of Analysis 1 Subject Time Score A 1 A 1 A 2 A 2 A 3 A 3 B 1 B 1 B 2 B 2 B 3 B 3 Subject Score1 Score2 Score3 A A 1 A 2 A 3 B B 1 B 2 B 3 Before After

Slide C.25 SAS MathematicalMarketing Changing the Level of Analysis 1 data after ; keep subject score1 score2 score3 ; retain score1 score2 ; set before ; if time=1 then score1 = score ; else if time=2 then score2 = score ; else if time=3 then do ; score3 = score ; output ; end ;

Slide C.26 SAS MathematicalMarketing Changing the Level of Analysis 2 Day Score Student 1 12 A 1 11 B 1 13 C 2 14 A 2 10 B 2 9 C Day Highest Student 1 13 C 2 14 A Before After

Slide C.27 SAS MathematicalMarketing Changing the Level of Analysis 2 FIRST. and LAST. Variable Modifiers proc sort data=log ; by day ; data find_highest ; retain hightest ; drop score ; set log ; by day ; if first.day then highest=. ; if score > highest then highest = score ; if lastday then output ;

Slide C.28 SAS MathematicalMarketing The KEEP and DROP Statements keep a b f h ; drop x1-x99 ; data a(keep = a1 a2) b(keep = b1 b2) ; set x ; if blah then output a ; else output b ;

Slide C.29 SAS MathematicalMarketing Changing the Level of Analysis 3 Spreading Out an Observation Subject Score1 Score2 Score3 A A 1 A 2 A 3 B B 1 B 2 B 3 Subject Time Score A 1 A 1 A 2 A 2 A 3 A 3 B 1 B 1 B 2 B 2 B 3 B 3 Before After

Slide C.30 SAS MathematicalMarketing Changing the Level of Analysis 3 – SAS Code data spread ; drop score1 score2 score3 ; set tight ; time = 1 ; score = score1 ; output ; time = 2 ; score = score2 ; output ; time = 3 ; score = score3 ; output ;

Slide C.31 SAS MathematicalMarketing Use of the IN= Dataset Indicator data new ; set old1 (in=from_old1) old2 (in=from_old2) ; if from_old1 then … ; if from_old2 then … ;

Slide C.32 SAS MathematicalMarketing Proc Summary for Aggregation proc summary data=raw_purchases ; by household ; class brand ; var x1 x2 x3 x4 x5 ; output out=household mean=overall ;

Slide C.33 SAS MathematicalMarketing Using SAS for Simulations data monte_carlo ; keep y1 - y4 ; array y{4} y1 - y4 ; array loading{4} l1 - l4 ; array unique{4} u1 - u4 ; l1 = 1 ; l2 =.5 ; l3 =.5 ; l4 =.5 ; u1 =.2 ; u2 =.2 ; u3 =.2 ; u4 =.2 ; do subject = 1 to 100 ; eta = rannor(1921) ; do j = 1 to 4 ; y{j} = eta*loading{j} + unique{j}*rannor(2917) ; end ; output ; end ; proc calis data=monte_carlo ; etc. ; Simulation Loop

Slide C.34 SAS MathematicalMarketing External Data Sets and Windows/Vista filename trans 'C:\Documents\june\transactions.data' ; libname clv 'C:\Documents\customer_projects\' ;... data clv.june ; infile trans ; input id 3. purch 2. day 3. month $ ;