Marks and Spencer Midterm: Chicken Ready Meals

Karol M. Orozco

10/20/2020

Answer the following questions by yourself in as much detail as possible. Partial credit will be awarded in the event that the reasoning is sufficiently clear to uncover the parts of a question correctly answered; be systematic in solving the problems. This will always take you far. Supply answers in relevant metrics with complete answers; computer output alone is insufficient.

The Data

You have been given three data sets for use in tackling the problem. We have two data files that are identical: an Excel workbook and an .RData file.

  • Financials: In one spreadsheet, we have revenues and expenses data for the last 36 weeks for two product lines in frozen foods (measured in 1000s of dollars per week). Pay no mind to the times that may appear alongside the dates this is an Excel vestige.

    • Stacked: Revenues and Expenses are recorded by Product by Week and WeekNo.
    • Tikka.Expense records Expenses for the Chicken Tikka product in 1000s of US dollars.
    • Tikka.Revenue records Revenues for the Chicken Tikka product in 1000s of US dollars.
    • Vindaloo.Expense records Expenses for the Chicken Vindaloo product in 1000s of US dollars.
    • Vindaloo.Revenue records Revenues for the Chicken Vindaloo product in 1000s of US dollars.
  • Satisfaction: In one spreadsheet, the levels of product satisfaction are recorded for random samples of customers for each product. + Stacked: Response records Like or not like for the given Product in that row. + Tikka.Like records Like or not like for the sample asked about Chicken Tikka Masala. + Vindaloo.Like records Like or not like for the sample asked about Chicken Vindaloo.

  • Input.Cost: In one spreadsheet, the costs of inputs for the two products are described in stacked and unstacked form. + Stacked: Cost is the realized cost of inputs (per unit) in US dollars for Product + Tikka.Cost is the realized cost of inputs (per unit) in US dollars for Chicken Tikka Masala. + Vindaloo.Cost is the realized cost of inputs (per unit) in US dollars for Chicken Vindaloo.

The Problem:

The Marks and Spencer food division has a problem, and your job is to recommend a course of action. Marks and Spencer is currently outsourcing the production of Chicken Tikka Masala and Chicken Vindaloo to the same vendor. The vendor can no longer fully supply Marks and Spencer’s required quantities for both products. The vendor can continue to supply either one of the two products, but a new vendor will be needed if both products are continued. Key company procedures and definitions precede questions in some sections. Use the 95% confidence interval/level for all decision making unless otherwise noted.

Calculating Net Income

Financials <- Financials %>% mutate(Net.Income = Revenues - Expenses, TikkaNI = ChickenTikka.Revenue - ChickenTikka.Expense, VindalooNI = ChickenVindaloo.Revenue - ChickenVindaloo.Expense)
names(Financials) # Show the names of the variables in the revised Financials
 [1] "WeekNo"                  "ChickenTikka.Expense"   
 [3] "ChickenTikka.Revenue"    "ChickenVindaloo.Revenue"
 [5] "ChickenVindaloo.Expense" "Revenues"               
 [7] "Expenses"                "Product"                
 [9] "Week"                    "Net.Income"             
[11] "TikkaNI"                 "VindalooNI"             

The Basics

  1. What is the probability
    • between -1 and 1 for a standard normal distribution?

The probability between -1 and 1 for a standard normal distribution 0.683

result <- prob_norm(mean = 0, stdev = 1, lb = -1, ub = 1)
summary(result)
Probability calculator
Distribution: Normal
Mean        : 0 
St. dev     : 1 
Lower bound : -1 
Upper bound : 1 

P(X < -1) = 0.159
P(X > -1) = 0.841
P(X < 1) = 0.841
P(X > 1) = 0.159
P(-1 < X < 1)     = 0.683
1 - P(-1 < X < 1) = 0.317
plot(result)

  • between -1 and 2 for a standard normal distribution?

The probability between -1 and 2 for a standard normal distribution 0.819

result <- prob_norm(mean = 0, stdev = 1, lb = -1, ub = 2)
summary(result)
Probability calculator
Distribution: Normal
Mean        : 0 
St. dev     : 1 
Lower bound : -1 
Upper bound : 2 

