Write FULL R markdown code with comments to solve this (use ggplot2 for plotting):

load("C:/Users/kylek/OneDrive/Desktop/Stats 2/CroqPain_new.rda")
load("C:/Users/kylek/OneDrive/Desktop/Stats 2/CroqPainFix.rda")

str(CroqPaiFix):
tibble [65 × 17] (S3: tbl_df/tbl/data.frame)
 $ STOR : int [1:65] 1 2 3 4 5 6 7 8 9 10 ...
 $ EARN : num [1:65] 28.34 -1.46 68.93 202.07 115.78 ...
 $ K    : num [1:65] 861 630 1074 882 931 ...
 $ SIZE : int [1:65] 129 91 140 184 144 160 94 100 85 92 ...
 $ EMPL : int [1:65] 14 12 13 7 14 11 5 8 14 6 ...
 $ total: int [1:65] 8580 8460 19250 20920 11660 25780 19000 18500 14210 17440 ...
 $ P15  : int [1:65] 980 1290 2940 3570 1700 4640 3600 3450 1930 3520 ...
 $ P25  : int [1:65] 1280 720 2490 4930 1140 3150 2330 2560 4280 1780 ...
 $ P35  : int [1:65] 560 1200 3710 4420 2200 5720 4750 3630 1740 4350 ...
 $ P45  : int [1:65] 1000 1490 4030 4300 2140 5330 4970 3520 2060 4020 ...
 $ P55  : int [1:65] 3100 3100 5270 2960 2630 5920 3030 4800 2960 3470 ...
 $ INC  : num [1:65] 27.6 28.3 30.2 27.6 33.9 32.5 33.1 29.7 28.4 28.3 ...
 $ COMP : int [1:65] 8 2 5 2 1 3 0 3 4 8 ...
 $ NCOMP: int [1:65] 1 2 4 1 3 9 11 3 12 1 ...
 $ NREST: int [1:65] 45 27 5 7 25 8 89 14 43 76 ...
 $ PRICE: num [1:65] 16.1 11.4 21.7 11.8 16.6 22.1 24.3 16.4 12.9 13 ...
 $ CLI  : int [1:65] 129 116 142 138 126 137 134 132 129 117 ...
 - attr(*, "description")= chr "## Croq'Pain\n\nData on store earnings and other characteristics for the Croq'Pain case. There are total of 60 "| __truncated__

str(CroqPain_new):
'data.frame':	10 obs. of  24 variables:
 $ STOR       : chr  "Calais" "Montchanin" "Aubusson" "Toulouse" ...
 $ K          : num  660 733 1050 836 784 ...
 $ SIZE       : int  54 120 135 245 96 197 93 169 149 150
 $ EMPL       : Factor w/ 0 levels: NA NA NA NA NA NA NA NA NA NA
 $ total      : int  6710 11040 11910 11350 3500 12720 16660 9410 19020 12650
 $ P15        : int  600 1300 2210 3400 260 1650 2570 780 2500 1650
 $ P25        : int  2570 1400 1850 3000 700 1960 2940 1940 2680 1320
 $ P35        : int  430 2110 2330 2570 500 2300 2820 880 4600 1000
 $ P45        : int  690 1090 2240 1200 1200 1780 2720 1080 4567 3400
 $ P55        : int  1440 2680 2170 1350 2000 4390 4450 3450 3000 2370
 $ INC        : num  38.4 31.3 29 37 30 23 25.2 30.1 28.6 34.9
 $ COMP       : int  4 7 1 5 12 1 2 4 4 3
 $ NCOMP      : int  5 6 4 8 7 9 0 4 5 12
 $ NREST      : int  18 21 13 62 38 41 5 11 26 54
 $ PRICE      : num  21.7 12.5 21.7 12.5 18 12 33.4 9 13.4 15.4
 $ CLI        : int  131 115 135 136 130 136 133 126 128 128
 $ P15_total  : num  0.0894 0.1178 0.1856 0.2996 0.0743 ...
 $ P25_total  : num  0.383 0.127 0.155 0.264 0.2 ...
 $ P35_total  : num  0.0641 0.1911 0.1956 0.2264 0.1429 ...
 $ P45_total  : num  0.1028 0.0987 0.1881 0.1057 0.3429 ...
 $ P55_total  : num  0.215 0.243 0.182 0.119 0.571 ...
 $ COMP_total : num  0.000596 0.000634 0.000084 0.000441 0.003429 ...
 $ NCOMP_total: num  0.000745 0.000543 0.000336 0.000705 0.002 ...
 $ NREST_total: num  0.00268 0.0019 0.00109 0.00546 0.01086 ...
 - attr(*, "description")= chr "## Croq'Pain\n\nData for forecasting the earnings potential of stores based on various characteristics for the "| __truncated__

