You have lines or data containg subject numbers (SUBJ) and weights (WEIGHT). The weight values are either in kilograms, in which case they are followed by kg (in upper- or lowercase, with or without a...


You have lines or data containg subject numbers (SUBJ) and weights (WEIGHT). The weight values are either in kilograms, in which case they are followed by kg (in upper- or lowercase, with or without a period). Weights in pounds either have nothing following the number or Ibs. (again, in upper- or lowercase, with or without a period, and with or without the'S'). Read these lines of data and create a SAS data set (WT) with all weights in pounds (numeric). Note that one kilogram is equal to 2.2 pounds. Here are some sample lines of data (note there are several subject numbers and weights on each line). Some hints: Read in all of the weights as a character variable. Change all of these values to uppercase. To gel the number part of each weight, you can compress all of the characters (KGLBS and period) in one statement. You only have to lest to see if there is a 'K' in the string 10 see if you need to multiply by 2.2. Remember to convert (rom character to numeric (don't let SAS do an automatic conversion).



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here