Question
M:TEACHINGSTATSTAT548dataFAT.TXT ID Subject ID ENERGY total energy intake (kcal/day) TOTFAT total fat intake (g/day) TOTPFA total polyunsaturated fat (g/day) TOTMFA total monounsaturated fat (g/day) TOTSFA
M:\TEACHING\STAT\STAT548\data\FAT.TXT
ID Subject ID
ENERGY total energy intake (kcal/day)
TOTFAT total fat intake (g/day)
TOTPFA total polyunsaturated fat (g/day)
TOTMFA total monounsaturated fat (g/day)
TOTSFA total saturated fat (g/day)
M:\TEACHING\STAT\STAT548\data\PROTEIN.TXT
ID Subject ID
ENERGY total energy intake (kcal/day)
PROTEIN total protein intake (g/day)
VEGPROT total vegetable protein intake (g/day)
ANMPROT total animal protein intake (g/day)
M:\TEACHING\STAT\STAT548\data\SDEMOG.TXT
ID 5 digit Subject ID
SEX 1=MALE, 2=FEMALE
AGE years
FEET HEIGHT (feet)
INCH HEIGHT (inches)
WEIGHT body weight in pounds
SMOKE 1=NEVER, 2=PAST,3=CURRENT
Problem 1 (WRITE answer)
Use a text editor to classify each of the above files as space-delimited, comma-delimited, or fixed fielded.
Problem 2 (turn in CODE, any relevant OUTPUT, and WRITE answer to question)
- Write a SAS/R program to create a data set (name the data set FAT) that contains the variables from FAT.TXT.
- Add the following variables to this data set:
PCTOTFAT percent of calories (kcal) from total fat
PCSFA percent of calories (kcal) from saturated fat
PCMFA percent of calories (kcal) from monounsaturated fat
PCPFA percent of calories (kcal) from polyunsaturated fat
STOTFAT saturated fat + monounsaturated fat + polyunsaturated fat (in grams)
OTHERFAT TOTFAT-STOTFAT (in grams)
Hint: 9 kcalories per gram of fat (any type). E.g. pctotfat=totfat*9/energy*100;
- Get a MEANS on all the variables in the data set FAT.
d) What is the average saturated fat intake (in grams) for the group?
Problem 3 (turn in CODE, any relevant OUTPUT, and WRITE answer to question)
- Write a SAS/R program to create a data set (name the data set PROTEIN) that contains the variables from PROTEIN.TXT.
- Add the following variables to this data set:
PCTOTP percent of calories from total protein
PCVEGP percent of calories from vegetable protein
PCANMP percent of calories from animal protein
SPROTEIN animal protein + vegetable protein
OPROTEIN PROTEIN-SPROTEIN
LPROTEIN Log transformation (base e) of PROTEIN
SVEGP square root of VEGPROT
Hint: 4 kcalories per gram of protein (any type).
- Produce histograms of (default setting for number of levels) of total protein, vegetable protein and their transformations.
- Did the transformations normalize these variables?
Problem 4 (turn in CODE, any relevant OUTPUT, and WRITE answer to questions)
a) Write a SAS/R program to create a data set (name the data set DEMOG) that contains the variables from SDEMOG.TXT.
- Add the following variables to this data set:
HTIN total height in inches
- What is the mean total body height in inches?
- What percent of the populations are females? What percent of the population currently smoke?
- What percent of the population are female current smokers(turn in output from SAS with the percent circled)?
Step 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