P(X < -1) = 0.159
P(X > -1) = 0.841
P(X < 2) = 0.977
P(X > 2) = 0.023
P(-1 < X < 2)     = 0.819
1 - P(-1 < X < 2) = 0.181
plot(result)

  1. What values of a normal distribution with mean 25 and standard deviation 5 describe the middle 50% of the data? Provide both boundaries.

The values are 21.628 and 28.372.

result <- prob_norm(mean = 25, stdev = 5, plb = 0.25, pub = 0.75)
summary(result, type = "probs")
Probability calculator
Distribution: Normal
Mean        : 25 
St. dev     : 5 
Lower bound : 0.25 
Upper bound : 0.75 

P(X < 21.628) = 0.25
P(X > 21.628) = 0.75
P(X < 28.372) = 0.75
P(X > 28.372) = 0.25
P(21.628 < X < 28.372)     = 0.5
1 - P(21.628 < X < 28.372) = 0.5
plot(result, type = "probs")

  1. Suppose airplane crashes are described by a Poisson process and arrive at a rate of 6 per year. What is the probability of 10 or more crashes in a year?

The probability of 10 or more crashes in a year is 0.084

result <- prob_pois(lambda = 6, lb = 10)
summary(result)
Probability calculator
Distribution: Poisson
Lambda      : 6 
Mean        : 6 
Variance    : 6 
Lower bound : 10 
Upper bound :  

P(X  = 10) = 0.041
P(X  < 10) = 0.916
P(X <= 10) = 0.957
P(X  > 10) = 0.043
P(X >= 10) = 0.084
plot(result)

  1. The sum of \(k\) squared standard normal variables (\(Z^{2}\)) has a \(\chi^2\) distribution with degrees of freedom equal to \(k\). The \(R\) noun is \(chisq\), and the verb is \(df\).
  • With 90% probability, the sum of 4 squared \(Z (normal (0,1))\) is less than XXX.

The probability is less than 2.71

result <- prob_chisq(df = 1, pub = 0.9, dec = 2)
summary(result, type = "probs")
Probability calculator
Distribution: Chi-squared
Df          : 1 
Mean        : 1 
Variance    : 2 
Lower bound : 0 
Upper bound : 0.9 

P(X < 2.71) = 0.9
P(X > 2.71) = 0.1
plot(result, type = "probs")

  • The probability of a \(\chi^2\) random variable with 1 degree of freedom being less than 3.841459 is XXX.

The probability of a chi-squared random variable with 1 degree of freedom being less than 3.841459 is 0.95

result <- prob_chisq(df = 1, lb = 3.841459, dec = 2)
summary(result)
Probability calculator
Distribution: Chi-squared
Df          : 1 
Mean        : 1 
Variance    : 2 
Lower bound : 3.841459 
Upper bound : Inf 

P(X < 3.841459) = 0.95
P(X > 3.841459) = 0.05
plot(result)

Input Costs

  1. Provide summary statistics for each product and a combined graphic depicting the Input.Cost of Chicken Tikka Masala and Chicken Vindaloo.
result <- compare_means(
  Input.Cost, 
  var1 = "Product", 
  var2 = "Cost"
)
summary(result, show = TRUE)
Pairwise mean comparisons (t-test)
Data      : Input.Cost 
Variables : Product, Cost 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product  mean  n n_missing    sd    se    me
    ChickenTikka 2.494 49         0 0.221 0.032 0.064
 ChickenVindaloo 2.491 64         0 0.275 0.034 0.069

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value se    t.value df      2.5%   97.5%  
 0.003 0.942   0.041 0.073   110.716 -0.089 0.096  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

  1. Suppose that each product has input costs that are normally distributed with the mean and standard deviation given in the summaries above (you may round to two digits to the right of the decimal place). What is the probability of costs above $2.25

    • for Chicken Tikka?

The probability of costs above $2.25 is 0.86

