Introduction

In the current work, I make use of Linear Programming to do the following 3 tasks:

  1. Replicate George Stigler’s results in “The Cost of Subsistence”.

  2. Determine what are the optimal meals per age and sex group to satisfy the minimum individual nutrient intake determined by Health Canada as of April 15, 2021.

  3. Determine what are the optimal meals among a selected number of products (my personal diet) per age and sex group to satisfy the minimum individual nutrient intake determined by Health Canada as of April 15, 2021. I also used prices from Walmart and Sobeys to find out the cost of this particular diet.

This project was pursued in Dr. Tanya Schmah’s course MAT4387 at the University of Ottawa.

Methodology for data manipulation

This project was developed in R (the current document is an RMarkdown output).

To webscrape the “Dietary Reference Intakes”, I used the package “rvest” and I also manually downloaded some tables.

The data was cleaned with the “tidyverse” package.

All the data that is included in the following secions of this work is public and has been obtained from the following links:

Replicating Stigler’s diet

The Stigler diet question is a linear programming problem that was addressed in “The Cost of Subsistence” research published in the Journal of Farm Economics in 1945 by George J. Stigler.

The objective of Stigler’s research was to find the daily and annual amount spent in a diet that meets the minimum nutrient requirements for August 1939 and August 1944. Also, to determine whether the annual amount spent in a diet that meets the minimum nutrient requirements is below the United States’ poverty line when comparing products’ prices.

The diet’s question originally asked in which quantities a 154-pound male would have to consume 77 different meals in order to fulfill the recommended intake of 9 different nutrients while keeping expense at a minimum.

In this section, I will replicate this problem’s results. The problem is defined at https://developers.google.com/optimization/lp/glop#stigler

Stigler used a list of products consisted of the commodities for which retail prices were reported by the Bureau of Labor Statistics.

According to Stigler’s calculations, the annual cost diet to minimize the necessary intake of selected relevant nutrients was USD 39.93 in 1939 and USD 59.88 in 1944.

The final products, quantities and costs of each optimized diet were the following:


Table 1: Results from the Stigler diet
Commodity Quantity 1939 Cost 1939 Quantity 1944 Cost 1944
Wheat Flour 370 lb. $13.83 585 lb. $34.53
Evaporated Milk 57 cans $3.84
Cabbage 111 lb. $4.11 107 lb. $5.28
Spinach 23 lb. $1.85 13 lb. $1.56
Dried Navy Beans 285 lb. $16.80
Pancake Flour
134 lb. $13.08
Pork Liver
5 lb. $5.48
Total Cost
$39.93
$59.88


Replication of results

For the first part of this project, we will replicate Stigler’s results from 1939 in RStudio.

We will use the the 77 products that Stigler used:

##  [1] "Wheat Flour (Enriched)"  "Macaroni"               
##  [3] "Wheat Cereal (Enriched)" "Corn Flakes"            
##  [5] "Corn Meal"               "Hominy Grits"           
##  [7] "Rice"                    "Rolled Oats"            
##  [9] "White Bread (Enriched)"  "Whole Wheat Bread"      
## [11] "Rye Bread"               "Pound Cake"             
## [13] "Soda Crackers"           "Milk"                   
## [15] "Evaporated Milk (can)"   "Butter"                 
## [17] "Oleomargarine"           "Eggs"                   
## [19] "Cheese (Cheddar)"        "Cream"                  
## [21] "Peanut Butter"           "Mayonnaise"             
## [23] "Crisco"                  "Lard"                   
## [25] "Sirloin Steak"           "Round Steak"            
## [27] "Rib Roast"               "Chuck Roast"            
## [29] "Plate"                   "Liver (Beef)"           
## [31] "Leg of Lamb"             "Lamb Chops (Rib)"       
## [33] "Pork Chops"              "Pork Loin Roast"        
## [35] "Bacon"                   "Ham, smoked"            
## [37] "Salt Pork"               "Roasting Chicken"       
## [39] "Veal Cutlets"            "Salmon, Pink (can)"     
## [41] "Apples"                  "Bananas"                
## [43] "Lemons"                  "Oranges"                
## [45] "Green Beans"             "Cabbage"                
## [47] "Carrots"                 "Celery"                 
## [49] "Lettuce"                 "Onions"                 
## [51] "Potatoes"                "Spinach"                
## [53] "Sweet Potatoes"          "Peaches (can)"          
## [55] "Pears (can)"             "Pineapple (can)"        
## [57] "Asparagus (can)"         "Green Beans (can)"      
## [59] "Pork and Beans (can)"    "Corn (can)"             
## [61] "Peas (can)"              "Tomatoes (can)"         
## [63] "Tomato Soup (can)"       "Peaches, Dried"         
## [65] "Prunes, Dried"           "Raisins, Dried"         
## [67] "Peas, Dried"             "Lima Beans, Dried"      
## [69] "Navy Beans, Dried"       "Coffee"                 
## [71] "Tea"                     "Cocoa"                  
## [73] "Chocolate"               "Sugar"                  
## [75] "Corn Syrup"              "Molasses"               
## [77] "Strawberry Preserves"

And the daily minimum intake requirements:


Table 2: Minimum requirement intakes
Nutrient Daily Recommended Intake q
Calories 3,000 Calories 3.0
Protein 70 grams 70.0
Calcium .8 grams 0.8
Iron 12 milligrams 12.0
Vitamin A 5,000 IU 5.0
Thiamine (Vitamin B1) 1.8 milligrams 1.8
Riboflavin (Vitamin B2) 2.7 milligrams 2.7
Niacin 18 milligrams 18.0
Ascorbic Acid (Vitamin C) 75 milligrams 75.0


Defining the problem

The objective function is the sum of the amount spent of each food product


\[\sum_{i=1}^{77}amount\_spent_{food_i} = Daily\_Amount\_Spent\]


where:


\(i = \{food_1, food_2, food_3, ..., food_{77} \}\)


which is given by:

f.obj <- rep(1, 77)

The constraints for Stigler diet require the total amount of the nutrients provided by all foods to be at least the minimum requirement for each nutrient. The left hand side of these equations will be given by f.con

These constraints are a set of 9 equations given by:

\[\sum_{i=1}^{77}calories_{i} \geq 3.0\]
\[\sum_{i=1}^{77}protein_{i} \geq 70.0\]
\[\sum_{i=1}^{77}calcium_{i} \geq 0.8\]
\[\sum_{i=1}^{77}iron_{i} \geq 12.0\]
\[\sum_{i=1}^{77}vitA_{i} \geq 5.0\]
\[\sum_{i=1}^{77}vitB1_{i} \geq 1.8\]
\[\sum_{i=1}^{77}vitB2_{i} \geq 2.7\]
\[\sum_{i=1}^{77}niacin_{i} \geq 18\]
\[\sum_{i=1}^{77}vitC_{i} \geq 75\]

The amounts of nutrients provided by \(food_i\) are measured per dollar.

Next, we write these constraints as inequalities involving the arrays data and nutrients, and the variables \(food_i\).

# Constraints:
f.con <- matrix(c(nutrients$Calories,
                 nutrients$`Protein (g)`,
                 nutrients$`Calcium (g)`,                  
                 nutrients$`Iron (mg)`,
                 nutrients$`Vitamin A (IU)`,
                 nutrients$`Thiamine (mg)`  , #Thiamine (Vitamin B1)    
                 nutrients$`Riboflavin (mg)` , #Riboflavin (Vitamin B2)
                 nutrients$`Niacin (mg)`,
                 nutrients$`Ascorbic Acid (mg)`), #Ascorbic Acid (Vitamin C)
                 nrow = 9, byrow = TRUE)

# Sign of the inequality:
f.dir <- rep(">=", 9)

# Right hand side of each constraint or minimum daily intake for a specific nutrient
f.rhs <- daily$q

We solve the problem by calling the function lp()

options(digits=10)
lp("min", f.obj, f.con, f.dir, f.rhs)
## Success: the objective function is 0.1086622782

