Data Transformations



Select the best answer for each question. When you are finished, click Submit Quiz.

  1. The variable Address2 contains values such as Piscataway, NJ. Select the statement that extracts and assigns the two-letter state abbreviation to a new variable named State.



  2. The variable IDCode contains values such as 123FA and 321MB. The fourth character identifies gender. Select the statement that assigns this character code to a new variable named Gender.



  3. Due to growth within the 919 area code, the telephone exchange 555 is being reassigned to the 920 area code. The data set clients.piedmont includes the variable Phone, which contains the telephone number in the form 808-555-1234. Which of the following programs correctly changes the values of Phone?



  4. Within the data set furn.bookcase, the variable Finish contains values such as ash, cherry, teak, and matte-black. Which of the following creates a subset of the data in which the values of Finish contain the string walnut? Make the search for the string case-insensitive.



  5. What is the new value of Code?

    Code="HNL:96701-006";
    Code=substr(Code,1,length(Code)-4);



  6. Which function calculates the average of the variables Var1, Var2, Var3, and Var4?



  7. Which function returns the greatest integer less than or equal to the argument?



  8. Which of the following functions can convert the values of the numeric variable Level to character values?



  9. A typical value for the numeric variable SiteNum is 12.3. Which statement correctly converts the values of SiteNum to character values when creating the variable Location?



  10. Which of the following functions converts the character values of Base to numeric values?