result <- prob_norm(mean = 2.49, stdev = 0.221, ub = 2.25)
summary(result)
Probability calculator
Distribution: Normal
Mean        : 2.49 
St. dev     : 0.221 
Lower bound : -Inf 
Upper bound : 2.25 

P(X < 2.25) = 0.139
P(X > 2.25) = 0.861
plot(result)

  + for Chicken Vindaloo?
  

The probability of costs above $2.25 is 0.80

result <- prob_norm(mean = 2.49, stdev = 0.275, ub = 2.25)
summary(result)
Probability calculator
Distribution: Normal
Mean        : 2.49 
St. dev     : 0.275 
Lower bound : -Inf 
Upper bound : 2.25 

P(X < 2.25) = 0.191
P(X > 2.25) = 0.809
plot(result)

  1. What is the average input cost for Chicken Tikka Masala with 95% confidence [provide both bounds]?

The average input cost for Chicken Tikka Masala with 95% confidence is $2.431 to $2.558.

result <- single_mean(Input.Cost, var = "ChickenTikka.Cost")
summary(result)
Single mean test
Data      : Input.Cost 
Variable  : ChickenTikka.Cost 
Confidence: 0.95 
Null hyp. : the mean of ChickenTikka.Cost = 0 
Alt. hyp. : the mean of ChickenTikka.Cost is not equal to 0 

  mean   n n_missing    sd    se    me
 2.494 113        64 0.221 0.032 0.063

  diff    se t.value p.value df  2.5% 97.5%    
 2.494 0.032  78.944  < .001 48 2.431 2.558 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

  1. What is the probability that the average cost of Chicken Tikka Masala is greater than $2.65?

The probability that the average cost of Chicken Tikka Masala is greater than $2.65 is 0.001

result <- single_mean(
  Input.Cost, 
  var = "ChickenTikka.Cost", 
  comp_value = 2.65, 
  alternative = "less"
)
summary(result)
Single mean test
Data      : Input.Cost 
Variable  : ChickenTikka.Cost 
Confidence: 0.95 
Null hyp. : the mean of ChickenTikka.Cost = 2.65 
Alt. hyp. : the mean of ChickenTikka.Cost is < 2.65 

  mean   n n_missing    sd    se    me
 2.494 113        64 0.221 0.032 0.063

   diff    se t.value p.value df   0%   95%    
 -0.156 0.032  -4.928  < .001 48 -Inf 2.547 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

5. What is the average input cost for Chicken Vindaloo with 95% confidence [provide both bounds]?

With 95% confidence, the average input cost for Chicken Vindaloo ranges from $2.422 to $ 2.56

result <- single_mean(
  Input.Cost, 
  var = "ChickenVindaloo.Cost"
)
summary(result)
Single mean test
Data      : Input.Cost 
Variable  : ChickenVindaloo.Cost 
Confidence: 0.95 
Null hyp. : the mean of ChickenVindaloo.Cost = 0 
Alt. hyp. : the mean of ChickenVindaloo.Cost is not equal to 0 

  mean   n n_missing    sd    se    me
 2.491 113        49 0.275 0.034 0.068

  diff    se t.value p.value df  2.5% 97.5%    
 2.491 0.034    72.4  < .001 63 2.422  2.56 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

  1. What is the probability that the average cost of Chicken Vindaloo is less than $2.45?

The probability that the average cost of Chicken Vindaloo is less than $2.45 is 0.12

result <- single_mean(
  Input.Cost, 
  var = "ChickenVindaloo.Cost", 
  comp_value = 2.45, 
  alternative = "greater"
)
summary(result)
Single mean test
Data      : Input.Cost 
Variable  : ChickenVindaloo.Cost 
Confidence: 0.95 
Null hyp. : the mean of ChickenVindaloo.Cost = 2.45 
Alt. hyp. : the mean of ChickenVindaloo.Cost is > 2.45 

  mean   n n_missing    sd    se    me
 2.491 113        49 0.275 0.034 0.068

  diff    se t.value p.value df    5% 100%  
 0.041 0.034   1.188    0.12 63 2.433  Inf  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

  1. Does either product have lower input costs with 95% confidence?
    • If yes, which one?