This number represent the sum of all USD spent per day to satisfy the minimum intake requirements.

We find the annual expenditure by multiplying:

0.1086622782*365 
## [1] 39.66173154

Finally, we show our results in Table 3 where prices are measured in USD and quantities in pounds.


Table 3: Results of the Stigler Diet
Nutrient Daily_spent Daily_consumption Annual_expenditure Annual_consumption
Wheat Flour (Enriched) 0.0295190617 0.8199739355 10.7744575119 299.290486442
Liver (Beef) 0.0018925573 0.0070617809 0.6907834111 2.577550041
Cabbage 0.0112144352 0.3030928445 4.0932688648 110.628888239
Spinach 0.0050076605 0.0618229687 1.8277960704 22.565383585
Navy Beans, Dried 0.0610285635 1.0343824327 22.2754256872 377.549587919
Total 0.1086622782 2.2263339623 39.6617315455 812.611896227


Similar to the Google publication, we find that the best diet that will optimize the minimum daily nutrient intakes is the one that contains the nutrients shown in the previous table.

We also calculated the daily (2.23 lb.) and annual consumption (812.61 lb.) measured in pounds.

According to our results, we determined that this diet relies mostly on dried navy beans.

One important observation is that the Stigler’s results includes Evaporated Milk instead of Liver (Beef) that is included in the results of the Google publication and in our results.


Using the “Canadian Nutrient File” and the “Minimum requirements intakes” from Health Canada

We will use Health Canada data from The Canadian Nutrient File.

According to Health Canada, the Canadian Nutrient File (CNF) is the standard reference food composition database reporting the amount of nutrients in foods commonly consumed in Canada.

Nutrients per 100 grams of a specific food product

FoodDescription RETINOL VITAMIN D (INTERNATIONAL UNITS) ALPHA-TOCOPHEROL VITAMIN K VITAMIN C
Abiyuch, raw 0 0 NA NA 54.1
Acerola (West Indian cherry), raw 0 0 0.18 NA 1677.6
Acerola juice, raw 0 0 0.18 1.4 1600.0
Agave, cooked 0 0 0.36 4.9 0.3
Agave, dried 0 0 0.76 0.5 0.3
Agave, raw 0 0 0.23 5.3 4.0
Agutuk, native, fish with shortening (Alaskan ice cream) 34 NA 4.00 NA NA
Agutuk, native, fish/berry with seal oil (Alaskan ice cream) 209 NA 2.36 NA 2.9

There are 5690 food products included in the Canadian Nutrient File with their respective nutrient amount.

The daily intakes that we will use for this exercise are the following 21 nutrients:

##  [1] "RETINOL"                           "VITAMIN D (INTERNATIONAL UNITS)"  
##  [3] "ALPHA-TOCOPHEROL"                  "VITAMIN K"                        
##  [5] "VITAMIN C"                         "THIAMIN"                          
##  [7] "RIBOFLAVIN"                        "NIACIN (NICOTINIC ACID) PREFORMED"
##  [9] "VITAMIN B-6"                       "DIETARY FOLATE EQUIVALENTS"       
## [11] "VITAMIN B-12"                      "PANTOTHENIC ACID"                 
## [13] "BIOTIN"                            "CHOLINE, TOTAL"                   
## [15] "CARBOHYDRATE"                      "PROTEIN"                          
## [17] "LINOLEIC"                          "ALPHA_LINOLEIC"                   
## [19] "CALCIUM"                           "POTASSIUM"                        
## [21] "SODIUM"

For our constraints, we have webscraped and parsed the Dietary Reference Intakes from:


Defining the problem

We want to find the optimal amount of food that one needs to consume per day to satisfy the minimum nutrients’ intake. Our objective function is different to the one from the Stigler diet which is the sum of the amount spent in each product.

We use a different objective function because the data from the CNF shows the amount of nutrients of each food product per 100 grams, whereas in the Stigler diet the nutrient table used shows the amount of nutrients of each food product per 1 USD.

The objective function is given by:


\[\sum_{i=1}^{5690}amount\_consumed_{food_i} = Daily\_Amount\_Consumed\]

where:

\(i = \{food_1, food_2, food_3, ..., food_{5690} \}\)


obj_ <- rep(1, dim(cnf)[1]) 

We will use 19 constraints given by:


\[(\sum_{i=1}^{5690}nutrient_{i})_j \geq minimum\_requeriment\_intake_{j}\]

where:

\(j = \{nutrient_1, nutrient_2, nutrient_3, ..., nutrient_{19} \}\)


obj_ <- rep(1, dim(cnf)[1]) #dim(cnf)[1] = 5690
# Constraints
cons <- matrix(0.01*c(
   cnf$RETINOL,
   cnf$`VITAMIN D (INTERNATIONAL UNITS)`,
   cnf$`ALPHA-TOCOPHEROL`,
   cnf$`VITAMIN K`,
   cnf$`VITAMIN C`,
   cnf$THIAMIN,
   cnf$RIBOFLAVIN,
   cnf$`NIACIN (NICOTINIC ACID) PREFORMED`,
   cnf$`VITAMIN B-6`,
   cnf$`DIETARY FOLATE EQUIVALENTS`,
   cnf$`VITAMIN B-12`,
   cnf$`PANTOTHENIC ACID`,
   cnf$BIOTIN,
   cnf$`CHOLINE, TOTAL`,
   cnf$CARBOHYDRATE,
   cnf$PROTEIN,
   cnf$LINOLEIC,
   cnf$ALPHA_LINOLEIC,
   cnf$FIBRE,
   cnf$CALCIUM,
   cnf$IRON), 
   nrow = 21, byrow = TRUE)

# Sign of inequalities
dir <- rep(">=", 21)

The right hand side of these inequalities are given by the minimum requirement intakes, we will define them in a for loop as we want to use different age groups

Minimum requirement intakes for infant and children

Nutrient Children: 1-3 y Children: 4-8 y
RETINOL 300.0 400.0
VITAMIN D (INTERNATIONAL UNITS) 600.0 600.0
ALPHA-TOCOPHEROL 6.0 7.0
VITAMIN K 30.0 55.0
VITAMIN C 15.0 25.0
THIAMIN 0.5 0.6
RIBOFLAVIN 0.5 0.6
NIACIN (NICOTINIC ACID) PREFORMED 6.0 8.0
VITAMIN B-6 0.5 0.6
DIETARY FOLATE EQUIVALENTS 150.0 200.0
VITAMIN B-12 0.9 1.2
PANTOTHENIC ACID 2.0 3.0
BIOTIN 8.0 12.0
CHOLINE, TOTAL 200.0 250.0
CARBOHYDRATE 130.0 130.0
PROTEIN 13.0 19.0
LINOLEIC 7.0 10.0
ALPHA_LINOLEIC 0.7 0.9
FIBRE 19.0 25.0
CALCIUM 700.0 1000.0
COPPER 340.0 440.0
IRON 7.0 10.0
MAGNESIUM 80.0 130.0
PHOSPHORUS 460.0 500.0
SELENIUM 7.0 10.0
ZINC 80.0 130.0
POTASSIUM 1.2 1.5
SODIUM 13.0 17.0
a Source: Health Canada

Minimum requirement intakes for males

