Question: An indicator variable, called 'TrvlExp,' that we'll use to determine whether $30 covers your travel expenses to school each week, assuming you travel by car

  1. An indicator variable, called 'TrvlExp,' that we'll use to determine whether $30 covers your travel expenses to school each week, assuming you travel by car (transportation=1). If you do not travel by car (transportation=2, 3, or 4), we'll just assume that $30 covers your expenses. Use SAS to code the following algorithm for determining TrvlExp:
    1. If transportation = 2, 3 or 4, then TrvlExp = 1;
    2. If transportation = 1, then do the following:

- Calculate # of gallons of gas that you can purchase for $30

(gal30 = 30 / GasPrice)

- Calculate # of miles your car can travel for each gallon of gas

(MilePerGal = TankLast / TankVol)

- Calculate # miles $30 will last (mile30 = gal30*MilePerGal)

- Calculate total # round-trip miles that you drive to and from school each week

totmile = OneWay*SchTimes*2

- If mile30 >= totmile, thenTrvlExp = 1

  1. Create a variable 'birthdat' (your birthday in 2005) that combines BirthM, BirthD and use 2005 as year. For example: if BirthM = 3, birthD = 9, the birthdat = 03/09/05
  2. Create a variable called stature. Stature = 1 if your height is higher than the median height of the class; otherwise stature = 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!