Chicken Tikka has a lower input cost at -0.089 and 0.096 over Chicken Vindaloo.

result <- compare_means(
  Input.Cost, 
  var1 = "Product", 
  var2 = "Cost"
)
summary(result, show = TRUE)
Pairwise mean comparisons (t-test)
Data      : Input.Cost 
Variables : Product, Cost 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product  mean  n n_missing    sd    se    me
    ChickenTikka 2.494 49         0 0.221 0.032 0.064
 ChickenVindaloo 2.491 64         0 0.275 0.034 0.069

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value se    t.value df      2.5%   97.5%  
 0.003 0.942   0.041 0.073   110.716 -0.089 0.096  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

Customer opinions matter.

Rule: The true probability of Like must be greater than or equal to 0.5 to continue a product.

Questions

  1. Provide a table showing opinions by product.
result <- explore(
  Satisfaction, 
  vars = "Response", 
  byvar = "Product", 
  fun = c("n_obs", "mean", "min", "max", "sd"), 
  nr = 2
)
summary(result)
Explore
Data        : Satisfaction 
Grouped by  : Product 
Functions   : n_obs, mean, min, max, sd 
Top         : Function 

         Product variable n_obs  mean min max    sd
    ChickenTikka Response   127 0.591   1   2 0.494
 ChickenVindaloo Response   102 0.627   1   2 0.486
+ What is the probability of Like for Chicken Tikka?

The probability of Like for Chicken Tikka range between 50% and 67.7%

result <- single_prop(
  Satisfaction, 
  var = "ChickenTikka.Like", 
  lev = "Like"
)
summary(result)
Single proportion test (binomial exact)
Data      : Satisfaction 
Variable  : ChickenTikka.Like 
Level     : Like in ChickenTikka.Like 
Confidence: 0.95 
Null hyp. : the proportion of Like in ChickenTikka.Like = 0.5 
Alt. hyp. : the proportion of Like in ChickenTikka.Like not equal to 0.5 

     p ns   n n_missing    sd    se    me
 0.591 75 127       102 0.492 0.044 0.086

  diff ns p.value  2.5% 97.5%  
 0.091 75   0.050 0.500 0.677 .

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

+ What is the probability of Like for Chicken Vindaloo?

The probability of like for Chicken Vindaloo range in between 52.6% and 72.1%

result <- single_prop(
  Satisfaction, 
  var = "ChickenVindaloo.Like", 
  lev = "Like"
)
summary(result)
Single proportion test (binomial exact)
Data      : Satisfaction 
Variable  : ChickenVindaloo.Like 
Level     : Like in ChickenVindaloo.Like 
Confidence: 0.95 
Null hyp. : the proportion of Like in ChickenVindaloo.Like = 0.5 
Alt. hyp. : the proportion of Like in ChickenVindaloo.Like not equal to 0.5 

     p ns   n n_missing    sd    se    me
 0.627 64 102       127 0.483 0.048 0.094

  diff ns p.value  2.5% 97.5%  
 0.127 64   0.013 0.526 0.721 *

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

+ Which product is more popular, taking no account of uncertainty?

Chicken Vindaloo is more popular. It has a probability of 0.627 likes, and Chicken Tikka has a probability of 0.591 likes. Thus making Chicken Vindaloo the more popular option at 63%.

  1. Management is concerned that the survey data may be influenced by missing responses. Each product was given to 130 tasters and free samples usually lead to probabilities of a response of 0.95. What is the probability of the number of observed responses [or fewer] for each product? Less than 5% probability should lead you to discount the survey evidence though you must still answer the remaining questions.

The probability of number of likes received for Chicken Vindaloo is 0.013.