Nutrient Male: 9-13 y Male: 14-18 y Male: 19-30 y Male: 31-50 y Male: 51-70 y Male: >70 y
RETINOL 600.0 900.0 900.0 900.0 900.0 900.0
VITAMIN D (INTERNATIONAL UNITS) 600.0 600.0 600.0 600.0 600.0 800.0
ALPHA-TOCOPHEROL 11.0 15.0 15.0 15.0 15.0 15.0
VITAMIN K 60.0 75.0 120.0 120.0 120.0 120.0
VITAMIN C 45.0 75.0 90.0 90.0 90.0 90.0
THIAMIN 0.9 1.2 1.2 1.2 1.2 1.2
RIBOFLAVIN 0.9 1.3 1.3 1.3 1.3 1.3
NIACIN (NICOTINIC ACID) PREFORMED 12.0 16.0 16.0 16.0 16.0 16.0
VITAMIN B-6 1.0 1.3 1.3 1.3 1.7 1.7
DIETARY FOLATE EQUIVALENTS 300.0 400.0 400.0 400.0 400.0 400.0
VITAMIN B-12 1.8 2.4 2.4 2.4 2.4 2.4
PANTOTHENIC ACID 4.0 5.0 5.0 5.0 5.0 5.0
BIOTIN 20.0 25.0 30.0 30.0 30.0 30.0
CHOLINE, TOTAL 375.0 550.0 550.0 550.0 550.0 550.0
CARBOHYDRATE 130.0 130.0 130.0 130.0 130.0 130.0
PROTEIN 34.0 52.0 56.0 56.0 56.0 56.0
LINOLEIC 12.0 16.0 17.0 17.0 14.0 14.0
ALPHA_LINOLEIC 1.2 1.6 1.6 1.6 1.6 1.6
FIBRE 31.0 38.0 38.0 38.0 30.0 30.0
CALCIUM 1300.0 1300.0 1000.0 1000.0 1000.0 1200.0
COPPER 700.0 890.0 900.0 900.0 900.0 900.0
IRON 8.0 11.0 8.0 8.0 8.0 8.0
MAGNESIUM 240.0 410.0 400.0 420.0 420.0 420.0
PHOSPHORUS 1250.0 1250.0 700.0 700.0 700.0 700.0
SELENIUM 8.0 11.0 8.0 8.0 8.0 8.0
ZINC 240.0 410.0 400.0 420.0 420.0 420.0
POTASSIUM 1.9 2.2 2.3 2.3 2.3 2.3
SODIUM 26.0 33.0 34.0 34.0 34.0 34.0
a Source: Health Canada

Minimum requirements intakes for females

Nutrient Female: 9-13 y Female: 14-18 y Female: 19-30 y Female: 31-50 y Female: 51-70 y Female: >70 y
RETINOL 600.0 700.0 700.0 700.0 700.0 700.0
VITAMIN D (INTERNATIONAL UNITS) 600.0 600.0 600.0 600.0 600.0 800.0
ALPHA-TOCOPHEROL 11.0 15.0 15.0 15.0 15.0 15.0
VITAMIN K 60.0 75.0 90.0 90.0 90.0 90.0
VITAMIN C 45.0 65.0 75.0 75.0 75.0 75.0
THIAMIN 0.9 1.0 1.1 1.1 1.1 1.1
RIBOFLAVIN 0.9 1.0 1.1 1.1 1.1 1.1
NIACIN (NICOTINIC ACID) PREFORMED 12.0 14.0 14.0 14.0 14.0 14.0
VITAMIN B-6 1.0 1.2 1.3 1.3 1.5 1.5
DIETARY FOLATE EQUIVALENTS 300.0 400.0 400.0 400.0 400.0 400.0
VITAMIN B-12 1.8 2.4 2.4 2.4 2.4 2.4
PANTOTHENIC ACID 4.0 5.0 5.0 5.0 5.0 5.0
BIOTIN 20.0 25.0 30.0 30.0 30.0 30.0
CHOLINE, TOTAL 375.0 400.0 425.0 425.0 425.0 425.0
CARBOHYDRATE 130.0 130.0 130.0 130.0 130.0 130.0
PROTEIN 34.0 46.0 46.0 46.0 46.0 46.0
LINOLEIC 10.0 11.0 12.0 12.0 11.0 11.0
ALPHA_LINOLEIC 1.0 1.1 1.1 1.1 1.1 1.1
FIBRE 26.0 26.0 25.0 25.0 21.0 21.0
CALCIUM 1300.0 1300.0 1000.0 1000.0 1200.0 1200.0
COPPER 700.0 890.0 900.0 900.0 900.0 900.0
IRON 8.0 15.0 18.0 18.0 8.0 8.0
MAGNESIUM 240.0 360.0 310.0 320.0 320.0 320.0
PHOSPHORUS 1250.0 1250.0 700.0 700.0 700.0 700.0
SELENIUM 8.0 15.0 18.0 18.0 8.0 8.0
ZINC 240.0 360.0 310.0 320.0 320.0 320.0
POTASSIUM 1.6 1.6 1.8 1.8 1.8 1.8
SODIUM 26.0 33.0 34.0 34.0 34.0 34.0
a Source: Health Canada

First, we will use all the products from the Canadian Nutrient File:

Results

