Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Data set on the bottom is the diet data. Im not sure how to do these two extra practice problems! The program used is
The Data set on the bottom is the diet data. Im not sure how to do these two extra practice problems! The program used is SAS 9.4! Thank you for helping, will thumbs up!
1. Suppose you have collected the following information on some participants in a diet program: Variable Name Description Variable type Starting column Ending column Subj Height Wt_init Wt_final Subject no. Height (inches) Initial weight (lbs.) Final weight (lbs.) Character Character Numeric Numeric Using the above information, read the data that is contained in dietdata.dat into a temporary SAS data set called dietdata. Then, add the following three new variables to the data set: bmi_init, the subject's initial body mass index bmi_final, the subject's final body mass index bmi_diff, the change in the subject's body mass index Body mass index is a person's weight (in kilograms) divided by their height (in meters) squared (Note: only the denominator of the ratio is squared, not the entire ratio, i.e. the units of BMI are kg/m2]. To convert pounds to kilograms, divide pounds by 2.2. To convert inches to meters, multiply inches by 0.0254. Note that large values of body mass index indicate more overweight individuals. Therefore, if the diet program is working, bmi_diff should be negative. Oh, and of course, explicitly convert height to a numeric variable before using it in your calculations. Print your final data set, setting your page size to 58 and line size to 80. 2. Suppose the value of variable abc is 10, the value of variable def is 5, the value of variable ghi is 2, and the variable of jkl is 4. Using an INPUT statement in conjunction with a DATALINES statement, read the values of these four variables into a temporary SAS dataset called temp (which contains only one observation of data). Then, create the following five new variables: one, which equals abc plus def minus ghi plus jkl (that is, use no parentheses) two, which equals the sum of ghi and jkl subtracted from the sum of abc and def (that is, use two sets of parentheses) three, which equals the sum of three things: abc, jkl, and the difference in def and ghi (that is, use one set of parentheses) four, which equals the sum of three things: abc, jkl, and def divided by ghi (that is, use no parentheses) five, which equals the sum of abc and def divided by the sum of ghi and jkl (that is, use two sets of parentheses) Print your resulting data set, setting your page size to 58 and line size to 80. In doing so, appreciate the value and importance of using parentheses to write arithmetic operations in your SAS programs. 00768155150 00272250240 00563240200 00170345298 00365140128 00467225205Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started