result <- single_prop(
  Satisfaction, 
  var = "ChickenVindaloo.Like", 
  lev = "Like"
)
summary(result)
Single proportion test (binomial exact)
Data      : Satisfaction 
Variable  : ChickenVindaloo.Like 
Level     : Like in ChickenVindaloo.Like 
Confidence: 0.95 
Null hyp. : the proportion of Like in ChickenVindaloo.Like = 0.5 
Alt. hyp. : the proportion of Like in ChickenVindaloo.Like not equal to 0.5 

     p ns   n n_missing    sd    se    me
 0.627 64 102       127 0.483 0.048 0.094

  diff ns p.value  2.5% 97.5%  
 0.127 64   0.013 0.526 0.721 *

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

The probability of number of likes received for Chicken Tikka is 0.050.

result <- single_prop(
  Satisfaction, 
  var = "ChickenTikka.Like", 
  lev = "Like"
)
summary(result)
Single proportion test (binomial exact)
Data      : Satisfaction 
Variable  : ChickenTikka.Like 
Level     : Like in ChickenTikka.Like 
Confidence: 0.95 
Null hyp. : the proportion of Like in ChickenTikka.Like = 0.5 
Alt. hyp. : the proportion of Like in ChickenTikka.Like not equal to 0.5 

     p ns   n n_missing    sd    se    me
 0.591 75 127       102 0.492 0.044 0.086

  diff ns p.value  2.5% 97.5%  
 0.091 75   0.050 0.500 0.677 .

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

  1. Should Chicken.Vindaloo be continued?

Chicken Vindaloo because the number of observed responses is below 5% (1.3%).

+ What is a (2-sided) 95% confidence interval for the probability of *Like*?

The confidence interval for the probability of Like is 0.526 and 0.721.

  1. Should Chicken.Tikka be continued?

Chicken Tikka should be continued based on its probability of number of likes received, 0.050.

+ What is a (2-sided) 95% confidence interval for the probability of *Like*?

The confidence interval for the probability of Like is 0.500 and 0.677.

  1. Is either product preferred with 95% confidence?

Chicken Tikka is preferred over Chicken Vindaloo by 57%, as shown in the graph below.

result <- compare_props(
  Satisfaction, 
  var1 = "Product", 
  var2 = "Response", 
  levs = "Like"
)
summary(result, show = TRUE)
Pairwise proportion comparisons
Data      : Satisfaction 
Variables : Product, Response 
Level     : Like in Response 
Confidence: 0.95 
Adjustment: None 

         Product Like NotLike     p   n n_missing    sd    se    me
    ChickenTikka   75      52 0.591 127         0 0.492 0.044 0.086
 ChickenVindaloo   64      38 0.627 102         0 0.483 0.048 0.094

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff   p.value chisq.value df 2.5%   97.5%  
 -0.037 0.57    0.323       1  -0.164 0.090  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

Product line financials

Product line financials are equally or more important. Average net income is the key decision metric. It should obviously be maximized. You can use R or Microsoft Excel for the calculation of net income.

Rules:
Products with average revenues less than 100,000 must be discontinued. Outstanding food products average over $10,000 in net income per week and must be continued.
* Products should be continued if their average net incomes are positive. * Products should be prioritized if their average net incomes are different.

Basic Financial Variables

  1. Provide a numerical summary of revenues and expenses for each product.
result <- explore(
  Financials, 
  vars = c(
    "WeekNo", "ChickenTikka.Expense", 
    "ChickenTikka.Revenue", 
    "ChickenVindaloo.Revenue", 
    "ChickenVindaloo.Expense", 
    "Revenues", "Expenses", 
    "Product", "Week"
  ), 
  fun = c("n_obs", "mean", "min", "max", "sd"), 
  nr = Inf
)
summary(result)
Explore
Data        : Financials 
Functions   : n_obs, mean, min, max, sd 
Top         : Function 

                variable n_obs              mean           min
                  WeekNo    72            18.500             1
    ChickenTikka.Expense    72            98.785            73
    ChickenTikka.Revenue    72           111.774            94
 ChickenVindaloo.Revenue    72           104.957            91
 ChickenVindaloo.Expense    72            96.990            79
                Revenues    72           108.366            91
                Expenses    72            97.888            73
                 Product    72             0.500             1
                    Week    72 1,402,228,300.000 1,391,641,200
               max            sd
            36.000        10.461
           126.625        10.735
           130.649         9.999
           122.916         6.509
           118.415         8.438
           130.649         9.053
           126.625         9.629
             2.000         0.504
 1,412,812,800.000 6,327,682.629