req_ <- req[c(1:20, 22),]
results <- list()
for(i in c(2:15)){
   rhs <- req_[,i]
   
   results[[i]] <- data.frame(Food = cnf$FoodDescription,
                              Consumption_gr = lp("min", obj_, cons, dir, rhs)$solution) %>% 
      filter(Consumption_gr>0) %>% 
      arrange(desc(Consumption_gr))
}
names(results) <- colnames(req)
for(j in c(2:15)){
  cat(paste0("**", names(results)[j], "**"))
  print(kable(results[j]))
  cat("\n")
}
Children: 1-3 y
Food Consumption_gr
Drink, orange flavour, vitamin C added, powder 84.4848157765
Cereal, ready to eat, All Bran Original, Kellogg’s 32.6530612245
Grains, corn bran, crude 9.6832673970
Whey, acid, dry 9.6278130777
Milk, dry, skim, powder, regular 7.8783441149
Egg, chicken, yolk, dried 6.7085376469
Vegetable oil, safflower, linoleic (70% and over) 6.3866072133
Fish, burbot (loche), native, liver, raw 4.1807999221
Leavening agent, yeast, baker’s, active, dry 2.5723594069
Vegetable oil, wheat germ 1.9274435198
Spices, thyme, dried 1.6820422409
Vegetable oil, flaxseed (linseed), cold pressed 0.9033598877
Drink, fruit flavour, powder, low calorie, vitamin C 0.2154227884
Fish oil, cod liver 0.0422959770
Children: 4-8 y
Food Consumption_gr
Cereal, ready to eat, All Bran Buds, Kellogg’s 57.1428571429
Drink, orange flavour, vitamin C added, powder 56.3923391977
Whey, acid, dry 20.5003569066
Milk, dry, skim, powder, regular 19.0916526933
Vegetable oil, safflower, linoleic (70% and over) 10.5374173030
Egg, chicken, yolk, dried 7.0362290251
Fish, burbot (loche), native, liver, raw 3.6614373211
Spices, thyme, dried 3.1315108330
Grains, corn bran, crude 2.3733119064
Vegetable oil, flaxseed (linseed), cold pressed 1.3376083111
Vegetable oil, wheat germ 1.2198134287
Leavening agent, yeast, baker’s, active, dry 1.1609063209
Fish oil, cod liver 0.2206188339
Male: 9-13 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 47.4539817107
Milk, dry, skim, powder, regular 42.8684287476
Cereal, ready to eat, All Bran Buds, Kellogg’s 39.8751165756
Whey, acid, dry 26.0979059397
Drink, orange flavour, vitamin C added, powder 19.0843731638
Vegetable oil, safflower, linoleic (70% and over) 10.3399050421
Egg, chicken, yolk, dried 10.0190069155
Vegetable oil, wheat germ 3.5954872380
Spices, thyme, dried 3.3851646654
Fish, burbot (loche), native, liver, raw 2.6152273361
Leavening agent, yeast, baker’s, active, dry 2.3202613279
Vegetable oil, flaxseed (linseed), cold pressed 1.4698777131
Fish oil, cod liver 0.4103854011
Male: 14-18 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 99.0247041226
Milk, dry, skim, powder, regular 80.5894074085
Egg, chicken, yolk, dried 16.8148640529
Vegetable oil, safflower, linoleic (70% and over) 13.2363185197
Spices, marjoram, dried 7.0019554787
Vegetable oil, wheat germ 5.2338921339
Leavening agent, yeast, baker’s, active, dry 3.9389883114
Cereal, ready to eat, All Bran Buds, Kellogg’s 3.5187975712
Pepper, sweet, green, freeze-dried 3.4310311658
Grains, corn bran, crude 2.6904984123
Vegetable oil, flaxseed (linseed), cold pressed 1.4901832388
Spices, thyme, dried 1.4390121316
Fish, burbot (loche), native, liver, raw 0.9470100027
Fish oil, cod liver 0.6211580495
Male: 19-30 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 44.4283431292
Beverage, whey protein isolate, powder 28.2320233282
Egg, chicken, yolk, dried 16.8436133056
Vegetable oil, safflower, linoleic (70% and over) 15.7220835988
Spices, thyme, dried 5.8356583989
Pepper, sweet, green, freeze-dried 3.7875031078
Vegetable oil, wheat germ 2.9111667570
Fish, burbot (loche), native, liver, raw 2.2994622358
Vegetable oil, flaxseed (linseed), cold pressed 2.1006295706
Drink, orange flavour, vitamin C added, powder 0.9729238637
Fish oil, cod liver 0.4343030665
Male: 31-50 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 44.4283431292
Beverage, whey protein isolate, powder 28.2320233282
Egg, chicken, yolk, dried 16.8436133056
Vegetable oil, safflower, linoleic (70% and over) 15.7220835988
Spices, thyme, dried 5.8356583989
Pepper, sweet, green, freeze-dried 3.7875031078
Vegetable oil, wheat germ 2.9111667570
Fish, burbot (loche), native, liver, raw 2.2994622358
Vegetable oil, flaxseed (linseed), cold pressed 2.1006295706
Drink, orange flavour, vitamin C added, powder 0.9729238637
Fish oil, cod liver 0.4343030665
Male: 51-70 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 44.4175093144
Beverage, whey protein isolate, powder 28.2438066522
Egg, chicken, yolk, dried 16.8341013170
Vegetable oil, safflower, linoleic (70% and over) 10.9255821661
Spices, thyme, dried 5.8402255124
Vegetable oil, wheat germ 4.0058457776
Pepper, sweet, green, freeze-dried 3.7872518664
Fish, burbot (loche), native, liver, raw 2.3001255723
Vegetable oil, flaxseed (linseed), cold pressed 1.9590700363
Drink, orange flavour, vitamin C added, powder 0.9725401329
Fish oil, cod liver 0.4343632362
Male: >70 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 114.9729266569
Milk, dry, skim, powder, regular 54.4100862005
Beverage, whey protein isolate, powder 20.5319953523
Egg, chicken, yolk, dried 16.6254729535
Vegetable oil, safflower, linoleic (70% and over) 10.9507160193
Spices, basil, dried 6.0122777558
Grains, wheat bran, crude 5.7963068641
Vegetable oil, wheat germ 4.2973107560
Pepper, sweet, green, freeze-dried 4.1624394494
Fish, burbot (loche), native, liver, raw 3.6746600387
Vegetable oil, flaxseed (linseed), cold pressed 1.9635295337
Leavening agent, baking powder, double acting, phosphate 1.4661471325
Fish oil, cod liver 0.2554999399
Female: 9-13 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 80.0698470989
Milk, dry, skim, powder, regular 40.2729920711
Whey, acid, dry 28.1212953890
Drink, orange flavour, vitamin C added, powder 18.4609438817
Egg, chicken, yolk, dried 10.0033601544
Cereal, ready to eat, Sugar Crisp, Post 7.9768220994
Vegetable oil, safflower, linoleic (70% and over) 6.9872523798
Vegetable oil, wheat germ 4.5031798046
Spices, thyme, dried 3.3889241875
Fish, burbot (loche), native, liver, raw 2.6659434182
Leavening agent, yeast, baker’s, active, dry 2.4245539916
Vegetable oil, flaxseed (linseed), cold pressed 0.9515361765
Fish oil, cod liver 0.4613668035
Female: 14-18 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 102.0408163265
Milk, dry, skim, powder, regular 66.5007477127
Whey, acid, dry 13.5642715759
Egg, chicken, yolk, dried 10.3869370415
Vegetable oil, wheat germ 7.1678044070
Vegetable oil, safflower, linoleic (70% and over) 5.8826170008
Leavening agent, yeast, baker’s, active, dry 5.3100366601
Spices, thyme, dried 4.0395691113
Drink, orange flavour, vitamin C added, powder 2.7582105175
Pepper, sweet, green, freeze-dried 2.7344319038
Fish, burbot (loche), native, liver, raw 1.8823905472
Vegetable oil, flaxseed (linseed), cold pressed 0.7192785233
Fish oil, cod liver 0.3064638595
Female: 19-30 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 60.9818116666
Egg, chicken, yolk, dried 12.9978873315
Vegetable oil, safflower, linoleic (70% and over) 6.9780343418
Vegetable oil, wheat germ 6.5231731234
Pepper, sweet, green, freeze-dried 3.6767989269
Leavening agent, yeast, baker’s, active, dry 3.4444864120
Spices, basil, dried 2.9424868118
Fish, burbot (loche), native, liver, raw 1.9323202585
Spices, thyme, dried 1.9098740161
Vegetable oil, flaxseed (linseed), cold pressed 0.7440624858
Whey, acid, dry 0.5829816198
Fish oil, cod liver 0.3637249787
Female: 31-50 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 60.9818116666
Egg, chicken, yolk, dried 12.9978873315
Vegetable oil, safflower, linoleic (70% and over) 6.9780343418
Vegetable oil, wheat germ 6.5231731234
Pepper, sweet, green, freeze-dried 3.6767989269
Leavening agent, yeast, baker’s, active, dry 3.4444864120
Spices, basil, dried 2.9424868118
Fish, burbot (loche), native, liver, raw 1.9323202585
Spices, thyme, dried 1.9098740161
Vegetable oil, flaxseed (linseed), cold pressed 0.7440624858
Whey, acid, dry 0.5829816198
Fish oil, cod liver 0.3637249787
Female: 51-70 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 63.4392762659
Egg, chicken, yolk, dried 12.8718782639
Vegetable oil, wheat germ 6.8459068627
Vegetable oil, safflower, linoleic (70% and over) 5.4301657850
Spices, basil, dried 4.8510730659
Pepper, sweet, green, freeze-dried 3.7175024211
Leavening agent, baking powder, double acting, phosphate 2.3710373763
Fish, burbot (loche), native, liver, raw 1.8885682308
Yeast extract spread 1.3413364910
Vegetable oil, flaxseed (linseed), cold pressed 0.7173204797
Fish oil, cod liver 0.3165555916
Beverage, whey protein isolate, powder 0.0423341794
Female: >70 y
Food Consumption_gr
Cereal, ready to eat, All Bran Original, Kellogg’s 122.4489795918
Milk, dry, skim, powder, regular 62.9905257565
Egg, chicken, yolk, dried 12.8894427088
Vegetable oil, wheat germ 6.8924821834
Vegetable oil, safflower, linoleic (70% and over) 5.3918718933
Spices, basil, dried 4.8516080175
Pepper, sweet, green, freeze-dried 3.7197979459
Fish, burbot (loche), native, liver, raw 3.6382463714
Leavening agent, baking powder, double acting, phosphate 2.3972377353
Yeast extract spread 1.3462118863
Vegetable oil, flaxseed (linseed), cold pressed 0.7086237158
Whey, acid, dry 0.1856014244
Fish oil, cod liver 0.0940462670

Personal diet

We will now analyze my personal diet and the optimal way to minimize my nutrient intake.

I selected a subset of 153 products I ususally consume from the Health Canada dataset.

I believe my diet to be standard among most people. For this reason, I will also showcase the optimal solutions for each age group.

