Author: Kaiqing Fan Company: Mastech Digital Inc.

Slides:



Advertisements
Similar presentations
Digital Lesson on Graphs of Equations. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 The graph of an equation in two variables.
Advertisements

1.4 Solving Inequalities. Review: Graphing Inequalities Open dot:> or < Closed dot:> or < Which direction to shade the graph? –Let the arrow point the.
Ch 7.5 – Special Linear Systems
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Solving Inequalities Solving Inequalities Objective: SWBAT solve and graph compound inequalities.
An Introduction to Straight Line Graphs Drawing straight line graphs from their equations. Investigating different straight line graphs.
Algebra 1 Ch 7.5 – Special Linear Systems. Objective  I can identify linear systems with one solution, no solution or many solutions.  I can model/show.
2( ) 8x + 14y = 4 -12x – 14y = x = x = 4 8x + 14y = 4 8(4) + 14y = y = y = -28 ___ ___ y = -2 The solution is (4, -2)
Precalculus Functions & Graphs Using Quizdom to enter an equation Let’s say the answer to a question is 2/3 & -3/4. To enter this using your quizdom remote.
Functions 2 Copyright © Cengage Learning. All rights reserved.
A Conflict as an Illness?!. We consider any conflict as illness. This illness is peculiar both to people and social organisms: it arises inside groups.
Grade 3 Copyright © 2014 by Write Score LLC. We are going to work on one way to improve the conclusion or ending of a piece of writing.
Mental Arithmetic Strategies Scotts Primary School. Mental Arithmetic Scheme.
Introduction to Linear Equations
Mr Barton’s Maths Notes
Please put the title here
Skills for Science with a focus on Biology.
Differential Equations and a few helpful ways to solve them
You must show all your working. (click for each stage of the answer)
Digital Lesson Graphs of Equations.
How to be popular on Twitter?
Mental Arithmetic Strategies
Lesson #6 Modular Programming and Functions.
CLICK ON A PICTURE TO READ AND LISTEN
Lesson #6 Modular Programming and Functions.
Systems of Linear Equations
Algebra 7. Solving Quadratic Equations
Mr F’s Maths Notes Number 7. Percentages.
Graphs 2. Quadratics and Cubics
6-7 Graphing and Solving Quadratic Inequalities
The Rectangular Coordinate System
Polynomial Inequalities in One Variable
Lesson #6 Modular Programming and Functions.
Exponential Functions
Facebook Cover Photo Trick
Solving Inequalities.
Graphing Inequalities.
PROC DOC III: Self-generating Codebooks Using SAS®
Mr Barton’s Maths Notes
Quadratic Functions Unit 9 Lesson 2.
Solving Special Systems
Graphing, Plotting and Modeling Data
Transformations of Linear Functions
Graphing Inequalities.
Solving Equations: The Addition and Multiplication Properties
Designing the Workflow
Author: Kaiqing Fan Company: Mastech Digital Inc.
Quadratic Inequalities
Quadratic Inequalities
Mr F’s Maths Notes Algebra 9. Inequalities.
Debugging “Why you were up till 2AM”
Lesson #6 Modular Programming and Functions.
Mr Barton’s Maths Notes
Automate Repetitive Programming Tasks: Effective SAS® Code Generators
Mr Barton’s Maths Notes
Unit 1: Days
Arms Open Wide by Hillsong United
Introduction to Graphing
Graphing Inequalities.
Copyright © 2010 Pearson Education, Inc
Creating a Powerful Presentation
Introduction to Experimental Design
Mr Barton’s Maths Notes
Simultaneous Equations
Where do these graphs intersect
Self-worth.
Digital Lesson Graphs of Equations.
9-1 Solving 3 by 3 Systems Day 1.
Solving Absolute Value Equations
Presentation transcript:

Author: Kaiqing Fan Company: Mastech Digital Inc. WUSS 38-2018 Create Cupid Arrow into Two Love Hearts Image Using SAS ® PROC TEMPLATE --- For the Valentine’s Day Author: Kaiqing Fan Company: Mastech Digital Inc.