# dtab(result) %>% render()
  1. Provide a graphic describing revenues by product.
result <- compare_means(
  Financials, 
  var1 = "Product", 
  var2 = "Revenues", 
  comb = "ChickenVindaloo.Cost:Cost"
)
summary(result, show = TRUE)
Pairwise mean comparisons (t-test)
Data      : Financials 
Variables : Product, Revenues 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product    mean  n n_missing    sd    se    me
    ChickenTikka 111.774 36         0 9.999 1.666 3.383
 ChickenVindaloo 104.957 36         0 6.509 1.085 2.202

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value se    t.value df     2.5%  97.5%    
 6.817 0.001   1.989 3.428   60.149 2.839 10.794 **

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

  1. Provide a graphic describing expenses by product.
result <- compare_means(
  Financials, 
  var1 = "Product", 
  var2 = "Expenses", 
  comb = "ChickenVindaloo.Cost:Cost"
)
summary(result, show = TRUE)
Pairwise mean comparisons (t-test)
Data      : Financials 
Variables : Product, Expenses 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product   mean  n n_missing     sd    se    me
    ChickenTikka 98.785 36         0 10.735 1.789 3.632
 ChickenVindaloo 96.990 36         0  8.438 1.406 2.855

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value se    t.value df   2.5%   97.5%  
 1.794 0.433   2.275 0.788   66.3 -2.749 6.337  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

  1. Provide a 95% confidence interval for average revenues for each product.

Chicken Tikka $108.391 to $115.157

result <- single_mean(
  Financials, 
  var = "ChickenTikka.Revenue"
)
summary(result)
Single mean test
Data      : Financials 
Variable  : ChickenTikka.Revenue 
Confidence: 0.95 
Null hyp. : the mean of ChickenTikka.Revenue = 0 
Alt. hyp. : the mean of ChickenTikka.Revenue is not equal to 0 

    mean  n n_missing    sd    se    me
 111.774 72        36 9.999 1.666 3.323

    diff    se t.value p.value df    2.5%   97.5%    
 111.774 1.666  67.072  < .001 35 108.391 115.157 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

Chicken Vindaloo $102.755 to $107.16

result <- single_mean(
  Financials, 
  var = "ChickenVindaloo.Revenue"
)
summary(result)
Single mean test
Data      : Financials 
Variable  : ChickenVindaloo.Revenue 
Confidence: 0.95 
Null hyp. : the mean of ChickenVindaloo.Revenue = 0 
Alt. hyp. : the mean of ChickenVindaloo.Revenue is not equal to 0 

    mean  n n_missing    sd    se    me
 104.957 72        36 6.509 1.085 2.163

    diff    se t.value p.value df    2.5%  97.5%    
 104.957 1.085  96.747  < .001 35 102.755 107.16 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "hist", custom = FALSE)

  1. Assume that expenses are distributed normal with mean and standard deviation exactly equal to those in the samples of data that you possess. Provide a 90% [10% below, 90% above] lower bound for expenses for each product.

If the probability is 90% below the normal distribution, Chicken Vindaloo would be 96.615

result <- prob_norm(
  mean = 104.957, 
  stdev = 6.509, 
  plb = 0.1, 
  dec = 2
)
summary(result, type = "probs")
Probability calculator
Distribution: Normal
Mean        : 104.96 
St. dev     : 6.51 
Lower bound : 0.1 
Upper bound : 1 

P(X < 96.62) = 0.1
P(X > 96.62) = 0.9
plot(result, type = "probs")

If the probability is 90% below the normal distribution, Chicken Tikka would be 98.96

result <- prob_norm(
  mean = 111.774, 
  stdev = 9.999, 
  plb = 0.1,  
  dec = 2
)
summary(result, type = "probs")
Probability calculator
Distribution: Normal
Mean        : 111.77 
St. dev     : 10 
Lower bound : 0.1 
Upper bound : 1 