##   [1] "Apple juice, canned or bottled, without added vitamin C"                            
##   [2] "Apple, raw, with skin"                                                              
##   [3] "Avocado, raw, all commercial varieties"                                             
##   [4] "Bagel, cinnamon-raisin"                                                             
##   [5] "Banana, raw"                                                                        
##   [6] "Beans, baked, canned, with pork"                                                    
##   [7] "Beans, kidney, light red, boiled"                                                   
##   [8] "Beans, navy, boiled"                                                                
##   [9] "Beans, navy, canned, solids and liquid"                                             
##  [10] "Beans, pinto, canned, drained and rinsed"                                           
##  [11] "Beef pot pie, frozen, prepared"                                                     
##  [12] "Beef, brisket, lean, 0mm (0\") trim, raw"                                           
##  [13] "Beef, chuck, blade roast, boneless, lean and fat, 3mm (1/8'') trim, cooked, braised"
##  [14] "Beef, chuck, cross rib roast, boneless, lean, cooked, braised"                      
##  [15] "Beef, ground, lean, crumbled, pan-fried"                                            
##  [16] "Beef, ground, regular"                                                              
##  [17] "Beef, hip, eye of round roast, boneless, lean, cooked, roasted"                     
##  [18] "Beef, liver, braised"                                                               
##  [19] "Beef, liver, pan-fried"                                                             
##  [20] "Beef, rib, rib eye roast, boneless, lean, cooked, roasted"                          
##  [21] "Blueberry, raw"                                                                     
##  [22] "Bread, banana, homemade, made with margarine"                                       
##  [23] "Bread, rye"                                                                         
##  [24] "Bread, white, commercial"                                                           
##  [25] "Broccoli, boiled, drained"                                                          
##  [26] "Broccoli, raw"                                                                      
##  [27] "Butter, light, unsalted"                                                            
##  [28] "Cabbage, raw"                                                                       
##  [29] "Cabbage, red, boiled, drained"                                                      
##  [30] "Cake mix, chocolate (devil's food, fudge), regular, dry, unprepared"                
##  [31] "Candies, M&M's peanut chocolate candies"                                            
##  [32] "Carrot, boiled, drained"                                                            
##  [33] "Cauliflower, boiled, drained"                                                       
##  [34] "Celery, raw"                                                                        
##  [35] "Cheese, cheddar"                                                                    
##  [36] "Chicken breast tenders, breaded, cooked in conventional oven"                       
##  [37] "Chicken nuggets, dark and white meat, pre-cooked, frozen, not heated"               
##  [38] "Chicken, broiler, drumstick, meat, fried"                                           
##  [39] "Chicken, broiler, leg, meat, roasted"                                               
##  [40] "Chicken, broiler, wing, meat, fried"                                                
##  [41] "Chickpeas (garbanzo beans, bengal gram), canned, drained solids"                    
##  [42] "Chickpeas (garbanzo beans, bengal gram), canned, drained solids"                    
##  [43] "Chickpeas (garbanzo beans, bengal gram), raw"                                       
##  [44] "Cookie, butter, commercial"                                                         
##  [45] "Cookie, chocolate wafer"                                                            
##  [46] "Cookie, peanut butter, commercial"                                                  
##  [47] "Coriander (cilantro), raw"                                                          
##  [48] "Corn, sweet, canned, drained solids, rinsed"                                        
##  [49] "Cracker, multigrain"                                                                
##  [50] "Cucumber, raw"                                                                      
##  [51] "Deli-meat, chicken breast (honey glazed)"                                           
##  [52] "Deli-meat, chicken breast, oven-roasted, sliced"                                    
##  [53] "Deli-meat, Montreal smoked meat, extra lean"                                        
##  [54] "Deli-meat, turkey breast, cooked, sliced"                                           
##  [55] "Egg, chicken, white, fresh or frozen, raw"                                          
##  [56] "Egg, chicken, yolk, dried"                                                          
##  [57] "Fish, cod (scrod), atlantic, baked or broiled"                                      
##  [58] "Fish, herring, atlantic, baked or broiled"                                          
##  [59] "Fish, mackerel, king, baked or broiled"                                             
##  [60] "Fish, salmon, atlantic, wild, baked or broiled"                                     
##  [61] "Fish, salmon, pink, canned, drained solids, without skin and bones"                 
##  [62] "Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted"            
##  [63] "Fish, tilapia, baked or broiled"                                                    
##  [64] "Fish, tuna, light, canned in water, drained, unsalted"                              
##  [65] "Garlic, raw"                                                                        
##  [66] "Ginger root, raw"                                                                   
##  [67] "Grains, oat flour, whole-grain"                                                     
##  [68] "Grains, quinoa, cooked"                                                             
##  [69] "Grains, rice, white, long-grain, parboiled, dry"                                    
##  [70] "Granola bar, All Bran, bars and snack bites, all flavours, Kellogg's"               
##  [71] "Grape, red or green (European type, such as Thompson seedless), adherent skin, raw" 
##  [72] "Indian, bread, naan"                                                                
##  [73] "Juice drink, orange"                                                                
##  [74] "Kale, frozen, boiled, drained"                                                      
##  [75] "Lamb, Canadian, foreshank, lean, raw"                                               
##  [76] "Lemon, raw, without peel"                                                           
##  [77] "Lentils, boiled"                                                                    
##  [78] "Lettuce, cos or romaine"                                                            
##  [79] "Lime, raw"                                                                          
##  [80] "Macaroni and cheese, box mix with cheese sauce, unprepared"                         
##  [81] "Mango, raw"                                                                         
##  [82] "Milk, evaporated, partly skimmed, canned, undiluted, 2% M.F."                       
##  [83] "Mushroom, white, raw"                                                               
##  [84] "Nuts, cashew nuts, raw"                                                             
##  [85] "Nuts, mixed nuts, oil roasted with peanuts"                                         
##  [86] "Nuts, pecans, dried"                                                                
##  [87] "Nuts, pistachio nuts, raw"                                                          
##  [88] "Oil, cooking spray"                                                                 
##  [89] "Olive, pickled, canned or bottled, green"                                           
##  [90] "Onion, frozen, chopped, boiled, drained"                                            
##  [91] "Orange juice, canned"                                                               
##  [92] "Orange juice, raw"                                                                  
##  [93] "Orange-strawberry-banana juice"                                                     
##  [94] "Pasta, egg noodles, enriched, dry"                                                  
##  [95] "Pasta, spaghetti, enriched, cooked"                                                 
##  [96] "Peach, raw"                                                                         
##  [97] "Peanut butter, natural"                                                             
##  [98] "Peas, green, boiled, drained"                                                       
##  [99] "Pepper, sweet, green, raw"                                                          
## [100] "Pepper, sweet, red, raw"                                                            
## [101] "Pepper, sweet, yellow, raw"                                                         
## [102] "Pineapple, raw"                                                                     
## [103] "Pizza, pepperoni, frozen, cooked"                                                   
## [104] "Plantain, raw"                                                                      
## [105] "Pork, composite cuts, leg, loin and shoulder, lean, cooked"                         
## [106] "Pork, loin, centre cut (centre chop), bone-in, lean, pan-fried"                     
## [107] "Pork, loin, rib steak (rib end), boneless, lean, roasted"                           
## [108] "Potato, flesh and skin, baked, with salt"                                           
## [109] "Potato, french-fried, frozen, shoestring, heated in oven"                           
## [110] "Potato, hashed brown, frozen, with butter sauce, prepared"                          
## [111] "Potato, mashed, homemade, prepared with 2% M.F. milk and butter"                    
## [112] "Potato, white, flesh and skin, raw"                                                 
## [113] "Raspberry, frozen, unsweetened"                                                     
## [114] "Raspberry, raw"                                                                     
## [115] "Ravioli, cheese-filled with marinara sauce"                                         
## [116] "Rice, Spanish rice"                                                                 
## [117] "Salad dressing, caesar dressing, regular"                                           
## [118] "Sauce, Alfredo, dehydrated"                                                         
## [119] "Sauce, pepper, TABASCO, ready-to-serve"                                             
## [120] "Sauce, salsa, ready-to-serve"                                                       
## [121] "Sauce, spaghetti, with onion and garlic, ready-to-serve"                            
## [122] "Sauce, teriyaki, ready-to-serve"                                                    
## [123] "Sausage, Bratwurst, beef and pork, smoked"                                          
## [124] "Sausage, chorizo, cooked"                                                           
## [125] "Sausage, honey garlic, pork, cooked"                                                
## [126] "Sausage, Italian, pork, cooked"                                                     
## [127] "Sausage, Oktoberfest, cooked"                                                       
## [128] "Seasoning mix, chili, dry mix"                                                      
## [129] "Snacks, corn-based, extruded, chips, barbecue"                                      
## [130] "Snacks, corn-based, extruded, chips, plain"                                         
## [131] "Snacks, popcorn, microwave, butter flavour"                                         
## [132] "Snacks, pretzels, hard, chocolate coated"                                           
## [133] "Soup, chicken rice, dehydrated"                                                     
## [134] "Soup, cream, vegetable, dehydrated"                                                 
## [135] "Soy sauce (made with soy and wheat), shoyu, sodium reduced"                         
## [136] "Spinach souffle, homemade"                                                          
## [137] "Spinach, frozen, boiled, drained"                                                   
## [138] "Spinach, raw"                                                                       
## [139] "Strawberry, raw"                                                                    
## [140] "Sweet potato, boiled without skin"                                                  
## [141] "Sweet potato, raw"                                                                  
## [142] "Tea, brewed"                                                                        
## [143] "Tea, brewed, chamomile"                                                             
## [144] "Tea, iced, lemon flavour, ready-to-drink"                                           
## [145] "Tomato, red, ripe, raw, year round average"                                         
## [146] "Turkey, all classes, breast, meat and skin, roasted"                                
## [147] "Turkey, broiler, drumstick, meat and skin, roasted"                                 
## [148] "Vegetable oil, canola"                                                              
## [149] "Vegetable oil, olive"                                                               
## [150] "Vinegar, balsamic"                                                                  
## [151] "Yogourt beverage, fruit flavoured"                                                  
## [152] "Yogourt, fruit flavoured (2-3.9% M.F.)"                                             
## [153] "Yogourt, Greek style, fruit flavoured, 2% M.F."