Introduction Each year, for all of our SAS programmers, we may be struggling on how to make our girlfriends happy. Buy a luxurious gift? Or give them a special gift? I would like to suggest to create something special to show our true heart and at the same time, show them our power on technical skills and intelligence. Here is a good engine that using SAS skills to create a Cupid Arrow into Two Love Heart. This is a very special gift. You can also use it to create a single love heart with arrow.

Don’t want to say too much useless words, let me show the image first: ①, ②, ③ and ④ are the macro variables of imagename, entry label, x-axis label and footnotes in the SAS engine of Cupid Arrow into Two Love Hearts.

For a 2D graph. You can find the formula from Quora website [2]. how to create the data for any specified graphics using its mathematical formula 1, to create the data for two hearts, you can find lots of solutions [1], one of the most popular love formula is the following, in which only contains x and y within formula, it is a pretty easy formula:   Y=sqrt(1−(∣x∣−1)**2 ) for y >= 0 , And Y=arccos(1−∣x∣)−π  for y =< 0 , For a 2D graph. You can find the formula from Quora website [2]. I used this data for the first heart. 2, I shifted the x to the right with 0.5 distance to create x1, and create y1 = y for the second heart; we can shift y1 to up or down if we plus or minus one positive number here. 3, how to remove the overlaid lines from the second love heart and the arrow is full of tricks, we should be careful to think about how to decide these intersection points from heart1, heart2 and arrow data. We can try mathematical equations to decide the intersections and their values.

how to create the data for any specified graphics using its mathematical formula 4, don’t believe the values in .sas7bdat files. For example, -0.75 in FOR_CUPID_HEART_DATA.sas7bdat is not -0.75, actually it is - 0.749999999999999, so we would be carefully to use them to decide the x2 and y2, x3 and y3 arrows’ data.

how to create the data for any specified graphics using its mathematical formula I use the intervals based on do looping interval 0.05 to decide their values as following:

how to create the data for any specified graphics using its mathematical formula 5, In order to position the arrowheads properly, the data must be sorted in ascending order by y3 for arrow head. [3] If not sorted, the arrow head would be hart to decide, you may see the arrow heads on the both ends of top right arrow line although you set ARROWHEADPOSITION= END in the code. We cannot sort the whole data of for_cupid_heart_data.sas7bdat, but only pick x3 and y3 out, after sorting by y3, then put it back into the data.  

How to use the self-created data and PROC TEMPLATE TO plot the expected image The for_heart data file is the created data for our expected image. I am using the following PROC TEMPLATE procedure to plot the expected image. In the expected image, we only want to keep the clean image, but not the y-axis and x-axis, and boards, and others.  

Conclusions 1, There are many ways to create an image of cupid arrow with one or two love hearts. I prefer to choose PROC TEMPLATE with SERIESPLOT statement because PROC TEMPLATE procedure is very dynamic and powerful. Robert Allison used PROC GPLOT and PROC GMAP to create cupid arrow with one heart [3]. 2, we can also try through the following formula [1] to create love heart data based on your appetite: From: http://mathworld.wolfram.com/HeartCurve.html

References [1] http://mathworld.wolfram.com/HeartCurve.html [2]   [2] https://www.quora.com/What-is-the-equation-that-gives-you-a-heart-on-the-graph [3] http://documentation.sas.com/?docsetId=grstatgraph&docsetTarget=n0828kpaepwjmrn1u5xko 4cjlqln.htm&docsetVersion=9.4&locale=en http://documentation.sas.com/?docsetId=grstatgraph&docsetTarget=n0828kpaepwjmrn1u5xko 4cjlqln.htm&docsetVersion=9.4&locale=en#n1dj4e3av8buxan1rtp1sgfh2lq2 [4] https://blogs.sas.com/content/sastraining/2015/02/12/have-a-traditional-sasgraph-valentines- day/

Contact Information Name: Kaiqing Fan Company: Mastech Digital Inc. City/State: OH, USA Phone: 504-344-7267 Email: fankaiqinguw@gmail.com