Title: | Food Quotient and Nutrient Analysis for HSFFQ |
---|---|
Description: | Aids in analysing data from a food frequency questionnaire known as the Harvard Service Food Frequency Questionnaire (HSFFQ). Functions from this package use answers from the HSFFQ to generate estimates of daily consumed micronutrients, calories, macronutrients on an individual level. The package also calculates food quotients on individual and group levels. Foodquotient calculation is an often tedious step in the calculation of total human energy expenditure (TEE) using the doubly labeled water method, which is the gold standard for measuring TEE. |
Authors: | Kate Pogue [aut, cre] |
Maintainer: | Kate Pogue <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-12-16 06:37:04 UTC |
Source: | CRAN |
A small set of food frequency questionnaire data including 32 children living in the United States. f1:f85 represents the frequency with which participants consumed 85 respective foods. Numbers 1-9 correspond to the following: 1: never 2: 1-3 times per month 3: once per week 4: 2-4 times per week 5: 5-6 times per week 6: 1 per day 7: 2-3 times per day 8: 4-5 times per day 9: 6 times per day
age_freq
age_freq
## 'age_freq' A data frame with 32 rows and 86 columns:
age of participant
milk frequency factor
hot chocolate frequency factor
cheese frequency factor
yogurt frequency frequency factor
ice cream frequency frequency factor
pudding frequency factor
orange juice frequency factor
other juice frequency factor
fruit drink frequency factor
banana frequency factor
peaches frequency factor
mixed fruit frequency factor
orange frequency factor
apple and pear frequency factor
applesauce frequency factor
grapes frequency factor
strawberries frequency factor
melon frequency factor
pineapple frequency factor
raisins frequency factor
corn frequency factor
peas frequency factor
tomato frequency factor
peppers frequency factor
carrot frequency factor
broccoli frequency factor
green beans frequency factor
spinach frequency factor
greens frequency factor
mixed vegetable frequency factor
squash frequency factor
zucchini frequency factor
fried potatoes frequency factor
other potatoes frequency factor
sweet potatoes frequency factor
cabbage frequency factor
lettuce frequency factor
mayonnaise frequency factor
chips frequency factor
popcorn frequency factor
crackers frequency factor
nuts frequency factor
cookies frequency factor
cake frequency factor
pie frequency factor
jello frequency factor
chocolate frequency factor
candy frequency factor
coffee frequency factor
soda frequency factor
sugarfree soda frequency factor
beans frequency factor
rice frequency factor
pasta frequency factor
pizza frequency factor
tacos frequency factor
mac and cheese frequency factor
hot dogs frequency factor
sausage frequency factor
hamburger frequency factor
tuna frequency factor
fried fish frequency factor
other fish frequency factor
cold cuts frequency factor
chicken nuggets frequency factor
other chicken frequency factor
pork frequency factor
beef frequency factor
organ meats frequency factor
peanut butter frequency factor
bread frequency factor
butter frequency factor
margarine frequency factor
vegetabele soup frequency factor
soup frequency factor
tortilla frequency factor
eggs frequency factor
bacon frequency factor
hot cereal frequency factor
cold cereal frequency factor
donuts frequency factor
muffins frequency factor
pancake frequency factor
bagel frequency factor
biscuit frequency factor
<Baylor Human Evolutionary Biology and Health Lab>
The Frequency Factor function converts values 1-9, representing different frequency factor responses from the hsffq, to average daily servings consumed for that individual.
fq(f)
fq(f)
f |
1-9, representing different frequency factor responses from the hsffq. These can be in a dataframe, vector, or just single values |
a dataframe, vector, or single value of the same dimension as the input, with each position holding the average daily servings consumed for each food (columns) for each individual(rows).
test <- c(1, 5, 7, 3, 9, 2, 4, 3, 6, 8) fq(test) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(6) fq(df)
test <- c(1, 5, 7, 3, 9, 2, 4, 3, 6, 8) fq(test) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(6) fq(df)
A small set of data including 32 children living in the United States. f1:f85 represents the frequency with which participants consumed 85 respective foods. Numbers 1-9 correspond to the following: 1: never 2: 1-3 times per month 3: once per week 4: 2-4 times per week 5: 5-6 times per week 6: 1 per day 7: 2-3 times per day 8: 4-5 times per day 9: 6 times per day
freq
freq
## 'freq' A data frame with 32 rows and 85 columns:
milk frequency factor
hot chocolate frequency factor
cheese frequency factor
yogurt frequency frequency factor
ice cream frequency frequency factor
pudding frequency factor
orange juice frequency factor
other juice frequency factor
fruit drink frequency factor
banana frequency factor
peaches frequency factor
mixed fruit frequency factor
orange frequency factor
apple and pear frequency factor
applesauce frequency factor
grapes frequency factor
strawberries frequency factor
melon frequency factor
pineapple frequency factor
raisins frequency factor
corn frequency factor
peas frequency factor
tomato frequency factor
peppers frequency factor
carrot frequency factor
broccoli frequency factor
green beans frequency factor
spinach frequency factor
greens frequency factor
mixed vegetable frequency factor
squash frequency factor
zucchini frequency factor
fried potatoes frequency factor
other potatoes frequency factor
sweet potatoes frequency factor
cabbage frequency factor
lettuce frequency factor
mayonnaise frequency factor
chips frequency factor
popcorn frequency factor
crackers frequency factor
nuts frequency factor
cookies frequency factor
cake frequency factor
pie frequency factor
jello frequency factor
chocolate frequency factor
candy frequency factor
coffee frequency factor
soda frequency factor
sugarfree soda frequency factor
beans frequency factor
rice frequency factor
pasta frequency factor
pizza frequency factor
tacos frequency factor
mac and cheese frequency factor
hot dogs frequency factor
sausage frequency factor
hamburger frequency factor
tuna frequency factor
fried fish frequency factor
other fish frequency factor
cold cuts frequency factor
chicken nuggets frequency factor
other chicken frequency factor
pork frequency factor
beef frequency factor
organ meats frequency factor
peanut butter frequency factor
bread frequency factor
butter frequency factor
margarine frequency factor
vegetabele soup frequency factor
soup frequency factor
tortilla frequency factor
eggs frequency factor
bacon frequency factor
hot cereal frequency factor
cold cereal frequency factor
donuts frequency factor
muffins frequency factor
pancake frequency factor
bagel frequency factor
biscuit frequency factor
<Baylor Human Evolutionary Biology Lab>
The grams function takes the age of a participant and their responses on the hsffq to generate an estimate of the participant's total daily grams consumed for each food.
grams(row)
grams(row)
row |
A numeric vector with components 'age', representing the age of the participant, and 'f1' to 'f85', representing different frequency factor responses from the hsffq. |
A numeric vector of length 85, representing the estimated total daily grams of each food consumed for the participant.
random_integers <- sample(1:9, 85, replace=TRUE) vec <- c(6.2, random_integers) grams(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(2) df_results <- data.frame() for (i in 1:nrow(df)) { result <- grams(df[i,]) df_results <- rbind(df_results, result) }
random_integers <- sample(1:9, 85, replace=TRUE) vec <- c(6.2, random_integers) grams(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(2) df_results <- data.frame() for (i in 1:nrow(df)) { result <- grams(df[i,]) df_results <- rbind(df_results, result) }
This dataframe is used internally by the functions of foodquotient and includes portion size information by age for each of the 85 foods included in the HSFFQ from the HSFFQ user's manual. Additionally, nutrient information is included for each of the 85 foods, pulled from the USDA's public search tool.
hsffq()
hsffq()
A portion size and nutrient information reference data frame.
The macquotient function calculates a food quotient for a participant based on average daily protein, carbs, and fat consumed for an individual or a group. In contrast to the quotient function, macquotient is able to generate reliable average food quotients for a group of people rather than only individual level. Group level estimates are recomended in some studies to control for response bias.
macquotient(row)
macquotient(row)
row |
contains three components. p average daily grams of protein consumed f average daily grams of fat consumed c/ average daily grams of carbohydrates consumed |
one value per participant will be returned, representing the food quotient for the individual
vec <- c(34.5,43, 212.4) macquotient(vec) vec1 <- c(34.5,43, 212.4) vec2 <- c(40.1,52, 240) df <- rbind(vec1, vec2) df_results <- data.frame() for (i in 1:nrow(df)) { result <- macquotient(df[i,]) df_results <- rbind(df_results, result) }
vec <- c(34.5,43, 212.4) macquotient(vec) vec1 <- c(34.5,43, 212.4) vec2 <- c(40.1,52, 240) df <- rbind(vec1, vec2) df_results <- data.frame() for (i in 1:nrow(df)) { result <- macquotient(df[i,]) df_results <- rbind(df_results, result) }
The Macronutrients function takes the age of a participant and their responses on the hsffq to generate estimates of the participant's total daily protein, carbohydrate, and fat consumed for each food.
macros(row)
macros(row)
row |
vector with 86 entries consisting of 2 components f1:f85 1-9, representing different frequency factor responses from the hsffq. These will be stored in columns 2-86 in the row you plug in A value representing participant's age. This will be stored in column 1 of the input row |
the row or dataframe returned will have 3 entries, representing total daily amounts of protein, carbohydrates, and fat for each participant
random_integers <- sample(1:9, 85, replace=TRUE) vec <- c(6.2, random_integers) grams(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(3) df_results <- data.frame() for (i in 1:nrow(df)) { result <- macros(df[i,]) df_results <- rbind(df_results, result) }
random_integers <- sample(1:9, 85, replace=TRUE) vec <- c(6.2, random_integers) grams(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(3) df_results <- data.frame() for (i in 1:nrow(df)) { result <- macros(df[i,]) df_results <- rbind(df_results, result) }
The Micronutrients function takes the age of a participant and their responses on the hsffq to generate an estimate of the participant's total daily micronutrients consumed for each food.
micros(row)
micros(row)
row |
contains two components. f1:f85 1-9, representing different frequency factor responses from the hsffq. These will be stored in columns 2-86 in the row you plug in . A value representing participant's age. This will be stored in column 1 of the input row |
the row or dataframe returned will have 7 entries, representing total daily amounts of 7 micronutrients for each participant
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) micros(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(4) df_results <- data.frame() for (i in 1:nrow(df)) { result <- micros(df[i,]) df_results <- rbind(df_results, result) }
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) micros(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(4) df_results <- data.frame() for (i in 1:nrow(df)) { result <- micros(df[i,]) df_results <- rbind(df_results, result) }
The Nutrients function takes the age of a participant and their responses on the hsffq to generate an estimate of the participant's total daily micronutrients, macronutrients, and calories consumed for each food
nutrients(row)
nutrients(row)
row |
/contains two components. f1:f85 1-9, representing different frequency factor responses from the hsffq. These will be stored in columns 2-86 in the row you plug in A value representing participant's age. This will be stored in column 1 of the input row |
the row or dataframe returned will have 11 entries, representing total daily amounts of 7 micronutrients, 3 macronutrients, and calories for each participant. These columns will be labeled
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) nutrients(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(5) df_results <- data.frame() for (i in 1:nrow(df)) { result <- nutrients(df[i,]) df_results <- rbind(df_results, result) }
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) nutrients(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(5) df_results <- data.frame() for (i in 1:nrow(df)) { result <- nutrients(df[i,]) df_results <- rbind(df_results, result) }
The quotient function calculates individual level food quotients based on the individual's answers to the hsffq. This function is only recommended to calculate at the individual level.
quotient(row)
quotient(row)
row |
contains two components. f1:f85 1-9, representing different frequency factor responses from the hsffq. These will be stored in columns 2-86 in the row you plug in A value representing participant's age. This will be stored in column 1 of the input row/ |
one value per participant will be returned, representing the food quotient for the individual
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) quotient(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(6) df_results <- data.frame() for (i in 1:nrow(df)) { result <- quotient(df[i,]) df_results <- rbind(df_results, result) }
random_integers <- sample(1:8, 85, replace=TRUE) vec <- c(6.2, random_integers) quotient(vec) rquestionnaire <- function(n, n_food_questions = 85) { mat <- matrix( sample(1:9, n_food_questions*n, replace = TRUE), nrow = n, ncol = n_food_questions ) df <- data.frame( age = round(runif(n, 2, 11), digits = 1) ) cbind(df, as.data.frame(mat)) } df <- rquestionnaire(6) df_results <- data.frame() for (i in 1:nrow(df)) { result <- quotient(df[i,]) df_results <- rbind(df_results, result) }