Defining the problem

cons <- matrix(0.01*c(
   diet$RETINOL,
   diet$`VITAMIN D (INTERNATIONAL UNITS)`,
   diet$`ALPHA-TOCOPHEROL`,
   diet$`VITAMIN K`,
   diet$`VITAMIN C`,
   diet$THIAMIN,
   diet$RIBOFLAVIN,
   diet$`NIACIN (NICOTINIC ACID) PREFORMED`,
   diet$`VITAMIN B-6`,
   diet$`DIETARY FOLATE EQUIVALENTS`,
   diet$`VITAMIN B-12`,
   diet$`PANTOTHENIC ACID`,
   diet$BIOTIN,
   diet$`CHOLINE, TOTAL`,
   diet$CARBOHYDRATE,
   diet$PROTEIN,
   diet$LINOLEIC,
   diet$ALPHA_LINOLEIC,
   diet$FIBRE,
   diet$CALCIUM,
   diet$IRON
   ), nrow = 21, byrow = TRUE)
obj_1 <- rep(1, dim(diet)[1])
dir <- rep(">=", 21)

req_ <- req[c(1:20, 22),]

results <- list()
for(i in c(2:15)){
   rhs <- req_[,i]
   
   results[[i]] <- data.frame(Food = diet$FoodDescription,
                              Consumption_day = round(lp("min", obj_1, cons, dir, rhs)$solution),2) %>% 
      filter(Consumption_day>0) %>% 
      arrange(desc(Consumption_day)) %>% 
      select(!c(X2))
}
names(results) <- colnames(req)

Results

for(j in c(2:15)){
  cat(paste0("**", names(results)[j], "**"))
  print(kable(results[j]))
  cat("\n")
}
Children: 1-3 y
Food Consumption_day
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 99
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 85
Sauce, Alfredo, dehydrated 71
Snacks, corn-based, extruded, chips, plain 31
Cake mix, chocolate (devil’s food, fudge), regular, dry, unprepared 25
Egg, chicken, yolk, dried 8
Pepper, sweet, yellow, raw 7
Chickpeas (garbanzo beans, bengal gram), raw 4
Kale, frozen, boiled, drained 3
Beef, liver, braised 2
Children: 4-8 y
Food Consumption_day
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 149
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 118
Sauce, Alfredo, dehydrated 45
Cheese, cheddar 44
Egg, chicken, yolk, dried 29
Snacks, corn-based, extruded, chips, plain 24
Pepper, sweet, yellow, raw 12
Kale, frozen, boiled, drained 5
Chickpeas (garbanzo beans, bengal gram), raw 2
Vegetable oil, canola 1
Male: 9-13 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 193
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 168
Cheese, cheddar 93
Nuts, mixed nuts, oil roasted with peanuts 55
Pepper, sweet, yellow, raw 22
Egg, chicken, yolk, dried 13
Chickpeas (garbanzo beans, bengal gram), raw 11
Vegetable oil, canola 7
Kale, frozen, boiled, drained 5
Beef, liver, braised 2
Soup, cream, vegetable, dehydrated 1
Male: 14-18 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 253
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 197
Nuts, mixed nuts, oil roasted with peanuts 81
Cheese, cheddar 60
Pepper, sweet, yellow, raw 38
Egg, chicken, yolk, dried 19
Chickpeas (garbanzo beans, bengal gram), raw 17
Vegetable oil, canola 10
Kale, frozen, boiled, drained 7
Beef, liver, braised 5
Soup, cream, vegetable, dehydrated 3
Male: 19-30 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 222
Pepper, sweet, yellow, raw 46
Vegetable oil, canola 34
Chickpeas (garbanzo beans, bengal gram), raw 24
Egg, chicken, yolk, dried 20
Nuts, mixed nuts, oil roasted with peanuts 13
Kale, frozen, boiled, drained 10
Beef, liver, braised 6
Soup, cream, vegetable, dehydrated 3
Male: 31-50 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 222
Pepper, sweet, yellow, raw 46
Vegetable oil, canola 34
Chickpeas (garbanzo beans, bengal gram), raw 24
Egg, chicken, yolk, dried 20
Nuts, mixed nuts, oil roasted with peanuts 13
Kale, frozen, boiled, drained 10
Beef, liver, braised 6
Soup, cream, vegetable, dehydrated 3
Male: 51-70 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 153
Pepper, sweet, yellow, raw 45
Nuts, mixed nuts, oil roasted with peanuts 41
Chickpeas (garbanzo beans, bengal gram), raw 29
Vegetable oil, canola 21
Egg, chicken, yolk, dried 20
Kale, frozen, boiled, drained 11
Beef, liver, braised 6
Soup, cream, vegetable, dehydrated 6
Male: >70 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 313
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 145
Nuts, mixed nuts, oil roasted with peanuts 65
Pepper, sweet, yellow, raw 45
Cheese, cheddar 29
Chickpeas (garbanzo beans, bengal gram), raw 25
Egg, chicken, yolk, dried 19
Kale, frozen, boiled, drained 12
Vegetable oil, canola 11
Soup, cream, vegetable, dehydrated 6
Beef, liver, braised 5
Female: 9-13 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 192
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 146
Cheese, cheddar 97
Snacks, corn-based, extruded, chips, plain 30
Pepper, sweet, yellow, raw 22
Chickpeas (garbanzo beans, bengal gram), raw 21
Vegetable oil, canola 18
Egg, chicken, yolk, dried 14
Kale, frozen, boiled, drained 4
Soup, cream, vegetable, dehydrated 3
Beef, liver, braised 2
Female: 14-18 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 256
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 128
Egg, chicken, yolk, dried 57
Cheese, cheddar 48
Snacks, corn-based, extruded, chips, plain 38
Nuts, mixed nuts, oil roasted with peanuts 34
Pepper, sweet, yellow, raw 33
Chickpeas (garbanzo beans, bengal gram), raw 21
Kale, frozen, boiled, drained 7
Vegetable oil, canola 5
Soup, cream, vegetable, dehydrated 2
Female: 19-30 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 106
Grains, oat flour, whole-grain 61
Egg, chicken, yolk, dried 60
Pepper, sweet, yellow, raw 39
Vegetable oil, canola 30
Chickpeas (garbanzo beans, bengal gram), raw 26
Kale, frozen, boiled, drained 7
Beef, liver, braised 1
Female: 31-50 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 106
Grains, oat flour, whole-grain 61
Egg, chicken, yolk, dried 60
Pepper, sweet, yellow, raw 39
Vegetable oil, canola 30
Chickpeas (garbanzo beans, bengal gram), raw 26
Kale, frozen, boiled, drained 7
Beef, liver, braised 1
Female: 51-70 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 312
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 86
Snacks, corn-based, extruded, chips, plain 67
Chickpeas (garbanzo beans, bengal gram), raw 44
Pepper, sweet, yellow, raw 38
Cheese, cheddar 32
Egg, chicken, yolk, dried 14
Vegetable oil, canola 12
Kale, frozen, boiled, drained 8
Soup, cream, vegetable, dehydrated 8
Beef, liver, braised 4
Female: >70 y
Food Consumption_day
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 312
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 86
Snacks, corn-based, extruded, chips, plain 67
Chickpeas (garbanzo beans, bengal gram), raw 44
Pepper, sweet, yellow, raw 38
Cheese, cheddar 32
Egg, chicken, yolk, dried 14
Vegetable oil, canola 12
Kale, frozen, boiled, drained 8
Soup, cream, vegetable, dehydrated 8
Beef, liver, braised 4