P(X < 98.96) = 0.1
P(X > 98.96) = 0.9
plot(result, type = "probs")

Net Income

  1. Summarize net income for each product.
result <- compare_means(
  Financials, 
  var1 = "Product", 
  var2 = "Net.Income"
)
summary(result, show = FALSE)
Pairwise mean comparisons (t-test)
Data      : Financials 
Variables : Product, Net.Income 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product   mean  n n_missing    sd    se    me
    ChickenTikka 12.989 36         0 6.237 1.039 2.110
 ChickenVindaloo  7.967 36         0 3.587 0.598 1.214

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value    
 5.022 < .001  ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "bar", custom = FALSE)

  • Provide a plot of Net Income over time in a separate graphic for each product.
visualize(
Financials, 
  xvar = "WeekNo", 
  yvar = c("TikkaNI", "VindalooNI"), 
  type = "line", 
  facet_col = "Product", 
  linecol = "blue1", 
  pointcol = "bisque", 
  theme = "theme_minimal", 
  base_size = 12, 
  base_family = "Courier", 
  custom = FALSE
Error: <text>:13:0: unexpected end of input
11:   base_family = "Courier", 
12:   custom = FALSE
   ^
  1. Which, if any, products must be discontinued?

Those products should not be discontinued. Both Chicken Tikka and Chicken Vindaloo produce average revenue above $100,000

+ Provide 95% confidence intervals for average revenues for each product.
result <- compare_means(
  Financials, 
  var1 = "Product", 
  var2 = "Revenues"
)
summary(result, show = FALSE)
Pairwise mean comparisons (t-test)
Data      : Financials 
Variables : Product, Revenues 
Samples   : independent 
Confidence: 0.95 
Adjustment: None 

         Product    mean  n n_missing    sd    se    me
    ChickenTikka 111.774 36         0 9.999 1.666 3.383
 ChickenVindaloo 104.957 36         0 6.509 1.085 2.202

 Null hyp.                        Alt. hyp.                                  
 ChickenTikka = ChickenVindaloo   ChickenTikka not equal to ChickenVindaloo  
 diff  p.value   
 6.817 0.001   **

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

  1. Which, if any, products are outstanding?

Provided the information in question 1 above, Chicken Tikka produces the most net income per week by 120,989, which is more than $100,000 stated in the rule.

a. What is the 95% confidence interval for net income for **Chicken.Tikka**?

With 95% confidence interval, Chicken Tikka’s net income interval is $108,790 to $150,990.

result <- single_mean(
  Financials, 
  var = "TikkaNI", 
  comp_value = 12.989
)
summary(result)
Single mean test
Data      : Financials 
Variable  : TikkaNI 
Confidence: 0.95 
Null hyp. : the mean of TikkaNI = 12.989 
Alt. hyp. : the mean of TikkaNI is not equal to 12.989 

   mean  n n_missing    sd    se    me
 12.989 72        36 6.237 1.039 2.073

 diff    se t.value p.value df   2.5%  97.5%  
    0 1.039       0       1 35 10.879 15.099  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
b. Should **Chicken.Tikka** be continued (by net income)?

Yes, Chicken Tikka should be continued because it’s net income is positive.

c. What is the 95% confidence interval for net income for **Chicken.Vindaloo**?

With a 95% confidence interval, the net income for Chicken Tikka is $67,500 to $91,800

result <- single_mean(
  Financials, 
  var = "VindalooNI", 
  comp_value = 7.967
)
summary(result)
Single mean test
Data      : Financials 
Variable  : VindalooNI 
Confidence: 0.95 
Null hyp. : the mean of VindalooNI = 7.967 
Alt. hyp. : the mean of VindalooNI is not equal to 7.967 

  mean  n n_missing    sd    se    me
 7.967 72        36 3.587 0.598 1.192

 diff    se t.value p.value df  2.5% 97.5%  
    0 0.598       0       1 35 6.753  9.18  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
d. Should **Chicken.Vindaloo** be continued (by net income)?

Yes, Chicken Vindaloo should be continued because it produces a positive net income.

  1. Is there a difference in net income between the two products?

The Net Income difference between the two products is $50,220 and a true mean difference of 4.646 between them.

result <- compare_means(
  Financials, 
  var1 = "TikkaNI", 
  var2 = "VindalooNI", 
  samples = "paired"
)
summary(result, show = TRUE)
Pairwise mean comparisons (t-test)
Data      : Financials 
Variables : TikkaNI, VindalooNI 
Samples   : paired 
Confidence: 0.95 
Adjustment: None 

              mean  n n_missing    sd    se    me
    TikkaNI 12.989 72        36 6.237 1.039 2.073
 VindalooNI  7.967 72        36 3.587 0.598 1.192

 Null hyp.              Alt. hyp.                         diff  p.value se   
 TikkaNI = VindalooNI   TikkaNI not equal to VindalooNI   5.022 < .001  1.081
 t.value df 2.5%  97.5%    
 4.646   35 2.828 7.217 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(result, plots = "box", custom = FALSE)

+ Which one is more profitable?

Chicken Tikka is more profitable

+ Provide the [two-sided] 95% confidence interval for the average difference in net income.

With a 95% confidence interval, the average difference in net income is 9.151 and 11.805, respectively.

result <- single_mean(
  Financials, 
  var = "Net.Income", 
  comp_value = 10.478
)
summary(result)
Single mean test
Data      : Financials 
Variable  : Net.Income 
Confidence: 0.95 
Null hyp. : the mean of Net.Income = 10.478 
Alt. hyp. : the mean of Net.Income is not equal to 10.478 

   mean  n n_missing    sd    se    me
 10.478 72         0 5.649 0.666 1.327

 diff    se t.value p.value df  2.5%  97.5%  
    0 0.666       0       1 71 9.151 11.805  

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Some Other Concerns

Some recipes are more prone to harboring disease than others. The company is willing to accept the occasional risk but wishes to discontinue even moderately dangerous products. Historically, Chicken Vindaloo has had recalls arrive at a rate of 4 per year. What is the probability of seven or fewer recalls in a given year for Chicken Vindaloo?

The probability of seven or fewer recalls in a given year for Chicken Vindaloo 0.949.

result <- prob_pois(lambda = 4, ub = 7)
summary(result)
Probability calculator
Distribution: Poisson
Lambda      : 4 
Mean        : 4 
Variance    : 4 
Lower bound :  
Upper bound : 7 

P(X  = 7) = 0.06
P(X  < 7) = 0.889
P(X <= 7) = 0.949
P(X  > 7) = 0.051
P(X >= 7) = 0.111
plot(result)

The Choice [15%]

  1. Discontinue both products
  2. Continue only Chicken Vindaloo and cancel Chicken Tikka,
  3. Continue only Chicken Tikka and cancel Chicken Vindaloo
  4. Continue Chicken Tikka with the current supplier and seek a new supplier for Chicken Vindaloo.
  5. Continue Chicken Vindaloo with the current supplier and seek a new supplier for Chicken Tikka.

Which do you recommend and why?

Data Summary

Chicken Tikka Chicken Vindaloo
Input Cost $2.431 to $2.558 $2.422 to $ 2.56
Revenue $108.391 and $115.157 $102.755 and $107.16
pLike 59.1% 62.7%
Net Income $108,790 and $150,990 $67,500 and $91,800
pHarboring disease N/A 0.949

Based on the criteria analysis of the results, I recommend Option 4: Continue Chicken Tikka with the current supplier and seek a new supplier for Chicken Vindaloo

Although Chicken Vindaloo has a probability of like lower of 5% (0.013), both products fall under the rules of product line financials that qualify them to be continued:

- They have a positive average net income.
- Their revenues are over $100.000

Another fact is that Chicken Vindaloo has a higher average of customer satisfaction than Chicken Tikka. However, the risk probability of 7 or fewer Chicken Vindaloo recalls for harboring disease in its recipes is high. This is an issue that the company needs to address immediately, and a different supplier should decrease or delete this issue.

The End