1. Visualization:
A. In linear regression, data distribution and relationship are critical. In particular, histogram is to examine if the observations are skewed and scatter plot is to examine if the relationship is linear. Examine histograms and scatter plots for the variables of your interests. If there are some concerns, try different wrangling to mitigate the concerns.
B. Look at correlations between variables and try to identify sources of concern. In R, you can use cor function. Pay particular attention to the correlation for total and P15 through P55. Do these correlations make sense to you?
C. Create new variables by dividing EARN, P15, P25, P35, P45, P55, COMP, NCOMP, and NREST by total. These new variables are per capita. Examine correlations with the transformed. Do these correlations make sense to you?
D. If you have more ideas for a better model, please feel free to create new variables. Examine them visually before using them.

2-1. Building Models (Part a):
Consider all observations in CroqPainFix.
Michel's Model:
SUMMARY OUTPUT

Regression Statistics
Multiple R                0.931
R Square                  0.867
Adjusted R Square         0.826
Standard Error            38.126
Observations              60

ANOVA
               dof         SS             MS               F           Significance F
Regression     14    426,750.607     30,482.186     20.970     0.000
Residual       45     65,411.117      1,453.580
Total          59    492,161.724

Coefficients   Standard Error   t Stat   P-value   Lower 95%   Upper 95%
Intercept     -364.267            98.345     -3.704    0.001     -562.345     -166.190
SIZE           0.771               0.099       7.803    0.000      0.572          0.970
EMPL          -0.866              1.466       -0.591    0.558     -3.818          2.086
total          -0.010              0.013       -0.805    0.425     -0.036         0.015
P15             0.057               0.028       2.050     0.046     0.001           0.113
P25             0.013               0.013       0.978     0.333     -0.014         0.040
P35             0.014               0.022       0.658     0.514     -0.030         0.059
P45             0.001               0.033       0.032     0.975     -0.065         0.067
P55             0.010               0.014       0.727     0.471     -0.018         0.039
INC             8.763               1.644       5.331     0.000     5.453          12.074
COMP        -2.681               2.320       -1.156     0.254     -7.354          1.992
NCOMP      -0.347               1.561       -0.222     0.825     -3.490          2.797
NREST         1.451               0.245       5.920     0.000     0.958          1.945
PRICE        -3.173               0.966       -3.283     0.002     -5.119        -1.226
CLI              0.402               0.700       0.574     0.569     -1.008         1.812
Michel’s first model is shown in Table 6.27 on page 305 with some concerns. Try to improve the model that does not violate any of the basic assumptions of regression but has good predictive power. In short, you should carefully choose the explanatory variables. What are the explanatory variables of your choice?
When you run regressions, be sure to check multicollinearity.
If you want, you can try different variable selection algorithms. However, be critical and make a decision about the final model to recommend for Croq’Pain.

2-2. Validation by Testing (Part b):
In 2-1, you build a model using all observations in CroqPainFix. Michel wants to validate its usefulness (or accuracy) with existing data. Split CroqPainFix into the following two data sets.
CroqPainFix_50: The 50 stores opened up prior to 1994, i.e., STOR<=50.
CroqPainFix_10: The 10 stores opened in the first half of 1994, i.e., STOR>50.
Using CroqPainFix_50, re-estimate your model. That is, keep your explanatory variables from 2-1 and re-estimate their coefficients with the data set of 50 stores.
With this newly estimated model, predict the performances of the 10 stores in CroqPainFix_10. Using Croq’Pain’s performance ratio target of 26%, which of the ten stores would you have opened in 1994 according to your model?

3. Prediction (Part c):
As you validated the model (i.e., a selection of explanatory variables), let’s use the most complete estimates using CroqPainFix. With this complete model, you need to recommend which new locations Croq’Pain should open its stores among 10 locations in Table 6.28 or CroqPain_new.rda. Which locations would you recommend?