Diet with prices for each age group

We obtained the products’ prices from Walmart and Sobeys.

Prices of products by 100 gr
Food Price_100gr Sold
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 2.4694915254 16 bars
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 2.4741784038 1 can
Sauce, Alfredo, dehydrated 5.9189189189 1 package
Snacks, corn-based, extruded, chips, plain 1.1342857143 1 package
Cake mix, chocolate (devil’s food, fudge), regular, dry, unprepared 0.4560185185 1 package
Egg, chicken, yolk, dried 0.6077777778 1 package
Pepper, sweet, yellow, raw 0.8666666667 1 unit
Chickpeas (garbanzo beans, bengal gram), raw 0.2966666667 1 package
Kale, frozen, boiled, drained 1.3149779736 1 package
Beef, liver, braised 0.6800000000 1 slice
Cheese, cheddar 1.5600000000 1 package
Vegetable oil, canola 0.3139534884 1 bottle
Nuts, mixed nuts, oil roasted with peanuts 1.7672566372 1 package
Soup, cream, vegetable, dehydrated 0.9700000000 1 can
Grains, oat flour, whole-grain 1.2328042328 1 package

By taking the prices into account, we can derive how expensive this particular diet would be for each age group:

final = list()
for(i in c(2:15)){
   final[[i]] <- left_join(data.frame(results[[i]]), myd_p, by="Food") %>% 
      mutate(Consumption_year = round(Consumption_day*360,2),
             Expenses_day = round(Consumption_day*Price_100gr/100,2)) %>% 
      mutate(Expenses_year= round(Expenses_day*365,2)) %>% 
      select(!c(Price_100gr, Sold)) %>% #, X2 
      adorn_totals("row")
}

names(final) <- colnames(req)
for(j in c(2:15)){
  cat(paste0("**", names(final)[j], "**"))
  print(kable(final[j], "html")%>%
           kable_styling(full_width = F))
  cat("\n")
}   
Children: 1-3 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 99 35640 2.44 890.60
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 85 30600 2.10 766.50
Sauce, Alfredo, dehydrated 71 25560 4.20 1533.00
Snacks, corn-based, extruded, chips, plain 31 11160 0.35 127.75
Cake mix, chocolate (devil’s food, fudge), regular, dry, unprepared 25 9000 0.11 40.15
Egg, chicken, yolk, dried 8 2880 0.05 18.25
Pepper, sweet, yellow, raw 7 2520 0.06 21.90
Chickpeas (garbanzo beans, bengal gram), raw 4 1440 0.01 3.65
Kale, frozen, boiled, drained 3 1080 0.04 14.60
Beef, liver, braised 2 720 0.01 3.65
Total 335 120600 9.37 3420.05
Children: 4-8 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 149 53640 3.68 1343.20
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 118 42480 2.92 1065.80
Sauce, Alfredo, dehydrated 45 16200 2.66 970.90
Cheese, cheddar 44 15840 0.69 251.85
Egg, chicken, yolk, dried 29 10440 0.18 65.70
Snacks, corn-based, extruded, chips, plain 24 8640 0.27 98.55
Pepper, sweet, yellow, raw 12 4320 0.10 36.50
Kale, frozen, boiled, drained 5 1800 0.07 25.55
Chickpeas (garbanzo beans, bengal gram), raw 2 720 0.01 3.65
Vegetable oil, canola 1 360 0.00 0.00
Total 429 154440 10.58 3861.70
Male: 9-13 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 193 69480 4.78 1744.70
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 168 60480 4.15 1514.75
Cheese, cheddar 93 33480 1.45 529.25
Nuts, mixed nuts, oil roasted with peanuts 55 19800 0.97 354.05
Pepper, sweet, yellow, raw 22 7920 0.19 69.35
Egg, chicken, yolk, dried 13 4680 0.08 29.20
Chickpeas (garbanzo beans, bengal gram), raw 11 3960 0.03 10.95
Vegetable oil, canola 7 2520 0.02 7.30
Kale, frozen, boiled, drained 5 1800 0.07 25.55
Beef, liver, braised 2 720 0.01 3.65
Soup, cream, vegetable, dehydrated 1 360 0.01 3.65
Total 570 205200 11.76 4292.40
Male: 14-18 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 253 91080 6.26 2284.90
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 197 70920 4.86 1773.90
Nuts, mixed nuts, oil roasted with peanuts 81 29160 1.43 521.95
Cheese, cheddar 60 21600 0.94 343.10
Pepper, sweet, yellow, raw 38 13680 0.33 120.45
Egg, chicken, yolk, dried 19 6840 0.12 43.80
Chickpeas (garbanzo beans, bengal gram), raw 17 6120 0.05 18.25
Vegetable oil, canola 10 3600 0.03 10.95
Kale, frozen, boiled, drained 7 2520 0.09 32.85
Beef, liver, braised 5 1800 0.03 10.95
Soup, cream, vegetable, dehydrated 3 1080 0.03 10.95
Total 690 248400 14.17 5172.05
Male: 19-30 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319 114840 7.89 2879.85
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 222 79920 5.48 2000.20
Pepper, sweet, yellow, raw 46 16560 0.40 146.00
Vegetable oil, canola 34 12240 0.11 40.15
Chickpeas (garbanzo beans, bengal gram), raw 24 8640 0.07 25.55
Egg, chicken, yolk, dried 20 7200 0.12 43.80
Nuts, mixed nuts, oil roasted with peanuts 13 4680 0.23 83.95
Kale, frozen, boiled, drained 10 3600 0.13 47.45
Beef, liver, braised 6 2160 0.04 14.60
Soup, cream, vegetable, dehydrated 3 1080 0.03 10.95
Total 697 250920 14.50 5292.50
Male: 31-50 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319 114840 7.89 2879.85
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 222 79920 5.48 2000.20
Pepper, sweet, yellow, raw 46 16560 0.40 146.00
Vegetable oil, canola 34 12240 0.11 40.15
Chickpeas (garbanzo beans, bengal gram), raw 24 8640 0.07 25.55
Egg, chicken, yolk, dried 20 7200 0.12 43.80
Nuts, mixed nuts, oil roasted with peanuts 13 4680 0.23 83.95
Kale, frozen, boiled, drained 10 3600 0.13 47.45
Beef, liver, braised 6 2160 0.04 14.60
Soup, cream, vegetable, dehydrated 3 1080 0.03 10.95
Total 697 250920 14.50 5292.50
Male: 51-70 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319 114840 7.89 2879.85
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 153 55080 3.78 1379.70
Pepper, sweet, yellow, raw 45 16200 0.39 142.35
Nuts, mixed nuts, oil roasted with peanuts 41 14760 0.72 262.80
Chickpeas (garbanzo beans, bengal gram), raw 29 10440 0.09 32.85
Vegetable oil, canola 21 7560 0.07 25.55
Egg, chicken, yolk, dried 20 7200 0.12 43.80
Kale, frozen, boiled, drained 11 3960 0.14 51.10
Beef, liver, braised 6 2160 0.04 14.60
Soup, cream, vegetable, dehydrated 6 2160 0.06 21.90
Total 651 234360 13.30 4854.50
Male: >70 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 313 112680 7.74 2825.10
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 145 52200 3.58 1306.70
Nuts, mixed nuts, oil roasted with peanuts 65 23400 1.15 419.75
Pepper, sweet, yellow, raw 45 16200 0.39 142.35
Cheese, cheddar 29 10440 0.45 164.25
Chickpeas (garbanzo beans, bengal gram), raw 25 9000 0.07 25.55
Egg, chicken, yolk, dried 19 6840 0.12 43.80
Kale, frozen, boiled, drained 12 4320 0.16 58.40
Vegetable oil, canola 11 3960 0.03 10.95
Soup, cream, vegetable, dehydrated 6 2160 0.06 21.90
Beef, liver, braised 5 1800 0.03 10.95
Total 675 243000 13.78 5029.70
Female: 9-13 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 192 69120 4.75 1733.75
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 146 52560 3.61 1317.65
Cheese, cheddar 97 34920 1.51 551.15
Snacks, corn-based, extruded, chips, plain 30 10800 0.34 124.10
Pepper, sweet, yellow, raw 22 7920 0.19 69.35
Chickpeas (garbanzo beans, bengal gram), raw 21 7560 0.06 21.90
Vegetable oil, canola 18 6480 0.06 21.90
Egg, chicken, yolk, dried 14 5040 0.09 32.85
Kale, frozen, boiled, drained 4 1440 0.05 18.25
Soup, cream, vegetable, dehydrated 3 1080 0.03 10.95
Beef, liver, braised 2 720 0.01 3.65
Total 549 197640 10.70 3905.50
Female: 14-18 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 256 92160 6.33 2310.45
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 128 46080 3.16 1153.40
Egg, chicken, yolk, dried 57 20520 0.35 127.75
Cheese, cheddar 48 17280 0.75 273.75
Snacks, corn-based, extruded, chips, plain 38 13680 0.43 156.95
Nuts, mixed nuts, oil roasted with peanuts 34 12240 0.60 219.00
Pepper, sweet, yellow, raw 33 11880 0.29 105.85
Chickpeas (garbanzo beans, bengal gram), raw 21 7560 0.06 21.90
Kale, frozen, boiled, drained 7 2520 0.09 32.85
Vegetable oil, canola 5 1800 0.02 7.30
Soup, cream, vegetable, dehydrated 2 720 0.02 7.30
Total 629 226440 12.10 4416.50
Female: 19-30 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319 114840 7.89 2879.85
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 106 38160 2.62 956.30
Grains, oat flour, whole-grain 61 21960 0.75 273.75
Egg, chicken, yolk, dried 60 21600 0.36 131.40
Pepper, sweet, yellow, raw 39 14040 0.34 124.10
Vegetable oil, canola 30 10800 0.09 32.85
Chickpeas (garbanzo beans, bengal gram), raw 26 9360 0.08 29.20
Kale, frozen, boiled, drained 7 2520 0.09 32.85
Beef, liver, braised 1 360 0.01 3.65
Total 649 233640 12.23 4463.95
Female: 31-50 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 319 114840 7.89 2879.85
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 106 38160 2.62 956.30
Grains, oat flour, whole-grain 61 21960 0.75 273.75
Egg, chicken, yolk, dried 60 21600 0.36 131.40
Pepper, sweet, yellow, raw 39 14040 0.34 124.10
Vegetable oil, canola 30 10800 0.09 32.85
Chickpeas (garbanzo beans, bengal gram), raw 26 9360 0.08 29.20
Kale, frozen, boiled, drained 7 2520 0.09 32.85
Beef, liver, braised 1 360 0.01 3.65
Total 649 233640 12.23 4463.95
Female: 51-70 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 312 112320 7.72 2817.80
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 86 30960 2.12 773.80
Snacks, corn-based, extruded, chips, plain 67 24120 0.76 277.40
Chickpeas (garbanzo beans, bengal gram), raw 44 15840 0.13 47.45
Pepper, sweet, yellow, raw 38 13680 0.33 120.45
Cheese, cheddar 32 11520 0.50 182.50
Egg, chicken, yolk, dried 14 5040 0.09 32.85
Vegetable oil, canola 12 4320 0.04 14.60
Kale, frozen, boiled, drained 8 2880 0.11 40.15
Soup, cream, vegetable, dehydrated 8 2880 0.08 29.20
Beef, liver, braised 4 1440 0.03 10.95
Total 625 225000 11.91 4347.15
Female: >70 y
Food Consumption_day Consumption_year Expenses_day Expenses_year
Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted 312 112320 7.72 2817.80
Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s 86 30960 2.12 773.80
Snacks, corn-based, extruded, chips, plain 67 24120 0.76 277.40
Chickpeas (garbanzo beans, bengal gram), raw 44 15840 0.13 47.45
Pepper, sweet, yellow, raw 38 13680 0.33 120.45
Cheese, cheddar 32 11520 0.50 182.50
Egg, chicken, yolk, dried 14 5040 0.09 32.85
Vegetable oil, canola 12 4320 0.04 14.60
Kale, frozen, boiled, drained 8 2880 0.11 40.15
Soup, cream, vegetable, dehydrated 8 2880 0.08 29.20
Beef, liver, braised 4 1440 0.03 10.95
Total 625 225000 11.91 4347.15

Personal results

Based on the results obtained, the diet that meets my minimum nutrient intakes (I am 20 years old) should include the following products:

  • Fish, salmon, sockeye (red), canned, drained solids with bone, unsalted
  • Granola bar, All Bran, bars and snack bites, all flavours, Kellogg’s
  • Pepper, sweet, yellow, raw
  • Vegetable oil, canola
  • Chickpeas (garbanzo beans, bengal gram), raw
  • Egg, chicken, yolk, dried
  • Nuts, mixed nuts, oil roasted with peanuts
  • Kale, frozen, boiled, drained
  • Beef, liver, braised
  • Soup, cream, vegetable, dehydrated

This diet would approximately cost me CAD 14.50 per day and CAD 5,292.50 per year.

Further Research

I strongly believe that this analysis can be useful for Canadian policy-makers, schools, and senior centres to prepare appropriate meal plans for people in need, students, and elderly people, respectively.

It would be interesting to compare Canada’s situation with respect to other countries. By making this kind of analysis, as Darko’s research in Ghana (2013), international economic policy-makers could direct funds to deal with the problem of hunger in developing countries in a more optimal way.

Additionally, we could orient the problem of optimizing a diet differently in many different angles as Gephart et. al. (2016), who rather focused on optimizing diets to minimize footprints.

The current work could be improved by performing sensitivity analyses to test the robustness of the findings.

References

Darko, A. 2013. Cost-minimizing food budgets in Ghana. Journal of Development and Agricultural Economics. 5 : 135-141.

Gephart, A., K. Davis, K. Emery, A. Leach, J. Galloway, M. Pace. 2016. The environmental cost of subsistence: Optimizing diets to minimize footprints. Science of The Total Environment. 553 : 120-127

Stigler, G. 1945. The cost of subsistence. Journal of Farm Economics. 27(2) : 303–314.