Read data from SPSS

library(foreign)
DataSPSS <- read.spss("Fs36mix.sav", to.data.frame=T, use.value.labels=FALSE)
#names(DataSPSS)
#summary(DataSPSS)
# get column names
#colnames(DataSPSS)
# Rename variable to Uppercase from col 17:49
#names(DataSPSS)[90:114] <- toupper(names(DataSPSS)[90:114])
#fix(DataSPSS)
#str(DataSPSS)
#levels(DataSPSS$Timept_gr)

Xóa dữ liệu NA

DataSPSS <- na.omit(DataSPSS)

Biến đổi thành biến Factor

# Etiology to Factor Etiology.F
DataSPSS$Etiology.F[DataSPSS$Timept_gr==1]<-"Glomerulonephritis"
DataSPSS$Etiology.F[DataSPSS$Timept_gr==2]<-"Tang huyet ap"
DataSPSS$Etiology.F[DataSPSS$Timept_gr==3]<-"Dai thao duong"
DataSPSS$Etiology.F[DataSPSS$Timept_gr==4]<-"Khac"
DataSPSS$Etiology.F<-as.factor(DataSPSS$Etiology.F)

# Group to Factor GroupST
DataSPSS$GroupST[DataSPSS$Group=="10"]<-"Suy than co loc mau"
DataSPSS$GroupST[DataSPSS$Group=="21"]<-"Sau ghep"
DataSPSS$GroupST[DataSPSS$Group=="10"]<-"Sau ghep 3 thang"
DataSPSS$GroupST<-as.factor(DataSPSS$GroupST)

# Male to Factor Gender
DataSPSS$Gender[DataSPSS$Male==1]<-"Nam"
DataSPSS$Gender[DataSPSS$Male==2]<-"Nu"
DataSPSS$Gender<-as.factor(DataSPSS$Gender)

# Timept_gr to Factor GroupTimePt
DataSPSS$GroupTimePt[DataSPSS$Timept_gr==1]<-"0 - 3 thang"
DataSPSS$GroupTimePt[DataSPSS$Timept_gr==2]<-"3 - 12 thang"
DataSPSS$GroupTimePt[DataSPSS$Timept_gr==3]<-"1 - 5 nam"
DataSPSS$GroupTimePt[DataSPSS$Timept_gr==4]<-"> 5 nam"
DataSPSS$GroupTimePt<-as.factor(DataSPSS$GroupTimePt)

Lấy các trường dữ liệu cần thiết

# Get column by name
Data_New <-
  DataSPSS[, c(
    90:113,
    55,
    which(
        colnames(DataSPSS) == "c2score" |
        colnames(DataSPSS) == "Male" |
        colnames(DataSPSS) == "Group" |
        colnames(DataSPSS) == "Etiology.F" |
        colnames(DataSPSS) == "GroupST" |
        colnames(DataSPSS) == "Gender" |
        colnames(DataSPSS) == "GroupTimePt"
    )
  )]
names(Data_New)
##  [1] "phy_function" "phy_health"   "emotional"    "fatigue"     
##  [5] "wellbeing"    "social_fun"   "pain"         "general"     
##  [9] "PostPT"       "age"          "BMI"          "Weight"      
## [13] "Height"       "Ure"          "Cre"          "Chol"        
## [17] "trig"         "Alb"          "protein"      "Hb"          
## [21] "RCB"          "Canxi"        "PCS"          "MCS"         
## [25] "c2score"      "Male"         "Group"        "c2score.1"   
## [29] "Etiology.F"   "GroupST"      "Gender"       "GroupTimePt"
nameCol <- c("c2score", "phy_function", "phy_health" , "emotional" , "fatigue" , "wellbeing" , "social_fun" , "pain" , "general" , "PostPT" , "age" , "BMI" , "Weight" , "Height" , "Ure" , "Cre" , "Chol" , "trig" , "Alb" , "protein" , "Hb" , "RCB" , "Canxi" , "PCS" , "MCS" , "Male","Gender","Group","GroupST","Etiology.F","GroupTimePt")
# Sắp xếp lại thứ tự các cột
Data_New <- Data_New[, nameCol]

Xem xét độ tương quan giữa các biến độc lập

pairs(Data_New[11:20])

Chạy hồi quy tuyến tính cho từng Outcome và các biến phụ thuộc

# names(Data_New)

for (i in 1:10) {
  outcome <- names(Data_New[i])
  variables <- names(Data_New[11:20])
  f <- as.formula(paste(outcome,
                        paste(variables, collapse = " + "),
                        sep = " ~ "))
  print(paste(i,'---',outcome, "###########"))
  
  # Exec fucntion lm()
  result = summary(assign(paste0('lm1.mod', i), lm(formula = f, data = Data_New)))
  print(result)
}
## [1] "1 --- c2score ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -44.206 -12.424   0.424  12.042  42.809 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept) -719.58607  684.25575  -1.052  0.29913   
## age           -0.72109    0.26568  -2.714  0.00968 **
## BMI           22.34996   15.86722   1.409  0.16650   
## Weight        -6.85274    5.81765  -1.178  0.24562   
## Height         4.09112    4.12757   0.991  0.32742   
## Ure            3.27113    1.62288   2.016  0.05042 . 
## Cre            0.06656    0.12401   0.537  0.59431   
## Chol           6.06705    3.04757   1.991  0.05320 . 
## trig          -7.03356    2.25303  -3.122  0.00329 **
## Alb            0.64328    1.70765   0.377  0.70834   
## protein       -0.09294    0.83240  -0.112  0.91164   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.16 on 41 degrees of freedom
## Multiple R-squared:  0.4874, Adjusted R-squared:  0.3624 
## F-statistic: 3.899 on 10 and 41 DF,  p-value: 0.0009009
## 
## [1] "2 --- phy_function ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -60.499 -10.346   3.842   9.422  27.734 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -1.956e+02  5.176e+02  -0.378   0.7075  
## age         -3.263e-01  2.010e-01  -1.624   0.1121  
## BMI          6.157e+00  1.200e+01   0.513   0.6107  
## Weight      -1.891e+00  4.401e+00  -0.430   0.6696  
## Height       1.354e+00  3.122e+00   0.433   0.6669  
## Ure          1.061e+00  1.228e+00   0.864   0.3926  
## Cre          9.857e-03  9.380e-02   0.105   0.9168  
## Chol        -1.397e+00  2.305e+00  -0.606   0.5480  
## trig        -3.359e+00  1.704e+00  -1.971   0.0555 .
## Alb          1.835e+00  1.292e+00   1.421   0.1630  
## protein     -4.532e-01  6.297e-01  -0.720   0.4758  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.52 on 41 degrees of freedom
## Multiple R-squared:  0.1982, Adjusted R-squared:  0.002589 
## F-statistic: 1.013 on 10 and 41 DF,  p-value: 0.4491
## 
## [1] "3 --- phy_health ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -71.058 -32.682   1.205  26.236  64.190 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -1020.3875  1187.0435  -0.860   0.3950  
## age            -0.1292     0.4609  -0.280   0.7806  
## BMI            24.4288    27.5264   0.887   0.3800  
## Weight         -9.0445    10.0924  -0.896   0.3754  
## Height          6.3697     7.1605   0.890   0.3789  
## Ure             2.1456     2.8154   0.762   0.4504  
## Cre            -0.2234     0.2151  -1.039   0.3050  
## Chol           12.1061     5.2869   2.290   0.0272 *
## trig           -5.0653     3.9086  -1.296   0.2022  
## Alb             1.5915     2.9624   0.537   0.5940  
## protein        -1.1388     1.4440  -0.789   0.4349  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 40.19 on 41 degrees of freedom
## Multiple R-squared:  0.1803, Adjusted R-squared:  -0.01967 
## F-statistic: 0.9016 on 10 and 41 DF,  p-value: 0.5403
## 
## [1] "4 --- emotional ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -68.482 -25.001  -6.592  31.705  71.469 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.512e+03  1.182e+03  -1.279    0.208
## age          9.027e-02  4.591e-01   0.197    0.845
## BMI          2.691e+01  2.742e+01   0.981    0.332
## Weight      -1.062e+01  1.005e+01  -1.056    0.297
## Height       9.172e+00  7.133e+00   1.286    0.206
## Ure          1.920e+00  2.804e+00   0.685    0.497
## Cre         -3.436e-01  2.143e-01  -1.604    0.116
## Chol         7.651e+00  5.266e+00   1.453    0.154
## trig        -8.588e-01  3.893e+00  -0.221    0.827
## Alb         -3.502e-01  2.951e+00  -0.119    0.906
## protein      1.220e+00  1.438e+00   0.848    0.401
## 
## Residual standard error: 40.03 on 41 degrees of freedom
## Multiple R-squared:  0.1591, Adjusted R-squared:  -0.04604 
## F-statistic: 0.7755 on 10 and 41 DF,  p-value: 0.6512
## 
## [1] "5 --- fatigue ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -58.074  -8.357   0.415  10.412  34.988 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -761.49159  559.82236  -1.360   0.1812  
## age           -0.14919    0.21737  -0.686   0.4964  
## BMI           20.62132   12.98173   1.588   0.1199  
## Weight        -6.96791    4.75970  -1.464   0.1508  
## Height         4.10147    3.37696   1.215   0.2315  
## Ure            1.74881    1.32775   1.317   0.1951  
## Cre            0.07326    0.10145   0.722   0.4743  
## Chol           0.20680    2.49336   0.083   0.9343  
## trig          -3.26282    1.84332  -1.770   0.0841 .
## Alb            2.22642    1.39711   1.594   0.1187  
## protein        0.16198    0.68103   0.238   0.8132  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.95 on 41 degrees of freedom
## Multiple R-squared:  0.269,  Adjusted R-squared:  0.09067 
## F-statistic: 1.509 on 10 and 41 DF,  p-value: 0.1713
## 
## [1] "6 --- wellbeing ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -38.536 -10.186   0.812  10.034  23.687 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -742.42055  481.68398  -1.541   0.1309  
## age            0.07090    0.18703   0.379   0.7066  
## BMI           20.65498   11.16978   1.849   0.0716 .
## Weight        -7.04388    4.09536  -1.720   0.0930 .
## Height         4.19570    2.90561   1.444   0.1563  
## Ure            1.49641    1.14243   1.310   0.1975  
## Cre            0.07114    0.08729   0.815   0.4198  
## Chol          -1.59855    2.14535  -0.745   0.4604  
## trig          -1.71757    1.58603  -1.083   0.2852  
## Alb            2.01324    1.20211   1.675   0.1016  
## protein       -0.06206    0.58597  -0.106   0.9162  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.31 on 41 degrees of freedom
## Multiple R-squared:  0.2775, Adjusted R-squared:  0.1013 
## F-statistic: 1.575 on 10 and 41 DF,  p-value: 0.1489
## 
## [1] "7 --- social_fun ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -54.107  -9.627   0.969  10.044  38.797 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -960.19002  575.13544  -1.670   0.1026  
## age           -0.03303    0.22331  -0.148   0.8831  
## BMI           26.92374   13.33682   2.019   0.0501 .
## Weight        -9.30569    4.88990  -1.903   0.0641 .
## Height         5.80725    3.46933   1.674   0.1018  
## Ure            2.00777    1.36407   1.472   0.1487  
## Cre           -0.05526    0.10423  -0.530   0.5988  
## Chol           3.89973    2.56157   1.522   0.1356  
## trig          -3.45094    1.89374  -1.822   0.0757 .
## Alb            1.33933    1.43533   0.933   0.3562  
## protein       -0.56566    0.69966  -0.808   0.4235  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.47 on 41 degrees of freedom
## Multiple R-squared:  0.2303, Adjusted R-squared:  0.04252 
## F-statistic: 1.227 on 10 and 41 DF,  p-value: 0.3035
## 
## [1] "8 --- pain ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -65.619 -13.419  -1.326  17.206  44.074 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -1456.1539   752.0344  -1.936   0.0597 .
## age            -0.1971     0.2920  -0.675   0.5034  
## BMI            35.8017    17.4389   2.053   0.0465 *
## Weight        -12.4480     6.3939  -1.947   0.0584 .
## Height          8.4089     4.5364   1.854   0.0710 .
## Ure             3.0093     1.7836   1.687   0.0992 .
## Cre            -0.1680     0.1363  -1.233   0.2247  
## Chol            3.0177     3.3494   0.901   0.3729  
## trig           -4.3158     2.4762  -1.743   0.0888 .
## Alb             2.7569     1.8768   1.469   0.1495  
## protein        -0.2663     0.9149  -0.291   0.7724  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 25.46 on 41 degrees of freedom
## Multiple R-squared:  0.2505, Adjusted R-squared:  0.06769 
## F-statistic:  1.37 on 10 and 41 DF,  p-value: 0.2281
## 
## [1] "9 --- general ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -34.957  -9.612   1.446  11.467  25.940 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  71.48251  488.24128   0.146   0.8843  
## age          -0.24797    0.18957  -1.308   0.1982  
## BMI          -0.94492   11.32183  -0.083   0.9339  
## Weight        0.76613    4.15111   0.185   0.8545  
## Height       -0.54177    2.94517  -0.184   0.8550  
## Ure           0.96087    1.15798   0.830   0.4115  
## Cre           0.02817    0.08848   0.318   0.7519  
## Chol          0.93186    2.17455   0.429   0.6705  
## trig         -3.20632    1.60762  -1.994   0.0528 .
## Alb           1.54772    1.21847   1.270   0.2112  
## protein      -0.35167    0.59395  -0.592   0.5570  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.53 on 41 degrees of freedom
## Multiple R-squared:  0.1895, Adjusted R-squared:  -0.008227 
## F-statistic: 0.9584 on 10 and 41 DF,  p-value: 0.4928
## 
## [1] "10 --- PostPT ###########"
## 
## Call:
## lm(formula = f, data = Data_New)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.84476 -0.36749  0.03496  0.26322  0.82930 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  6.271532  13.009758   0.482  0.63232   
## age         -0.007056   0.005051  -1.397  0.16996   
## BMI         -0.107337   0.301683  -0.356  0.72382   
## Weight       0.036661   0.110611   0.331  0.74200   
## Height      -0.010430   0.078477  -0.133  0.89491   
## Ure         -0.012167   0.030856  -0.394  0.69539   
## Cre          0.003048   0.002358   1.293  0.20336   
## Chol        -0.064062   0.057943  -1.106  0.27535   
## trig        -0.095034   0.042837  -2.218  0.03212 * 
## Alb         -0.093536   0.032468  -2.881  0.00628 **
## protein      0.023418   0.015826   1.480  0.14660   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4404 on 41 degrees of freedom
## Multiple R-squared:  0.3734, Adjusted R-squared:  0.2206 
## F-statistic: 2.443 on 10 and 41 DF,  p-value: 0.02165
# Tìm ra 2 hàm hồi quy
# summary(lm(c2score ~ age + trig, data = Data_New))
# summary(lm(PostPT ~ age + trig + Ure + Cre + trig + Alb, data = Data_New))

Chạy Stepwise

# names(Data_New)

for (i in 1:10) {
  outcome <- names(Data_New[i])
  variables <- names(Data_New[11:20])
  f <- as.formula(paste(outcome,
                        paste(variables, collapse = " + "),
                        sep = " ~ "))
  print(paste(i,'---',outcome, "###########"))
  
  # Exec fucntion lm()
  step(lm(formula = f, data = Data_New), direction = "backward")
  
}
## [1] "1 --- c2score ###########"
## Start:  AIC=336.47
## c2score ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1       6.7 22007 334.49
## - Alb      1      76.1 22076 334.65
## - Cre      1     154.6 22155 334.84
## - Height   1     527.2 22527 335.70
## - Weight   1     744.5 22745 336.20
## <none>                 22000 336.47
## - BMI      1    1064.6 23065 336.93
## - Chol     1    2126.6 24127 339.27
## - Ure      1    2180.0 24180 339.39
## - age      1    3952.7 25953 343.06
## - trig     1    5229.4 27230 345.56
## 
## Step:  AIC=334.49
## c2score ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Alb     1      71.4 22078 332.66
## - Cre     1     178.4 22185 332.91
## - Height  1     541.8 22549 333.75
## - Weight  1     750.4 22757 334.23
## <none>                22007 334.49
## - BMI     1    1074.0 23081 334.97
## - Chol    1    2120.4 24127 337.27
## - Ure     1    2178.0 24185 337.40
## - age     1    4135.5 26142 341.44
## - trig    1    5338.2 27345 343.78
## 
## Step:  AIC=332.66
## c2score ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Cre     1     287.3 22365 331.33
## - Height  1     565.3 22643 331.97
## - Weight  1     778.8 22857 332.46
## <none>                22078 332.66
## - BMI     1    1115.5 23194 333.22
## - Chol    1    2084.7 24163 335.35
## - Ure     1    2173.2 24251 335.54
## - age     1    4064.9 26143 339.44
## - trig    1    5289.7 27368 341.83
## 
## Step:  AIC=331.33
## c2score ~ age + BMI + Weight + Height + Ure + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## <none>                22365 331.33
## - Height  1     958.7 23324 331.51
## - Weight  1    1171.5 23537 331.98
## - BMI     1    1543.6 23909 332.80
## - Chol    1    2244.9 24610 334.30
## - Ure     1    3358.0 25723 336.60
## - age     1    4080.6 26446 338.04
## - trig    1    5023.0 27388 339.86
## [1] "2 --- phy_function ###########"
## Start:  AIC=307.44
## phy_function ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Cre      1      3.39 12592 305.46
## - Weight   1     56.70 12646 305.68
## - Height   1     57.70 12647 305.68
## - BMI      1     80.79 12670 305.78
## - Chol     1    112.68 12702 305.91
## - protein  1    159.04 12748 306.10
## - Ure      1    229.17 12818 306.38
## <none>                 12589 307.44
## - Alb      1    619.58 13208 307.94
## - age      1    809.41 13398 308.69
## - trig     1   1192.45 13781 310.15
## 
## Step:  AIC=305.46
## phy_function ~ age + BMI + Weight + Height + Ure + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Weight   1     67.42 12660 303.74
## - Height   1     70.04 12662 303.75
## - BMI      1     92.21 12684 303.84
## - Chol     1    109.76 12702 303.91
## - protein  1    178.70 12771 304.19
## - Ure      1    328.12 12920 304.80
## <none>                 12592 305.46
## - Alb      1    764.40 13357 306.52
## - age      1    830.18 13422 306.78
## - trig     1   1191.59 13784 308.16
## 
## Step:  AIC=303.74
## phy_function ~ age + BMI + Height + Ure + Chol + trig + Alb + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - Height   1      2.63 12662 301.75
## - Chol     1    128.39 12788 302.26
## - protein  1    201.73 12861 302.56
## - Ure      1    291.51 12951 302.92
## - BMI      1    336.36 12996 303.10
## <none>                 12660 303.74
## - Alb      1    871.70 13531 305.20
## - age      1   1000.16 13660 305.69
## - trig     1   1152.08 13812 306.27
## 
## Step:  AIC=301.75
## phy_function ~ age + BMI + Ure + Chol + trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Chol     1    125.77 12788 300.26
## - protein  1    249.04 12911 300.76
## - Ure      1    304.00 12966 300.98
## - BMI      1    389.64 13052 301.32
## <none>                 12662 301.75
## - Alb      1    934.45 13597 303.45
## - age      1   1029.83 13692 303.81
## - trig     1   1151.09 13813 304.27
## 
## Step:  AIC=300.26
## phy_function ~ age + BMI + Ure + trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1    238.71 13027 299.22
## - Ure      1    328.74 13117 299.58
## - BMI      1    375.37 13164 299.77
## <none>                 12788 300.26
## - age      1    906.20 13694 301.82
## - Alb      1    943.44 13732 301.96
## - trig     1   1198.16 13986 302.92
## 
## Step:  AIC=299.22
## phy_function ~ age + BMI + Ure + trig + Alb
## 
##        Df Sum of Sq   RSS    AIC
## - Ure   1    350.71 13378 298.61
## - BMI   1    482.00 13509 299.11
## <none>              13027 299.22
## - Alb   1    733.65 13760 300.07
## - age   1    765.57 13792 300.19
## - trig  1    999.33 14026 301.07
## 
## Step:  AIC=298.6
## phy_function ~ age + BMI + trig + Alb
## 
##        Df Sum of Sq   RSS    AIC
## - BMI   1    297.79 13675 297.75
## <none>              13378 298.61
## - Alb   1    532.88 13910 298.64
## - age   1    744.71 14122 299.42
## - trig  1    818.21 14196 299.69
## 
## Step:  AIC=297.75
## phy_function ~ age + trig + Alb
## 
##        Df Sum of Sq   RSS    AIC
## <none>              13675 297.75
## - Alb   1    663.24 14339 298.21
## - age   1    669.84 14345 298.24
## - trig  1    850.30 14526 298.89
## [1] "3 --- phy_health ###########"
## Start:  AIC=393.77
## phy_health ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - age      1     127.0 66336 391.87
## - Alb      1     466.1 66676 392.13
## - Ure      1     937.9 67147 392.50
## - protein  1    1004.3 67214 392.55
## - BMI      1    1271.9 67481 392.75
## - Height   1    1277.9 67487 392.76
## - Weight   1    1296.9 67506 392.77
## - Cre      1    1742.2 67952 393.12
## <none>                 66209 393.77
## - trig     1    2712.1 68922 393.85
## - Chol     1    8467.2 74677 398.02
## 
## Step:  AIC=391.87
## phy_health ~ BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Alb      1     379.1 66716 390.16
## - protein  1     888.6 67225 390.56
## - Ure      1     919.1 67256 390.58
## - BMI      1    1493.5 67830 391.02
## - Weight   1    1526.9 67863 391.05
## - Height   1    1527.8 67864 391.05
## - Cre      1    1662.0 67998 391.15
## <none>                 66336 391.87
## - trig     1    2813.8 69150 392.03
## - Chol     1    9821.2 76158 397.04
## 
## Step:  AIC=390.16
## phy_health ~ BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1     575.8 67291 388.61
## - Ure      1     625.9 67342 388.65
## - Cre      1    1306.9 68022 389.17
## - BMI      1    1545.0 68261 389.35
## - Weight   1    1555.9 68271 389.36
## - Height   1    1589.3 68305 389.39
## - trig     1    2574.9 69290 390.13
## <none>                 66716 390.16
## - Chol     1    9471.7 76187 395.06
## 
## Step:  AIC=388.61
## phy_health ~ BMI + Weight + Height + Ure + Cre + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Ure     1     695.2 67986 387.14
## - Cre     1    1196.7 68488 387.52
## - BMI     1    1504.3 68796 387.76
## - Weight  1    1507.4 68799 387.76
## - Height  1    1632.1 68923 387.85
## - trig    1    2251.2 69543 388.32
## <none>                67291 388.61
## - Chol    1    9195.8 76487 393.27
## 
## Step:  AIC=387.14
## phy_health ~ BMI + Weight + Height + Cre + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Cre     1     693.5 68680 385.67
## - BMI     1    1054.6 69041 385.94
## - Weight  1    1073.8 69060 385.96
## - Height  1    1192.8 69179 386.05
## - trig    1    2094.2 70081 386.72
## <none>                67986 387.14
## - Chol    1    8765.1 76752 391.45
## 
## Step:  AIC=385.67
## phy_health ~ BMI + Weight + Height + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Weight  1     777.3 69457 384.26
## - BMI     1     799.2 69479 384.27
## - Height  1     827.8 69508 384.29
## <none>                68680 385.67
## - trig    1    2780.2 71460 385.73
## - Chol    1    8500.3 77180 389.74
## 
## Step:  AIC=384.26
## phy_health ~ BMI + Height + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - BMI     1      38.1 69495 382.28
## - Height  1      56.2 69514 382.30
## - trig    1    2577.3 72035 384.15
## <none>                69457 384.26
## - Chol    1    8353.6 77811 388.16
## 
## Step:  AIC=382.28
## phy_health ~ Height + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Height  1      98.6 69594 380.36
## - trig    1    2637.7 72133 382.22
## <none>                69495 382.28
## - Chol    1    8326.2 77822 386.17
## 
## Step:  AIC=380.36
## phy_health ~ Chol + trig
## 
##        Df Sum of Sq   RSS    AIC
## - trig  1    2539.1 72133 380.22
## <none>              69594 380.36
## - Chol  1    8870.3 78464 384.60
## 
## Step:  AIC=380.22
## phy_health ~ Chol
## 
##        Df Sum of Sq   RSS    AIC
## <none>              72133 380.22
## - Chol  1    8636.1 80769 384.10
## [1] "4 --- emotional ###########"
## Start:  AIC=393.36
## emotional ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Alb      1      22.6 65716 391.38
## - age      1      62.0 65755 391.41
## - trig     1      78.0 65771 391.42
## - Ure      1     751.4 66445 391.95
## - protein  1    1152.3 66846 392.26
## - BMI      1    1543.0 67236 392.57
## - Weight   1    1786.7 67480 392.75
## <none>                 65693 393.36
## - Height   1    2649.4 68343 393.41
## - Chol     1    3382.2 69076 393.97
## - Cre      1    4120.7 69814 394.52
## 
## Step:  AIC=391.38
## emotional ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + protein
## 
##           Df Sum of Sq   RSS    AIC
## - age      1      48.2 65764 389.41
## - trig     1      90.1 65806 389.45
## - Ure      1     966.6 66683 390.14
## - protein  1    1257.5 66973 390.36
## - BMI      1    1523.3 67239 390.57
## - Weight   1    1768.1 67484 390.76
## <none>                 65716 391.38
## - Height   1    2626.9 68343 391.41
## - Chol     1    3434.0 69150 392.03
## - Cre      1    5084.0 70800 393.25
## 
## Step:  AIC=389.41
## emotional ~ BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - trig     1      77.5 65842 387.48
## - Ure      1     944.0 66708 388.16
## - protein  1    1210.2 66974 388.36
## - BMI      1    1475.2 67239 388.57
## - Weight   1    1721.2 67485 388.76
## <none>                 65764 389.41
## - Height   1    2590.4 68355 389.42
## - Chol     1    3516.5 69281 390.12
## - Cre      1    5104.7 70869 391.30
## 
## Step:  AIC=387.48
## emotional ~ BMI + Weight + Height + Ure + Cre + Chol + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Ure      1     916.0 66758 386.19
## - protein  1    1349.3 67191 386.53
## - BMI      1    1445.0 67287 386.60
## - Weight   1    1690.0 67532 386.79
## - Height   1    2545.2 68387 387.45
## <none>                 65842 387.48
## - Chol     1    3518.1 69360 388.18
## - Cre      1    5441.7 71283 389.61
## 
## Step:  AIC=386.19
## emotional ~ BMI + Weight + Height + Cre + Chol + protein
## 
##           Df Sum of Sq   RSS    AIC
## - BMI      1     933.4 67691 384.92
## - Weight   1    1162.8 67920 385.09
## - protein  1    1213.8 67971 385.13
## - Height   1    1928.5 68686 385.68
## <none>                 66758 386.19
## - Chol     1    3193.4 69951 386.62
## - Cre      1    4526.0 71284 387.61
## 
## Step:  AIC=384.92
## emotional ~ Weight + Height + Cre + Chol + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1    1289.7 68981 383.90
## - Weight   1    1977.5 69669 384.41
## <none>                 67691 384.92
## - Chol     1    3043.9 70735 385.20
## - Height   1    3853.0 71544 385.79
## - Cre      1    3920.0 71611 385.84
## 
## Step:  AIC=383.9
## emotional ~ Weight + Height + Cre + Chol
## 
##          Df Sum of Sq   RSS    AIC
## - Weight  1    2136.0 71117 383.48
## <none>                68981 383.90
## - Height  1    3097.9 72079 384.18
## - Chol    1    3372.0 72353 384.38
## - Cre     1    4608.3 73589 385.26
## 
## Step:  AIC=383.48
## emotional ~ Height + Cre + Chol
## 
##          Df Sum of Sq   RSS    AIC
## - Height  1    1096.9 72214 382.28
## <none>                71117 383.48
## - Cre     1    2863.3 73980 383.54
## - Chol    1    3399.9 74517 383.91
## 
## Step:  AIC=382.28
## emotional ~ Cre + Chol
## 
##        Df Sum of Sq   RSS    AIC
## - Cre   1    2303.3 74517 381.91
## <none>              72214 382.28
## - Chol  1    4108.6 76322 383.16
## 
## Step:  AIC=381.91
## emotional ~ Chol
## 
##        Df Sum of Sq   RSS    AIC
## <none>              74517 381.91
## - Chol  1    3602.7 78120 382.37
## [1] "5 --- fatigue ###########"
## Start:  AIC=315.6
## fatigue ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Chol     1      2.47 14729 313.61
## - protein  1     20.32 14746 313.67
## - age      1    169.20 14895 314.19
## - Cre      1    187.30 14913 314.26
## - Height   1    529.82 15256 315.44
## <none>                 14726 315.60
## - Ure      1    623.10 15349 315.75
## - Weight   1    769.75 15496 316.25
## - BMI      1    906.30 15632 316.70
## - Alb      1    912.12 15638 316.72
## - trig     1   1125.36 15851 317.43
## 
## Step:  AIC=313.61
## fatigue ~ age + BMI + Weight + Height + Ure + Cre + trig + Alb + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1     20.94 14750 311.68
## - Cre      1    194.33 14923 312.29
## - age      1    196.09 14925 312.30
## - Height   1    527.70 15256 313.44
## <none>                 14729 313.61
## - Ure      1    623.60 15352 313.76
## - Weight   1    770.43 15499 314.26
## - BMI      1    907.89 15636 314.72
## - Alb      1    909.84 15638 314.73
## - trig     1   1122.96 15852 315.43
## 
## Step:  AIC=311.68
## fatigue ~ age + BMI + Weight + Height + Ure + Cre + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Cre     1    175.70 14925 310.30
## - age     1    252.12 15002 310.56
## - Height  1    512.85 15262 311.46
## <none>                14750 311.68
## - Ure     1    652.02 15402 311.93
## - Weight  1    761.46 15511 312.30
## - BMI     1    896.67 15646 312.75
## - trig    1   1218.75 15968 313.81
## - Alb     1   1279.94 16029 314.01
## 
## Step:  AIC=310.3
## fatigue ~ age + BMI + Weight + Height + Ure + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - age     1    293.00 15218 309.31
## <none>                14925 310.30
## - Height  1    757.08 15682 310.87
## - Weight  1   1011.71 15937 311.71
## - trig    1   1108.62 16034 312.02
## - BMI     1   1134.21 16059 312.11
## - Ure     1   1251.44 16177 312.48
## - Alb     1   1775.25 16700 314.14
## 
## Step:  AIC=309.31
## fatigue ~ BMI + Weight + Height + Ure + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## <none>                15218 309.31
## - Height  1    1019.4 16238 310.68
## - Ure     1    1246.6 16465 311.40
## - trig    1    1252.3 16470 311.42
## - Weight  1    1292.6 16511 311.55
## - BMI     1    1415.2 16633 311.93
## - Alb     1    1601.7 16820 312.51
## [1] "6 --- wellbeing ###########"
## Start:  AIC=299.96
## wellbeing ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1      2.98 10905 297.98
## - age      1     38.21 10940 298.15
## - Chol     1    147.63 11050 298.66
## - Cre      1    176.58 11079 298.80
## - trig     1    311.84 11214 299.43
## <none>                 10902 299.96
## - Ure      1    456.21 11358 300.10
## - Height   1    554.45 11457 300.54
## - Alb      1    745.82 11648 301.40
## - Weight   1    786.62 11689 301.59
## - BMI      1    909.26 11811 302.13
## 
## Step:  AIC=297.98
## wellbeing ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - age     1     46.80 10952 296.20
## - Chol    1    149.60 11055 296.69
## - Cre     1    197.02 11102 296.91
## - trig    1    311.14 11216 297.44
## <none>                10905 297.98
## - Ure     1    453.42 11358 298.10
## - Height  1    566.00 11471 298.61
## - Weight  1    791.00 11696 299.62
## - Alb     1    873.38 11778 299.99
## - BMI     1    915.49 11821 300.17
## 
## Step:  AIC=296.2
## wellbeing ~ BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Cre     1    187.47 11139 295.08
## - Chol    1    223.98 11176 295.25
## - trig    1    286.12 11238 295.54
## <none>                10952 296.20
## - Ure     1    454.27 11406 296.31
## - Height  1    523.71 11476 296.63
## - Weight  1    745.83 11698 297.63
## - BMI     1    869.75 11822 298.18
## - Alb     1    953.29 11905 298.54
## 
## Step:  AIC=295.08
## wellbeing ~ BMI + Weight + Height + Ure + Chol + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Chol    1    178.67 11318 293.91
## - trig    1    229.15 11368 294.14
## <none>                11139 295.08
## - Height  1    810.32 11950 296.74
## - Ure     1    968.08 12108 297.42
## - Weight  1   1037.84 12177 297.72
## - BMI     1   1146.88 12286 298.18
## - Alb     1   1376.32 12516 299.14
## 
## Step:  AIC=293.91
## wellbeing ~ BMI + Weight + Height + Ure + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - trig    1    234.06 11552 292.98
## <none>                11318 293.91
## - Height  1    812.24 12130 295.51
## - Ure     1   1051.23 12369 296.53
## - Weight  1   1069.03 12387 296.61
## - BMI     1   1183.57 12502 297.08
## - Alb     1   1451.28 12769 298.19
## 
## Step:  AIC=292.98
## wellbeing ~ BMI + Weight + Height + Ure + Alb
## 
##          Df Sum of Sq   RSS    AIC
## <none>                11552 292.98
## - Height  1    725.39 12278 294.14
## - Ure     1    913.75 12466 294.93
## - Weight  1    993.47 12546 295.27
## - BMI     1   1106.48 12659 295.73
## - Alb     1   1333.10 12885 296.65
## [1] "7 --- social_fun ###########"
## Start:  AIC=318.41
## social_fun ~ age + BMI + Weight + Height + Ure + Cre + Chol + 
##     trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - age      1      8.29 15551 316.43
## - Cre      1    106.56 15649 316.76
## - protein  1    247.79 15790 317.23
## - Alb      1    330.08 15873 317.50
## <none>                 15543 318.41
## - Ure      1    821.29 16364 319.08
## - Chol     1    878.62 16421 319.26
## - Height   1   1062.17 16605 319.84
## - trig     1   1258.87 16802 320.46
## - Weight   1   1372.91 16916 320.81
## - BMI      1   1544.93 17088 321.33
## 
## Step:  AIC=316.43
## social_fun ~ BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Cre      1    101.46 15652 314.77
## - protein  1    240.80 15792 315.23
## - Alb      1    323.96 15875 315.51
## <none>                 15551 316.43
## - Ure      1    817.27 16368 317.10
## - Chol     1   1005.25 16556 317.69
## - Height   1   1156.44 16708 318.16
## - trig     1   1280.74 16832 318.55
## - Weight   1   1475.78 17027 319.15
## - BMI      1   1654.29 17205 319.69
## 
## Step:  AIC=314.77
## social_fun ~ BMI + Weight + Height + Ure + Chol + trig + Alb + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1    188.78 15841 313.39
## - Alb      1    236.56 15889 313.55
## <none>                 15652 314.77
## - Ure      1    729.94 16382 315.14
## - Chol     1    934.25 16587 315.79
## - Height   1   1055.00 16708 316.16
## - trig     1   1359.54 17012 317.10
## - Weight   1   1374.38 17027 317.15
## - BMI      1   1552.92 17205 317.69
## 
## Step:  AIC=313.39
## social_fun ~ BMI + Weight + Height + Ure + Chol + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Alb     1    125.03 15966 311.80
## <none>                15841 313.39
## - Ure     1    729.20 16570 313.73
## - Chol    1    865.31 16707 314.16
## - Height  1   1160.48 17002 315.07
## - trig    1   1198.96 17040 315.19
## - Weight  1   1418.68 17260 315.85
## - BMI     1   1605.03 17446 316.41
## 
## Step:  AIC=311.8
## social_fun ~ BMI + Weight + Height + Ure + Chol + trig
## 
##          Df Sum of Sq   RSS    AIC
## <none>                15966 311.80
## - Ure     1    627.34 16594 311.81
## - Chol    1    824.98 16791 312.42
## - trig    1   1123.24 17090 313.34
## - Height  1   1291.15 17257 313.85
## - Weight  1   1548.67 17515 314.62
## - BMI     1   1747.96 17714 315.21
## [1] "8 --- pain ###########"
## Start:  AIC=346.3
## pain ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1     54.93 26629 344.40
## - age      1    295.44 26870 344.87
## - Chol     1    526.12 27100 345.32
## - Cre      1    984.97 27559 346.19
## <none>                 26574 346.30
## - Alb      1   1398.52 27973 346.96
## - Ure      1   1845.02 28419 347.79
## - trig     1   1968.94 28543 348.01
## - Height   1   2227.03 28801 348.48
## - Weight   1   2456.64 29031 348.89
## - BMI      1   2731.79 29306 349.38
## 
## Step:  AIC=344.4
## pain ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb
## 
##          Df Sum of Sq   RSS    AIC
## - age     1    250.53 26880 342.89
## - Chol    1    513.20 27142 343.40
## - Cre     1    930.16 27559 344.19
## <none>                26629 344.40
## - Alb     1   1444.15 28073 345.15
## - Ure     1   1799.57 28429 345.80
## - trig    1   1914.45 28544 346.01
## - Height  1   2306.80 28936 346.72
## - Weight  1   2485.54 29115 347.04
## - BMI     1   2770.65 29400 347.55
## 
## Step:  AIC=342.89
## pain ~ BMI + Weight + Height + Ure + Cre + Chol + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Chol    1     824.3 27704 342.46
## - Cre     1     882.0 27762 342.57
## <none>                26880 342.89
## - Alb     1    1302.1 28182 343.35
## - Ure     1    1795.7 28676 344.25
## - trig    1    2125.3 29005 344.85
## - Height  1    2730.5 29610 345.92
## - Weight  1    2924.6 29804 346.26
## - BMI     1    3220.8 30101 346.77
## 
## Step:  AIC=342.46
## pain ~ BMI + Weight + Height + Ure + Cre + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Cre     1    693.39 28398 341.75
## <none>                27704 342.46
## - Alb     1   1108.69 28813 342.50
## - Ure     1   1509.49 29214 343.22
## - trig    1   2140.62 29845 344.33
## - Height  1   2614.40 30318 345.15
## - Weight  1   2733.59 30438 345.35
## - BMI     1   3019.01 30723 345.84
## 
## Step:  AIC=341.75
## pain ~ BMI + Weight + Height + Ure + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Alb     1    701.84 29099 341.02
## - Ure     1    913.31 29311 341.39
## <none>                28398 341.75
## - Height  1   2048.45 30446 343.37
## - Weight  1   2207.77 30605 343.64
## - BMI     1   2511.21 30909 344.15
## - trig    1   2549.44 30947 344.22
## 
## Step:  AIC=341.02
## pain ~ BMI + Weight + Height + Ure + trig
## 
##          Df Sum of Sq   RSS    AIC
## - Ure     1    607.83 29707 340.09
## <none>                29099 341.02
## - trig    1   2269.00 31368 342.92
## - Height  1   2436.68 31536 343.20
## - Weight  1   2575.34 31675 343.43
## - BMI     1   2914.73 32014 343.98
## 
## Step:  AIC=340.09
## pain ~ BMI + Weight + Height + trig
## 
##          Df Sum of Sq   RSS    AIC
## <none>                29707 340.09
## - trig    1    1974.8 31682 341.44
## - Height  1    2114.3 31822 341.67
## - Weight  1    2211.7 31919 341.82
## - BMI     1    2494.4 32202 342.28
## [1] "9 --- general ###########"
## Start:  AIC=301.37
## general ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - BMI      1      1.90 11203 299.38
## - Height   1      9.24 11210 299.41
## - Weight   1      9.31 11210 299.41
## - Cre      1     27.68 11229 299.50
## - Chol     1     50.17 11251 299.60
## - protein  1     95.77 11297 299.81
## - Ure      1    188.11 11389 300.24
## <none>                 11201 301.37
## - Alb      1    440.78 11642 301.38
## - age      1    467.41 11668 301.50
## - trig     1   1086.72 12288 304.19
## 
## Step:  AIC=299.38
## general ~ age + Weight + Height + Ure + Cre + Chol + trig + Alb + 
##     protein
## 
##           Df Sum of Sq   RSS    AIC
## - Cre      1     25.85 11229 297.50
## - Chol     1     53.27 11256 297.63
## - Height   1     61.37 11264 297.66
## - protein  1     94.78 11298 297.82
## - Ure      1    210.87 11414 298.35
## - Alb      1    438.95 11642 299.38
## <none>                 11203 299.38
## - Weight   1    440.12 11643 299.38
## - age      1    474.17 11677 299.54
## - trig     1   1095.76 12299 302.23
## 
## Step:  AIC=297.5
## general ~ age + Weight + Height + Ure + Chol + trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Height   1     45.86 11275 295.71
## - Chol     1     60.31 11289 295.78
## - protein  1    127.35 11356 296.09
## - Ure      1    347.71 11576 297.08
## - Weight   1    419.50 11648 297.41
## <none>                 11229 297.50
## - age      1    521.94 11751 297.86
## - Alb      1    634.19 11863 298.36
## - trig     1   1071.61 12300 300.24
## 
## Step:  AIC=295.71
## general ~ age + Weight + Ure + Chol + trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - Chol     1     48.29 11323 293.93
## - protein  1     94.92 11370 294.15
## - Ure      1    310.12 11585 295.12
## - Weight   1    421.74 11696 295.62
## <none>                 11275 295.71
## - age      1    487.20 11762 295.91
## - Alb      1    594.08 11869 296.38
## - trig     1   1121.38 12396 298.64
## 
## Step:  AIC=293.93
## general ~ age + Weight + Ure + trig + Alb + protein
## 
##           Df Sum of Sq   RSS    AIC
## - protein  1     96.51 11419 292.38
## - Ure      1    298.75 11622 293.29
## <none>                 11323 293.93
## - Weight   1    451.20 11774 293.96
## - Alb      1    586.52 11909 294.56
## - age      1    646.39 11969 294.82
## - trig     1   1099.24 12422 296.75
## 
## Step:  AIC=292.37
## general ~ age + Weight + Ure + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Ure     1    317.65 11737 291.80
## <none>                11419 292.38
## - Alb     1    491.84 11911 292.57
## - age     1    574.96 11994 292.93
## - Weight  1    604.21 12024 293.06
## - trig    1   1004.33 12424 294.76
## 
## Step:  AIC=291.8
## general ~ age + Weight + trig + Alb
## 
##          Df Sum of Sq   RSS    AIC
## - Alb     1    330.61 12068 291.25
## - Weight  1    446.61 12184 291.74
## <none>                11737 291.80
## - age     1    568.38 12305 292.26
## - trig    1    822.84 12560 293.32
## 
## Step:  AIC=291.25
## general ~ age + Weight + trig
## 
##          Df Sum of Sq   RSS    AIC
## <none>                12068 291.25
## - age     1    477.20 12545 291.26
## - Weight  1    570.14 12638 291.65
## - trig    1    740.55 12808 292.34
## [1] "10 --- PostPT ###########"
## Start:  AIC=-75.64
## PostPT ~ age + BMI + Weight + Height + Ure + Cre + Chol + trig + 
##     Alb + protein
## 
##           Df Sum of Sq    RSS     AIC
## - Height   1   0.00343 7.9563 -77.618
## - Weight   1   0.02131 7.9742 -77.502
## - BMI      1   0.02455 7.9775 -77.480
## - Ure      1   0.03016 7.9831 -77.444
## - Chol     1   0.23710 8.1900 -76.113
## <none>                 7.9529 -75.641
## - Cre      1   0.32414 8.2770 -75.563
## - age      1   0.37850 8.3314 -75.223
## - protein  1   0.42470 8.3776 -74.935
## - trig     1   0.95468 8.9076 -71.746
## - Alb      1   1.60990 9.5628 -68.055
## 
## Step:  AIC=-77.62
## PostPT ~ age + BMI + Weight + Ure + Cre + Chol + trig + Alb + 
##     protein
## 
##           Df Sum of Sq    RSS     AIC
## - Ure      1   0.02711 7.9834 -79.442
## - BMI      1   0.21202 8.1683 -78.251
## - Chol     1   0.23384 8.1902 -78.112
## - Weight   1   0.24846 8.2048 -78.019
## <none>                 7.9563 -77.618
## - Cre      1   0.32948 8.2858 -77.508
## - age      1   0.38079 8.3371 -77.187
## - protein  1   0.43480 8.3911 -76.852
## - trig     1   0.96733 8.9237 -73.652
## - Alb      1   1.63550 9.5918 -69.897
## 
## Step:  AIC=-79.44
## PostPT ~ age + BMI + Weight + Cre + Chol + trig + Alb + protein
## 
##           Df Sum of Sq    RSS     AIC
## - BMI      1   0.19631 8.1797 -80.178
## - Chol     1   0.21894 8.2024 -80.035
## - Weight   1   0.23533 8.2188 -79.931
## - Cre      1   0.31131 8.2947 -79.452
## <none>                 7.9834 -79.442
## - age      1   0.40021 8.3836 -78.898
## - protein  1   0.41455 8.3980 -78.809
## - trig     1   1.00482 8.9883 -75.277
## - Alb      1   1.73409 9.7175 -71.220
## 
## Step:  AIC=-80.18
## PostPT ~ age + Weight + Cre + Chol + trig + Alb + protein
## 
##           Df Sum of Sq    RSS     AIC
## - Weight   1   0.04009 8.2198 -81.924
## - Chol     1   0.17680 8.3565 -81.066
## <none>                 8.1797 -80.178
## - protein  1   0.32709 8.5068 -80.139
## - age      1   0.43019 8.6099 -79.513
## - Cre      1   0.51178 8.6915 -79.023
## - trig     1   0.95832 9.1381 -76.417
## - Alb      1   1.75305 9.9328 -72.081
## 
## Step:  AIC=-81.92
## PostPT ~ age + Cre + Chol + trig + Alb + protein
## 
##           Df Sum of Sq    RSS     AIC
## - Chol     1   0.15911 8.3789 -82.927
## - protein  1   0.28731 8.5071 -82.138
## <none>                 8.2198 -81.924
## - age      1   0.43565 8.6555 -81.239
## - Cre      1   0.47266 8.6925 -81.017
## - trig     1   0.94690 9.1667 -78.254
## - Alb      1   1.75336 9.9732 -73.870
## 
## Step:  AIC=-82.93
## PostPT ~ age + Cre + trig + Alb + protein
## 
##           Df Sum of Sq     RSS     AIC
## - protein  1   0.29865  8.6776 -83.106
## - age      1   0.32328  8.7022 -82.959
## <none>                  8.3789 -82.927
## - Cre      1   0.45045  8.8294 -82.204
## - trig     1   0.97415  9.3531 -79.208
## - Alb      1   1.75335 10.1323 -75.047
## 
## Step:  AIC=-83.11
## PostPT ~ age + Cre + trig + Alb
## 
##        Df Sum of Sq     RSS     AIC
## - Cre   1   0.31949  8.9971 -83.226
## <none>               8.6776 -83.106
## - age   1   0.51594  9.1935 -82.103
## - trig  1   1.28243  9.9600 -77.939
## - Alb   1   1.45788 10.1355 -77.031
## 
## Step:  AIC=-83.23
## PostPT ~ age + trig + Alb
## 
##        Df Sum of Sq     RSS     AIC
## <none>               8.9971 -83.226
## - age   1   0.66688  9.6640 -81.508
## - trig  1   1.03706 10.0341 -79.553
## - Alb   1   1.27007 10.2672 -78.359

Tìm ra Best Subset Regression sử dụng olsrr

library(olsrr)
## 
## Attaching package: 'olsrr'
## The following object is masked from 'package:datasets':
## 
##     rivers
# names(Data_New)

for (i in 1:10) {
  outcome <- names(Data_New[i])
  variables <- names(Data_New[11:20])
  f <- as.formula(paste(outcome,
                        paste(variables, collapse = " + "),
                        sep = " ~ "))
   print(paste(i,'---',outcome, "###########"))
  
  # Exec fucntion lm()
  print(ols_step_best_subset(lm(formula = f, data = Data_New)))
}
## [1] "1 --- c2score ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         age                                                 
##      2         age trig                                            
##      3         age BMI trig                                        
##      4         age BMI Ure trig                                    
##      5         age BMI Ure Chol trig                               
##      6         age BMI Weight Ure Chol trig                        
##      7         age BMI Weight Height Ure Chol trig                 
##      8         age BMI Weight Height Ure Cre Chol trig             
##      9         age BMI Weight Height Ure Cre Chol trig Alb         
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                      
## -------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                               
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE         HSP       APC  
## -------------------------------------------------------------------------------------------------------------------------------------
##   1        0.1909      0.1747      0.1252    16.7215    491.7817    343.3486    497.6354    722.3791    721.2887    14.1750    0.8739 
##   2        0.2831      0.2538      0.2208    11.3435    487.4879    339.3418    495.2929    666.6986    664.1827    13.0824    0.8047 
##   3        0.3493      0.3087      0.2172     8.0469    484.4484    336.8716    494.2046    630.8681    626.5830    12.3793    0.7591 
##   4        0.4044      0.3537      0.2826     5.6400    481.8478    335.1766    493.5552    602.5573    596.1906    11.8238    0.7223 
##   5        0.4458      0.3856      0.3003     4.3289    480.1019    334.5490    493.7607    585.5977    576.7585    11.4910    0.6988 
##   6        0.4566      0.3841      0.2793     5.4675    481.0815    336.1830    496.6915    600.3190    588.0860    11.7798    0.7125 
##   7        0.4789      0.3960      0.3036     5.6809    480.8991    337.1680    498.4603    602.4190    586.5060    11.8211    0.7106 
##   8        0.4856      0.3899      0.2372     7.1455    482.2268    339.2665    501.7392    622.9985    602.3103    12.2249    0.7297 
##   9        0.4873      0.3774      0.2014     9.0125    484.0584    341.7034    505.5220    651.2763    624.7337    12.7798    0.7569 
##  10        0.4874      0.3624      0.1631    11.0000    486.0426    344.2314    509.4575    683.6323    650.0956    13.4147    0.7876 
## -------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "2 --- phy_function ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         trig                                                
##      2         age trig                                            
##      3         age trig Alb                                        
##      4         age trig Alb protein                                
##      5         age BMI Ure trig Alb                                
##      6         age BMI Ure trig Alb protein                        
##      7         age BMI Ure Chol trig Alb protein                   
##      8         age BMI Ure Cre Chol trig Alb protein               
##      9         age BMI Weight Height Ure Chol trig Alb protein     
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                     
## ------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                              
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE        HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0537      0.0348     -0.0204     0.3878    447.6297    300.3475    453.4834    309.0407    308.5742    6.0642    1.0220 
##   2        0.0867      0.0494     -0.1487     0.6984    447.7817    300.8675    455.5867    310.6780    309.5057    6.0963    1.0251 
##   3        0.1290      0.0745     -0.0692     0.5383    447.3190    301.0335    457.0752    308.9162    306.8179    6.0618    1.0162 
##   4        0.1507      0.0785     -0.0722     1.4242    448.0017    302.3290    459.7092    314.2842    310.9634    6.1671    1.0299 
##   5        0.1703      0.0801        -0.1     2.4262    448.7927    303.8291    462.4514    320.7084    315.8675    6.2931    1.0462 
##   6        0.1855      0.0769     -0.1207     3.6488    449.8310    305.6174    465.4409    329.1421    322.4350    6.4586    1.0679 
##   7        0.1935      0.0652     -0.2072     5.2392    451.3171    307.7863    468.8783    341.0635    332.0542    6.6926    1.0998 
##   8        0.1945      0.0446     -0.2333     7.1882    453.2528    310.2703    472.7652    356.8631    345.0125    7.0026    1.1427 
##   9        0.1979      0.0261     -0.4102     9.0110    455.0286    312.6744    476.4923    372.6610    357.4733    7.3126    1.1840 
##  10        0.1982      0.0026     -0.4558    11.0000    457.0146    315.2035    480.4295    391.1887    371.9983    7.6762    1.2321 
## ------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "3 --- phy_health ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         Chol                                                
##      2         Chol trig                                           
##      3         Chol trig protein                                   
##      4         Cre Chol trig protein                               
##      5         Ure Cre Chol trig protein                           
##      6         Ure Cre Chol trig Alb protein                       
##      7         BMI Weight Height Ure Cre Chol trig                 
##      8         BMI Weight Height Ure Cre Chol trig protein         
##      9         BMI Weight Height Ure Cre Chol trig Alb protein     
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                       Subsets Regression Summary                                                       
## ---------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                                 
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP          FPE         HSP       APC  
## ---------------------------------------------------------------------------------------------------------------------------------------
##   1        0.1069      0.0891      0.0444    -3.3318    529.7909    382.8240    535.6446    1500.4145    1498.1498    29.4421    0.9645 
##   2        0.1384      0.1032      0.0554    -2.9041    529.9275    383.5122    537.7325    1507.9161    1502.2258    29.5893    0.9671 
##   3        0.1455      0.0921       0.027    -1.2637    531.4919    385.5624    541.2481    1558.9671    1548.3779    30.5911    0.9969 
##   4        0.1516      0.0794      -0.037     0.4327    533.1211    387.7045    544.8285    1615.1901    1598.1240    31.6943    1.0289 
##   5        0.1542      0.0623     -0.0842     2.3012    534.9598    390.0363    548.6185    1681.7509    1656.3660    33.0004    1.0664 
##   6        0.1595      0.0475     -0.1216     4.0366    536.6335    392.2697    552.2434    1747.1960    1711.5928    34.2846    1.1019 
##   7        0.1669      0.0343     -0.3163     5.6699    538.1779    394.4518    555.7390    1812.5107    1764.6331    35.5662    1.1361 
##   8        0.1740      0.0203      -0.369     7.3134    539.7310    396.6837    559.2434    1882.5735    1820.0578    36.9411    1.1718 
##   9        0.1787      0.0027      -0.417     9.0786    541.4347    399.0410    562.8984    1963.1873    1883.1782    38.5229    1.2124 
##  10        0.1803     -0.0197     -0.5332    11.0000    543.3350    401.5239    566.7500    2057.4008    1956.4717    40.3716    1.2596 
## ---------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "4 --- emotional ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         Chol                                                
##      2         Cre Chol                                            
##      3         Height Cre Chol                                     
##      4         Weight Height Cre Chol                              
##      5         Weight Height Cre Chol protein                      
##      6         BMI Weight Height Cre Chol protein                  
##      7         BMI Weight Height Ure Cre Chol protein              
##      8         BMI Weight Height Ure Cre Chol trig protein         
##      9         age BMI Weight Height Ure Cre Chol trig protein     
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                       Subsets Regression Summary                                                       
## ---------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                                 
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP          FPE         HSP       APC  
## ---------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0461      0.0270     -0.0195    -1.4931    531.4816    384.3565    537.3353    1549.9990    1547.6594    30.4151    1.0302 
##   2        0.0756      0.0379     -0.0352    -0.9306    531.8489    385.1547    539.6539    1564.6758    1558.7713    30.7031    1.0376 
##   3        0.0896      0.0327     -0.0745     0.3848    533.0530    386.7971    542.8092    1606.4794    1595.5674    31.5234    1.0621 
##   4        0.1170      0.0418     -0.0967     1.0517    533.4672    387.8897    545.1747    1625.9776    1608.7975    31.9060    1.0709 
##   5        0.1335      0.0393     -0.1349     2.2468    534.4858    389.5800    548.1445    1666.4927    1641.3381    32.7010    1.0925 
##   6        0.1454      0.0315     -0.2583     3.6642    535.7638    391.5441    551.3737    1718.2181    1683.2054    33.7160    1.1204 
##   7        0.1572      0.0231     -0.3627     5.0925    537.0453    393.5818    554.6065    1773.4630    1726.6168    34.8000    1.1493 
##   8        0.1582      0.0015     -0.4454     7.0442    538.9841    396.0767    558.4965    1855.7264    1794.1023    36.4143    1.1942 
##   9        0.1588     -0.0215     -0.5086     9.0141    540.9460    398.5900    562.4097    1944.8237    1865.5629    38.1626    1.2418 
##  10        0.1591     -0.0460     -0.6103    11.0000    542.9281    401.1170    566.3430    2041.3636    1941.2212    40.0569    1.2922 
## ---------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "5 --- fatigue ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         Alb                                                 
##      2         trig Alb                                            
##      3         Ure trig Alb                                        
##      4         age Ure trig Alb                                    
##      5         BMI Weight Cre trig Alb                             
##      6         BMI Weight Height Ure trig Alb                      
##      7         age BMI Weight Height Ure trig Alb                  
##      8         age BMI Weight Height Ure Cre trig Alb              
##      9         age BMI Weight Height Ure Cre trig Alb protein      
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                     
## ------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                              
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE        HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0658      0.0471     -0.0062     4.3966    459.9225    312.3225    465.7763    391.4563    390.8654    7.6814    1.0090 
##   2        0.1170      0.0810     -0.0226     3.5233    458.9898    311.7153    466.7948    385.4063    383.9519    7.5627    0.9911 
##   3        0.1461      0.0928      -0.007     3.8886    459.2443    312.3468    469.0006    388.5428    385.9037    7.6242    0.9962 
##   4        0.1662      0.0953      0.0211     4.7622    460.0066    313.5320    471.7141    395.8996    391.7166    7.7686    1.0112 
##   5        0.2037      0.1171      -0.122     4.6604    459.6153    313.9638    473.2740    394.9101    388.9492    7.7492    1.0040 
##   6        0.2445      0.1438     -0.0203     4.3701    458.8778    314.3868    474.4877    391.6883    383.7067    7.6860    0.9905 
##   7        0.2591      0.1412      0.0071     5.5543    459.8668    316.1928    477.4280    402.0142    391.3949    7.8886    1.0103 
##   8        0.2678      0.1316     -0.0341     7.0652    461.2511    318.3327    480.7635    416.1999    402.3789    8.1669    1.0387 
##   9        0.2688      0.1122     -0.0684     9.0069    463.1772    320.8255    484.6409    435.8828    418.1185    8.5532    1.0793 
##  10        0.2690      0.0907     -0.1427    11.0000    465.1685    323.3574    488.5834    457.6001    435.1518    8.9793    1.1233 
## ------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "6 --- wellbeing ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         Alb                                                 
##      2         Chol Alb                                            
##      3         BMI Weight Alb                                      
##      4         BMI Weight Cre Alb                                  
##      5         BMI Weight Height Ure Alb                           
##      6         BMI Weight Height Ure trig Alb                      
##      7         BMI Weight Height Ure Chol trig Alb                 
##      8         BMI Weight Height Ure Cre Chol trig Alb             
##      9         age BMI Weight Height Ure Cre Chol trig Alb         
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                     
## ------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                              
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE        HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0893      0.0711      0.0186     3.6810    443.5730    296.0280    449.4267    285.8477    285.4163    5.6091    0.9836 
##   2        0.1149      0.0787     -0.0069     4.2282    444.0903    296.7299    451.8953    289.3881    288.2960    5.6786    0.9935 
##   3        0.1361      0.0821     -0.0188     5.0241    444.8285    297.7371    454.5847    294.4695    292.4693    5.7783    1.0079 
##   4        0.1873      0.1181      0.0044     4.1182    443.6511    297.3243    455.3586    289.0592    286.0050    5.6721    0.9856 
##   5        0.2344      0.1512      0.0581     3.4444    442.5454    297.2614    456.2041    284.4027    280.1098    5.5807    0.9653 
##   6        0.2499      0.1499      0.0281     4.5642    443.4810    298.9167    459.0909    291.3058    285.3698    5.7162    0.9834 
##   7        0.2618      0.1443     -0.0327     5.8922    444.6535    300.8280    462.2147    300.0423    292.1166    5.8876    1.0067 
##   8        0.2742      0.1392     -0.1098     7.1872    445.7709    302.7890    465.2834    309.0400    298.7775    6.0642    1.0296 
##   9        0.2773      0.1224     -0.2119     9.0112    447.5483    305.1940    469.0119    322.7302    309.5774    6.3328    1.0669 
##  10        0.2775      0.1013      -0.249    11.0000    449.5340    307.7229    472.9490    338.7740    322.1549    6.6476    1.1102 
## ------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "7 --- social_fun ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         trig                                                
##      2         BMI trig                                            
##      3         BMI Chol trig                                       
##      4         BMI Weight Height trig                              
##      5         BMI Weight Height Chol trig                         
##      6         BMI Weight Height Ure Chol trig                     
##      7         BMI Weight Height Ure Chol trig Alb                 
##      8         BMI Weight Height Ure Chol trig Alb protein         
##      9         BMI Weight Height Ure Cre Chol trig Alb protein     
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                     
## ------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                              
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE        HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0465      0.0274     -0.0032     2.7878    461.1074    313.6322    466.9612    400.4787    399.8742    7.8585    1.0298 
##   2        0.0788      0.0412     -0.0139     3.0694    461.3176    314.0992    469.1225    403.0505    401.5295    7.9089    1.0340 
##   3        0.1071      0.0513     -0.0289     3.5590    461.6918    314.8518    471.4480    407.2672    404.5009    7.9917    1.0417 
##   4        0.1423      0.0693     -0.0223     3.6858    461.6022    315.3765    473.3097    408.2362    403.9227    8.0107    1.0402 
##   5        0.1782      0.0889     -0.0434     3.7722    461.3772    315.9925    475.0359    408.5201    402.3538    8.0162    1.0362 
##   6        0.2093      0.1039     -0.0363     4.1173    461.3731    316.9785    476.9831    410.9427    402.5688    8.0638    1.0367 
##   7        0.2155      0.0907     -0.0827     5.7875    462.9643    319.1855    480.5255    426.6886    415.4176    8.3728    1.0698 
##   8        0.2248      0.0806     -0.1491     7.2895    464.3409    321.3059    483.8534    441.6802    427.0130    8.6669    1.0997 
##   9        0.2299      0.0648     -0.1854     9.0219    466.0028    323.6423    487.4665    460.2230    441.4667    9.0308    1.1369 
##  10        0.2303      0.0425      -0.251    11.0000    467.9750    326.1639    491.3900    482.9764    459.2832    9.4773    1.1828 
## ------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "8 --- pain ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         trig                                                
##      2         BMI trig                                            
##      3         BMI trig Alb                                        
##      4         BMI Weight Height trig                              
##      5         BMI Weight Height Ure trig                          
##      6         BMI Weight Height Ure trig Alb                      
##      7         BMI Weight Height Ure Cre trig Alb                  
##      8         BMI Weight Height Ure Cre Chol trig Alb             
##      9         age BMI Weight Height Ure Cre Chol trig Alb         
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                      
## -------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                               
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE         HSP       APC  
## -------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0513      0.0323     -0.0422     3.8959    490.1202    342.5586    495.9739    699.6621    698.6061    13.7292    1.0246 
##   2        0.0997      0.0629     -0.0059     3.2507    489.3996    342.1587    497.2046    691.6649    689.0549    13.5723    1.0106 
##   3        0.1209      0.0659     -0.0165     4.0912    490.1608    343.2282    499.9170    704.1214    699.3387    13.8167    1.0257 
##   4        0.1621      0.0908     -0.0044     3.8335    489.6604    343.4000    501.3679    700.2419    692.8431    13.7406    1.0161 
##   5        0.1793      0.0901     -0.0158     4.8957    490.5854    344.8646    504.2441    716.3995    705.5860    14.0577    1.0348 
##   6        0.1991      0.0923       3e-04     5.8129    491.3159    346.2925    506.9258    730.8990    716.0052    14.3422    1.0501 
##   7        0.2186      0.0943     -0.0143     6.7431    492.0304    347.8321    509.5916    746.2178    726.5064    14.6428    1.0655 
##   8        0.2419      0.1008     -0.0919     7.4713    492.4597    349.3310    511.9721    758.4917    733.3040    14.8836    1.0755 
##   9        0.2489      0.0880     -0.2388     9.0848    493.9728    351.5755    515.4365    788.0769    755.9590    15.4641    1.1087 
##  10        0.2505      0.0677     -0.2831    11.0000    495.8654    354.0543    519.2803    825.7737    785.2640    16.2039    1.1517 
## -------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "9 --- general ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         trig                                                
##      2         Weight trig                                         
##      3         age Weight trig                                     
##      4         age Weight trig Alb                                 
##      5         age Weight Ure trig Alb                             
##      6         age BMI Ure trig Alb protein                        
##      7         age BMI Ure Chol trig Alb protein                   
##      8         age BMI Ure Cre Chol trig Alb protein               
##      9         age Weight Height Ure Cre Chol trig Alb protein     
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                      Subsets Regression Summary                                                     
## ------------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                              
## Model    R-Square    R-Square    R-Square     C(p)        AIC         SBIC        SBC         MSEP        FPE        HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------------
##   1        0.0564      0.0375     -0.0281    -0.2670    440.8469    293.6189    446.7006    271.2484    270.8390    5.3226    1.0191 
##   2        0.0922      0.0552     -0.0031    -0.0809    440.8323    294.0222    448.6373    271.8130    270.7873    5.3337    1.0189 
##   3        0.1268      0.0722     -0.0624     0.1723    440.8156    294.6009    450.5719    272.6000    270.7484    5.3491    1.0188 
##   4        0.1507      0.0784     -0.0435     0.9622    441.3712    295.8167    453.0786    276.6592    273.7360    5.4288    1.0300 
##   5        0.1737      0.0838     -0.0463     1.7994    441.9444    297.1841    455.6031    281.1349    276.8914    5.5166    1.0419 
##   6        0.1825      0.0735     -0.0955     3.3542    443.3876    299.2895    458.9976    290.7834    284.8580    5.7059    1.0719 
##   7        0.1872      0.0579     -0.1487     5.1146    445.0855    301.6118    462.6467    302.5450    294.5532    5.9367    1.1084 
##   8        0.1888      0.0379     -0.2057     7.0342    446.9837    304.0815    466.4961    316.3321    305.8274    6.2073    1.1508 
##   9        0.1893      0.0156     -0.2505     9.0070    448.9491    306.5973    470.4128    331.5424    318.0305    6.5057    1.1967 
##  10        0.1895     -0.0082     -0.3572    11.0000    450.9403    309.1291    474.3552    348.0604    330.9858    6.8299    1.2455 
## ------------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria 
## 
## [1] "10 --- PostPT ###########"
##                      Best Subsets Regression                      
## ------------------------------------------------------------------
## Model Index    Predictors
## ------------------------------------------------------------------
##      1         Alb                                                 
##      2         trig Alb                                            
##      3         age trig Alb                                        
##      4         age Cre trig Alb                                    
##      5         age Cre trig Alb protein                            
##      6         age Cre Chol trig Alb protein                       
##      7         age Height Cre Chol trig Alb protein                
##      8         age BMI Weight Cre Chol trig Alb protein            
##      9         age BMI Weight Ure Cre Chol trig Alb protein        
##     10         age BMI Weight Height Ure Cre Chol trig Alb protein 
## ------------------------------------------------------------------
## 
##                                                   Subsets Regression Summary                                                  
## ------------------------------------------------------------------------------------------------------------------------------
##                        Adj.        Pred                                                                                        
## Model    R-Square    R-Square    R-Square     C(p)        AIC        SBIC        SBC       MSEP      FPE       HSP       APC  
## ------------------------------------------------------------------------------------------------------------------------------
##   1        0.1461      0.1290      0.0824     7.8764    72.0264    -75.8303    77.8802    0.2254    0.2251    0.0044    0.9223 
##   2        0.2386      0.2075      0.0456     3.8211    68.0619    -79.2491    75.8669    0.2094    0.2086    0.0041    0.8546 
##   3        0.2911      0.2468      0.1413     2.3831    66.3437    -80.2864    76.1000    0.2032    0.2019    0.0040    0.8270 
##   4        0.3163      0.2581      0.1478     2.7360    66.4636    -79.5350    78.1711    0.2045    0.2024    0.0040    0.8292 
##   5        0.3398      0.2681       0.142     3.1964    66.6425    -78.5646    80.3012    0.2063    0.2032    0.0040    0.8324 
##   6        0.3524      0.2660      0.1028     4.3762    67.6455    -76.8477    83.2555    0.2116    0.2073    0.0042    0.8491 
##   7        0.3689      0.2685      0.0892     5.2933    68.2995    -75.2560    85.8607    0.2157    0.2100    0.0042    0.8606 
##   8        0.3710      0.2540      0.0437     7.1574    70.1281    -72.8384    89.6405    0.2253    0.2178    0.0044    0.8923 
##   9        0.3731      0.2388      0.0109     9.0177    71.9512    -70.4068    93.4149    0.2355    0.2259    0.0046    0.9254 
##  10        0.3734      0.2206     -0.0492    11.0000    73.9288    -67.8823    97.3437    0.2471    0.2350    0.0048    0.9628 
## ------------------------------------------------------------------------------------------------------------------------------
## AIC: Akaike Information Criteria 
##  SBIC: Sawa's Bayesian Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
##  MSEP: Estimated error of prediction, assuming multivariate normality 
##  FPE: Final Prediction Error 
##  HSP: Hocking's Sp 
##  APC: Amemiya Prediction Criteria

Tìm các biến được chọn sử dụng stepwise forward regression

Chọn các biến có có ý nghĩa

for (i in 1:10) {
  outcome <- names(Data_New[i])
  variables <- names(Data_New[11:20])
  f <- as.formula(paste(outcome,
                        paste(variables, collapse = " + "),
                        sep = " ~ "))
   print(paste("--------------------------------------------------------"))
   print(paste("BIEN - ",i,"---",outcome))
  print(paste("--------------------------------------------------------"))
  # Exec fucntion lm()
  print(ols_step_forward_p(lm(formula = f, data = Data_New)))
}
## [1] "--------------------------------------------------------"
## [1] "BIEN -  1 --- c2score"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - age 
## - trig 
## - BMI 
## - Ure 
## - Chol 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                          
## ---------------------------------------------------------------
## R                       0.668       RMSE                22.740 
## R-Squared               0.446       Coef. Var           32.620 
## Adj. R-Squared          0.386       MSE                517.094 
## Pred R-Squared          0.300       MAE                 17.529 
## ---------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression    19134.358         5       3826.872    7.401    0.0000 
## Residual      23786.315        46        517.094                    
## Total         42920.673        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                    
## -----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower     upper 
## -----------------------------------------------------------------------------------------
## (Intercept)    -0.143        34.074                 -0.004    0.997    -68.730    68.444 
##         age    -0.770         0.244       -0.368    -3.154    0.003     -1.262    -0.279 
##        trig    -6.547         2.084       -0.352    -3.142    0.003    -10.741    -2.353 
##         BMI     3.130         1.106        0.329     2.829    0.007      0.903     5.357 
##         Ure     2.978         1.333        0.262     2.235    0.030      0.296     5.661 
##        Chol     5.417         2.922        0.214     1.854    0.070     -0.465    11.299 
## -----------------------------------------------------------------------------------------
## 
##                             Selection Summary                              
## --------------------------------------------------------------------------
##         Variable                  Adj.                                        
## Step    Entered     R-Square    R-Square     C(p)        AIC        RMSE      
## --------------------------------------------------------------------------
##    1    age           0.1909      0.1747    16.7215    491.7817    26.3548    
##    2    trig          0.2831      0.2538    11.3435    487.4879    25.0590    
##    3    BMI           0.3493      0.3087     8.0469    484.4484    24.1211    
##    4    Ure           0.4044      0.3537     5.6400    481.8478    23.3215    
##    5    Chol          0.4458      0.3856     4.3289    480.1019    22.7397    
## --------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  2 --- phy_function"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - trig 
## - age 
## - Alb 
## - protein 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.388       RMSE                16.843 
## R-Squared                0.151       Coef. Var           22.457 
## Adj. R-Squared           0.078       MSE                283.686 
## Pred R-Squared          -0.072       MAE                 12.091 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2366.761         4        591.690    2.086    0.0976 
## Residual      13333.239        47        283.686                    
## Total         15700.000        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                     
## ------------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower      upper 
## ------------------------------------------------------------------------------------------
## (Intercept)    56.690        49.190                  1.152    0.255    -42.269    155.648 
##        trig    -3.123         1.588       -0.277    -1.966    0.055     -6.317      0.072 
##         age    -0.304         0.176       -0.240    -1.727    0.091     -0.658      0.050 
##         Alb     1.918         1.059        0.262     1.811    0.077     -0.213      4.049 
##     protein    -0.596         0.543       -0.164    -1.098    0.278     -1.689      0.496 
## ------------------------------------------------------------------------------------------
## 
##                             Selection Summary                             
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Entered     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    trig          0.0537      0.0348    0.3878    447.6297    17.2379    
##    2    age           0.0867      0.0494    0.6984    447.7817    17.1062    
##    3    Alb           0.1290      0.0745    0.5383    447.3190    16.8790    
##    4    protein       0.1507      0.0785    1.4242    448.0017    16.8430    
## -------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  3 --- phy_health"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - Chol 
## - trig 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                       0.372       RMSE                 37.687 
## R-Squared               0.138       Coef. Var            85.205 
## Adj. R-Squared          0.103       MSE                1420.286 
## Pred R-Squared          0.055       MAE                  30.381 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression    11175.205         2       5587.603    3.934    0.0260 
## Residual      69594.025        49       1420.286                    
## Total         80769.231        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                    
## -----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower     upper 
## -----------------------------------------------------------------------------------------
## (Intercept)    -2.461        23.723                 -0.104    0.918    -50.135    45.213 
##        Chol    11.490         4.598        0.332     2.499    0.016      2.251    20.730 
##        trig    -4.532         3.389       -0.177    -1.337    0.187    -11.343     2.279 
## -----------------------------------------------------------------------------------------
## 
##                             Selection Summary                              
## --------------------------------------------------------------------------
##         Variable                  Adj.                                        
## Step    Entered     R-Square    R-Square     C(p)        AIC        RMSE      
## --------------------------------------------------------------------------
##    1    Chol          0.1069      0.0891    -3.3318    529.7909    37.9824    
##    2    trig          0.1384      0.1032    -2.9041    529.9275    37.6867    
## --------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  4 --- emotional"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - Chol 
## - Cre 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                           Model Summary                           
## -----------------------------------------------------------------
## R                        0.275       RMSE                 38.389 
## R-Squared                0.076       Coef. Var            83.177 
## Adj. R-Squared           0.038       MSE                1473.747 
## Pred R-Squared          -0.035       MAE                  32.644 
## -----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     5906.034         2       2953.017    2.004    0.1457 
## Residual      72213.625        49       1473.747                    
## Total         78119.658        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                    
## -----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower     upper 
## -----------------------------------------------------------------------------------------
## (Intercept)    27.532        26.955                  1.021    0.312    -26.637    81.700 
##        Chol     7.849         4.701        0.230     1.670    0.101     -1.598    17.296 
##         Cre    -0.186         0.149       -0.172    -1.250    0.217     -0.486     0.113 
## -----------------------------------------------------------------------------------------
## 
##                             Selection Summary                              
## --------------------------------------------------------------------------
##         Variable                  Adj.                                        
## Step    Entered     R-Square    R-Square     C(p)        AIC        RMSE      
## --------------------------------------------------------------------------
##    1    Chol          0.0461      0.0270    -1.4931    531.4816    38.6049    
##    2    Cre           0.0756      0.0379    -0.9306    531.8489    38.3894    
## --------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  5 --- fatigue"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - Alb 
## - trig 
## - Ure 
## - age 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                          
## ---------------------------------------------------------------
## R                       0.408       RMSE                18.904 
## R-Squared               0.166       Coef. Var           29.878 
## Adj. R-Squared          0.095       MSE                357.355 
## Pred R-Squared          0.021       MAE                 13.675 
## ---------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     3348.524         4        837.131    2.343    0.0685 
## Residual      16795.706        47        357.355                    
## Total         20144.231        51                                   
## --------------------------------------------------------------------
## 
##                                     Parameter Estimates                                     
## -------------------------------------------------------------------------------------------
##       model       Beta    Std. Error    Std. Beta      t        Sig        lower     upper 
## -------------------------------------------------------------------------------------------
## (Intercept)    -53.173        51.092                 -1.041    0.303    -155.958    49.611 
##         Alb      2.894         1.166        0.349     2.482    0.017       0.548     5.240 
##        trig     -3.184         1.745       -0.250    -1.825    0.074      -6.695     0.327 
##         Ure      1.396         1.094        0.179     1.276    0.208      -0.806     3.598 
##         age     -0.206         0.193       -0.143    -1.064    0.293      -0.595     0.183 
## -------------------------------------------------------------------------------------------
## 
##                             Selection Summary                             
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Entered     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    Alb           0.0658      0.0471    4.3966    459.9225    19.4007    
##    2    trig          0.1170      0.0810    3.5233    458.9898    19.0528    
##    3    Ure           0.1461      0.0928    3.8886    459.2443    18.9298    
##    4    age           0.1662      0.0953    4.7622    460.0066    18.9038    
## -------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  6 --- wellbeing"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - Alb 
## - Chol 
## - Ure 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.368       RMSE                16.485 
## R-Squared                0.136       Coef. Var           23.294 
## Adj. R-Squared           0.081       MSE                271.760 
## Pred R-Squared          -0.016       MAE                 13.207 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2044.738         3        681.579    2.508    0.0700 
## Residual      13044.493        48        271.760                    
## Total         15089.231        51                                   
## --------------------------------------------------------------------
## 
##                                     Parameter Estimates                                     
## -------------------------------------------------------------------------------------------
##       model       Beta    Std. Error    Std. Beta      t        Sig        lower     upper 
## -------------------------------------------------------------------------------------------
## (Intercept)    -25.669        45.967                 -0.558    0.579    -118.092    66.755 
##         Alb      2.384         0.999        0.333     2.386    0.021       0.375     4.393 
##        Chol     -2.269         2.016       -0.151    -1.126    0.266      -6.321     1.784 
##         Ure      1.005         0.939        0.149     1.071    0.290      -0.883     2.893 
## -------------------------------------------------------------------------------------------
## 
##                             Selection Summary                             
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Entered     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    Alb           0.0893      0.0711    3.6810    443.5730    16.5785    
##    2    Chol          0.1149      0.0787    4.2282    444.0903    16.5097    
##    3    Ure           0.1355      0.0815    5.0569    444.8632    16.4852    
## -------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  7 --- social_fun"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - trig 
## - BMI 
## - Chol 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.327       RMSE                19.381 
## R-Squared                0.107       Coef. Var           29.641 
## Adj. R-Squared           0.051       MSE                375.608 
## Pred R-Squared          -0.029       MAE                 14.697 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2163.125         3        721.042     1.92    0.1390 
## Residual      18029.183        48        375.608                    
## Total         20192.308        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                    
## -----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower     upper 
## -----------------------------------------------------------------------------------------
## (Intercept)    31.631        22.823                  1.386    0.172    -14.258    77.520 
##        trig    -2.790         1.743       -0.218    -1.601    0.116     -6.295     0.714 
##         BMI     1.147         0.889        0.176     1.290    0.203     -0.641     2.935 
##        Chol     2.920         2.365        0.168     1.235    0.223     -1.835     7.675 
## -----------------------------------------------------------------------------------------
## 
##                             Selection Summary                             
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Entered     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    trig          0.0465      0.0274    2.7878    461.1074    19.6230    
##    2    BMI           0.0788      0.0412    3.0694    461.3176    19.4840    
##    3    Chol          0.1071      0.0513    3.5590    461.6918    19.3806    
## -------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  8 --- pain"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - trig 
## - BMI 
## - Alb 
## - age 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.380       RMSE                25.403 
## R-Squared                0.145       Coef. Var           37.002 
## Adj. R-Squared           0.072       MSE                645.336 
## Pred R-Squared          -0.080       MAE                 19.945 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     5124.954         4       1281.239    1.985    0.1121 
## Residual      30330.815        47        645.336                    
## Total         35455.769        51                                   
## --------------------------------------------------------------------
## 
##                                     Parameter Estimates                                      
## --------------------------------------------------------------------------------------------
##       model       Beta    Std. Error    Std. Beta      t        Sig        lower      upper 
## --------------------------------------------------------------------------------------------
## (Intercept)    -27.549        64.602                 -0.426    0.672    -157.512    102.414 
##        trig     -3.859         2.304       -0.228    -1.675    0.101      -8.494      0.776 
##         BMI      1.825         1.184        0.211     1.542    0.130      -0.556      4.206 
##         Alb      1.824         1.518        0.166     1.202    0.235      -1.229      4.878 
##         age     -0.298         0.261       -0.156    -1.141    0.260      -0.823      0.227 
## --------------------------------------------------------------------------------------------
## 
##                             Selection Summary                             
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Entered     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    trig          0.0513      0.0323    3.8959    490.1202    25.9371    
##    2    BMI           0.0997      0.0629    3.2507    489.3996    25.5239    
##    3    Alb           0.1209      0.0659    4.0912    490.1608    25.4831    
##    4    age           0.1445      0.0717    4.7957    490.7407    25.4035    
## -------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  9 --- general"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - trig 
## - Weight 
## - age 
## - Alb 
## - Ure 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.417       RMSE                15.756 
## R-Squared                0.174       Coef. Var           35.622 
## Adj. R-Squared           0.084       MSE                248.247 
## Pred R-Squared          -0.046       MAE                 12.356 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2399.850         5        479.970    1.933    0.1070 
## Residual      11419.381        46        248.247                    
## Total         13819.231        51                                   
## --------------------------------------------------------------------
## 
##                                     Parameter Estimates                                     
## -------------------------------------------------------------------------------------------
##       model       Beta    Std. Error    Std. Beta      t        Sig        lower     upper 
## -------------------------------------------------------------------------------------------
## (Intercept)    -25.923        44.130                 -0.587    0.560    -114.752    62.905 
##        trig     -2.936         1.459       -0.278    -2.011    0.050      -5.873     0.002 
##      Weight      0.356         0.228        0.218     1.560    0.126      -0.103     0.815 
##         age     -0.246         0.162       -0.207    -1.522    0.135      -0.571     0.079 
##         Alb      1.372         0.974        0.200     1.408    0.166      -0.590     3.333 
##         Ure      1.059         0.936        0.164     1.131    0.264      -0.825     2.942 
## -------------------------------------------------------------------------------------------
## 
##                             Selection Summary                              
## --------------------------------------------------------------------------
##         Variable                  Adj.                                        
## Step    Entered     R-Square    R-Square     C(p)        AIC        RMSE      
## --------------------------------------------------------------------------
##    1    trig          0.0564      0.0375    -0.2670    440.8469    16.1495    
##    2    Weight        0.0922      0.0552    -0.0809    440.8323    16.0005    
##    3    age           0.1268      0.0722     0.1723    440.8156    15.8559    
##    4    Alb           0.1507      0.0784     0.9622    441.3712    15.8027    
##    5    Ure           0.1737      0.0838     1.7994    441.9444    15.7559    
## --------------------------------------------------------------------------
## [1] "--------------------------------------------------------"
## [1] "BIEN -  10 --- PostPT"
## [1] "--------------------------------------------------------"
## Forward Selection Method    
## ---------------------------
## 
## Candidate Terms: 
## 
## 1. age 
## 2. BMI 
## 3. Weight 
## 4. Height 
## 5. Ure 
## 6. Cre 
## 7. Chol 
## 8. trig 
## 9. Alb 
## 10. protein 
## 
## We are selecting variables based on p value...
## 
## Variables Entered: 
## 
## - Alb 
## - trig 
## - age 
## - Cre 
## - protein 
## 
## No more variables to be added.
## 
## Final Model Output 
## ------------------
## 
##                         Model Summary                          
## --------------------------------------------------------------
## R                       0.583       RMSE                0.427 
## R-Squared               0.340       Coef. Var          27.065 
## Adj. R-Squared          0.268       MSE                 0.182 
## Pred R-Squared          0.142       MAE                 0.344 
## --------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                               ANOVA                                
## ------------------------------------------------------------------
##                Sum of                                             
##               Squares        DF    Mean Square      F        Sig. 
## ------------------------------------------------------------------
## Regression      4.313         5          0.863    4.736    0.0014 
## Residual        8.379        46          0.182                    
## Total          12.692        51                                   
## ------------------------------------------------------------------
## 
##                                   Parameter Estimates                                    
## ----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig      lower     upper 
## ----------------------------------------------------------------------------------------
## (Intercept)     4.036         1.256                  3.213    0.002     1.508     6.565 
##         Alb    -0.086         0.028       -0.412    -3.103    0.003    -0.141    -0.030 
##        trig    -0.095         0.041       -0.297    -2.313    0.025    -0.178    -0.012 
##         age    -0.006         0.005       -0.168    -1.332    0.189    -0.015     0.003 
##         Cre     0.003         0.002        0.205     1.573    0.123    -0.001     0.006 
##     protein     0.018         0.014        0.174     1.280    0.207    -0.010     0.046 
## ----------------------------------------------------------------------------------------
## 
##                            Selection Summary                            
## -----------------------------------------------------------------------
##         Variable                  Adj.                                     
## Step    Entered     R-Square    R-Square     C(p)       AIC       RMSE     
## -----------------------------------------------------------------------
##    1    Alb           0.1461      0.1290    7.8764    72.0264    0.4656    
##    2    trig          0.2386      0.2075    3.8211    68.0619    0.4441    
##    3    age           0.2911      0.2468    2.3831    66.3437    0.4329    
##    4    Cre           0.3163      0.2581    2.7360    66.4636    0.4297    
##    5    protein       0.3398      0.2681    3.1964    66.6425    0.4268    
## -----------------------------------------------------------------------

Tìm các biến được chọn sử dụng stepwise backward regression

Loại bỏ các biến không có ý nghĩa

for (i in 1:10) {
  outcome <- names(Data_New[i])
  variables <- names(Data_New[11:20])
  f <- as.formula(paste(outcome,
                        paste(variables, collapse = " + "),
                        sep = " ~ "))
   print(paste(i,'---',outcome, "###########"))
  
  # Exec fucntion lm()
  print(ols_step_backward_p(lm(formula = f, data = Data_New)))
}
## [1] "1 --- c2score ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - protein 
## - Alb 
## - Cre 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                          
## ---------------------------------------------------------------
## R                       0.692       RMSE                22.546 
## R-Squared               0.479       Coef. Var           32.341 
## Adj. R-Squared          0.396       MSE                508.305 
## Pred R-Squared          0.304       MAE                 16.528 
## ---------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression    20555.244         7       2936.463    5.777     1e-04 
## Residual      22365.429        44        508.305                    
## Total         42920.673        51                                   
## --------------------------------------------------------------------
## 
##                                      Parameter Estimates                                       
## ----------------------------------------------------------------------------------------------
##       model        Beta    Std. Error    Std. Beta      t        Sig         lower      upper 
## ----------------------------------------------------------------------------------------------
## (Intercept)    -872.906       627.688                 -1.391    0.171    -2137.927    392.116 
##         age      -0.701         0.248       -0.335    -2.833    0.007       -1.200     -0.202 
##         BMI      25.872        14.846        2.722     1.743    0.088       -4.049     55.792 
##      Weight      -8.215         5.411       -2.849    -1.518    0.136      -19.121      2.691 
##      Height       5.190         3.779        0.944     1.373    0.177       -2.426     12.806 
##         Ure       3.485         1.356        0.307     2.570    0.014        0.752      6.218 
##        Chol       6.194         2.947        0.245     2.102    0.041        0.254     12.134 
##        trig      -6.670         2.122       -0.358    -3.144    0.003      -10.945     -2.394 
## ----------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    protein       0.4873      0.3774    9.0125    484.0584    22.8904    
##    2    Alb           0.4856      0.3899    7.1455    482.2268    22.6593    
##    3    Cre           0.4789       0.396    5.6809    480.8991    22.5456    
## -------------------------------------------------------------------------
## [1] "2 --- phy_function ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - Cre 
## - Weight 
## - Height 
## - Chol 
## - protein 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.413       RMSE                16.828 
## R-Squared                0.170       Coef. Var           22.438 
## Adj. R-Squared           0.080       MSE                283.192 
## Pred R-Squared          -0.100       MAE                 11.883 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2673.190         5        534.638    1.888    0.1149 
## Residual      13026.810        46        283.192                    
## Total         15700.000        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                     
## ------------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig        lower     upper 
## ------------------------------------------------------------------------------------------
## (Intercept)    -8.811        48.522                 -0.182    0.857    -106.482    88.859 
##         age    -0.284         0.173       -0.224    -1.644    0.107      -0.632     0.064 
##         BMI     1.069         0.819        0.186     1.305    0.199      -0.580     2.719 
##         Ure     1.133         1.018        0.165     1.113    0.272      -0.916     3.183 
##        trig    -2.919         1.554       -0.259    -1.879    0.067      -6.047     0.209 
##         Alb     1.673         1.040        0.229     1.610    0.114      -0.419     3.766 
## ------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    Cre           0.1979      0.0261    9.0110    455.0286    17.3152    
##    2    Weight        0.1936      0.0436    7.2306    453.3062    17.1584    
##    3    Height        0.1935      0.0652    5.2392    451.3171    16.9641    
##    4    Chol          0.1855      0.0769    3.6488    449.8310    16.8576    
##    5    protein       0.1703      0.0801    2.4262    448.7927    16.8283    
## -------------------------------------------------------------------------
## [1] "3 --- phy_health ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - age 
## - Alb 
## - protein 
## - Ure 
## - Cre 
## - Weight 
## - BMI 
## - Height 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                       0.372       RMSE                 37.687 
## R-Squared               0.138       Coef. Var            85.205 
## Adj. R-Squared          0.103       MSE                1420.286 
## Pred R-Squared          0.055       MAE                  30.381 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression    11175.205         2       5587.603    3.934    0.0260 
## Residual      69594.025        49       1420.286                    
## Total         80769.231        51                                   
## --------------------------------------------------------------------
## 
##                                    Parameter Estimates                                    
## -----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig       lower     upper 
## -----------------------------------------------------------------------------------------
## (Intercept)    -2.461        23.723                 -0.104    0.918    -50.135    45.213 
##        Chol    11.490         4.598        0.332     2.499    0.016      2.251    20.730 
##        trig    -4.532         3.389       -0.177    -1.337    0.187    -11.343     2.279 
## -----------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                             
## --------------------------------------------------------------------------
##         Variable                  Adj.                                        
## Step    Removed     R-Square    R-Square     C(p)        AIC        RMSE      
## --------------------------------------------------------------------------
##    1    age           0.1787      0.0027     9.0786    541.4347    39.7422    
##    2    Alb            0.174      0.0203     7.3134    539.7310    39.3894    
##    3    protein       0.1669      0.0343     5.6699    538.1779    39.1069    
##    4    Ure           0.1583       0.046     4.1004    536.7123    38.8692    
##    5    Cre           0.1497      0.0572     2.5299    535.2400    38.6399    
##    6    Weight        0.1401      0.0669     1.0112    533.8252    38.4424    
##    7    BMI           0.1396      0.0858    -0.9652    531.8538    38.0502    
##    8    Height        0.1384      0.1032    -2.9041    529.9275    37.6867    
## --------------------------------------------------------------------------
## [1] "4 --- emotional ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - Alb 
## - age 
## - trig 
## - Ure 
## - BMI 
## - protein 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                           Model Summary                           
## -----------------------------------------------------------------
## R                        0.342       RMSE                 38.310 
## R-Squared                0.117       Coef. Var            83.006 
## Adj. R-Squared           0.042       MSE                1467.675 
## Pred R-Squared          -0.097       MAE                  32.267 
## -----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     9138.938         4       2284.735    1.557    0.2015 
## Residual      68980.720        47       1467.675                    
## Total         78119.658        51                                   
## --------------------------------------------------------------------
## 
##                                      Parameter Estimates                                      
## ---------------------------------------------------------------------------------------------
##       model        Beta    Std. Error    Std. Beta      t        Sig        lower      upper 
## ---------------------------------------------------------------------------------------------
## (Intercept)    -246.722       200.532                 -1.230    0.225    -650.140    156.695 
##      Weight      -0.895         0.742       -0.230    -1.206    0.234      -2.388      0.598 
##      Height       2.074         1.427        0.280     1.453    0.153      -0.798      4.946 
##         Cre      -0.296         0.167       -0.273    -1.772    0.083      -0.631      0.040 
##        Chol       7.195         4.747        0.211     1.516    0.136      -2.354     16.744 
## ---------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    Alb           0.1588     -0.0215    9.0141    540.9460    39.5559    
##    2    age           0.1582      0.0015    7.0442    538.9841    39.1075    
##    3    trig          0.1572      0.0231    5.0925    537.0453    38.6833    
##    4    Ure           0.1454      0.0315    3.6642    535.7638    38.5163    
##    5    BMI           0.1335      0.0393    2.2468    534.4858    38.3607    
##    6    protein        0.117      0.0418    1.0517    533.4672    38.3102    
## -------------------------------------------------------------------------
## [1] "5 --- fatigue ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - Chol 
## - protein 
## - Cre 
## - age 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.495       RMSE                18.390 
## R-Squared                0.245       Coef. Var           29.066 
## Adj. R-Squared           0.144       MSE                338.182 
## Pred R-Squared          -0.020       MAE                 13.034 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     4926.034         6        821.006    2.428    0.0406 
## Residual      15218.197        45        338.182                    
## Total         20144.231        51                                   
## --------------------------------------------------------------------
## 
##                                      Parameter Estimates                                      
## ---------------------------------------------------------------------------------------------
##       model        Beta    Std. Error    Std. Beta      t        Sig         lower     upper 
## ---------------------------------------------------------------------------------------------
## (Intercept)    -948.671       498.739                 -1.902    0.064    -1953.183    55.841 
##         BMI      24.477        11.965        3.759     2.046    0.047        0.378    48.577 
##      Weight      -8.509         4.352       -4.308    -1.955    0.057      -17.275     0.257 
##      Height       5.284         3.043        1.403     1.736    0.089       -0.846    11.414 
##         Ure       2.176         1.133        0.280     1.920    0.061       -0.107     4.459 
##        trig      -3.324         1.727       -0.261    -1.924    0.061       -6.803     0.155 
##         Alb       2.482         1.141        0.300     2.176    0.035        0.185     4.780 
## ---------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    Chol          0.2688      0.1122    9.0069    463.1772    18.7265    
##    2    protein       0.2678      0.1316    7.0652    461.2511    18.5206    
##    3    Cre           0.2591      0.1412    5.5543    459.8668    18.4176    
##    4    age           0.2445      0.1438    4.3701    458.8778    18.3897    
## -------------------------------------------------------------------------
## [1] "6 --- wellbeing ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - protein 
## - age 
## - Cre 
## - Chol 
## - trig 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                          
## ---------------------------------------------------------------
## R                       0.484       RMSE                15.847 
## R-Squared               0.234       Coef. Var           22.393 
## Adj. R-Squared          0.151       MSE                251.133 
## Pred R-Squared          0.058       MAE                 12.108 
## ---------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     3537.117         5        707.423    2.817    0.0266 
## Residual      11552.114        46        251.133                    
## Total         15089.231        51                                   
## --------------------------------------------------------------------
## 
##                                      Parameter Estimates                                      
## ---------------------------------------------------------------------------------------------
##       model        Beta    Std. Error    Std. Beta      t        Sig         lower     upper 
## ---------------------------------------------------------------------------------------------
## (Intercept)    -795.034       426.616                 -1.864    0.069    -1653.768    63.700 
##         BMI      21.571        10.277        3.828     2.099    0.041        0.885    42.257 
##      Weight      -7.433         3.737       -4.348    -1.989    0.053      -14.956     0.089 
##      Height       4.428         2.606        1.359     1.700    0.096       -0.816     9.673 
##         Ure       1.835         0.962        0.272     1.907    0.063       -0.101     3.771 
##         Alb       2.248         0.976        0.314     2.304    0.026        0.284     4.212 
## ---------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    protein       0.2773      0.1224    9.0112    447.5483    16.1135    
##    2    age           0.2742      0.1392    7.1872    445.7709    15.9592    
##    3    Cre           0.2618      0.1443    5.8922    444.6535    15.9112    
##    4    Chol          0.2499      0.1499    4.5642    443.4810    15.8591    
##    5    trig          0.2344      0.1512    3.4444    442.5454    15.8472    
## -------------------------------------------------------------------------
## [1] "7 --- social_fun ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - age 
## - Cre 
## - protein 
## - Alb 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.457       RMSE                18.836 
## R-Squared                0.209       Coef. Var           28.808 
## Adj. R-Squared           0.104       MSE                354.806 
## Pred R-Squared          -0.036       MAE                 13.752 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     4226.021         6        704.337    1.985    0.0877 
## Residual      15966.287        45        354.806                    
## Total         20192.308        51                                   
## --------------------------------------------------------------------
## 
##                                      Parameter Estimates                                      
## ---------------------------------------------------------------------------------------------
##       model        Beta    Std. Error    Std. Beta      t        Sig         lower     upper 
## ---------------------------------------------------------------------------------------------
## (Intercept)    -966.376       510.784                 -1.892    0.065    -1995.147    62.395 
##         BMI      27.005        12.167        4.142     2.220    0.032        2.500    51.511 
##      Weight      -9.248         4.426       -4.676    -2.089    0.042      -18.163    -0.332 
##      Height       5.891         3.088        1.562     1.908    0.063       -0.329    12.111 
##         Ure       1.504         1.131        0.193     1.330    0.190       -0.774     3.782 
##        Chol       3.566         2.339        0.206     1.525    0.134       -1.144     8.277 
##        trig      -3.125         1.756       -0.245    -1.779    0.082       -6.663     0.412 
## ---------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    age           0.2299      0.0648    9.0219    466.0028    19.2422    
##    2    Cre           0.2248      0.0806    7.2895    464.3409    19.0791    
##    3    protein       0.2155      0.0907    5.7875    462.9643    18.9744    
##    4    Alb           0.2093      0.1039    4.1173    461.3731    18.8363    
## -------------------------------------------------------------------------
## [1] "8 --- pain ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - protein 
## - age 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.492       RMSE                25.002 
## R-Squared                0.242       Coef. Var           36.418 
## Adj. R-Squared           0.101       MSE                625.112 
## Pred R-Squared          -0.092       MAE                 17.743 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     8575.970         8       1071.996    1.715    0.1225 
## Residual      26879.800        43        625.112                    
## Total         35455.769        51                                   
## --------------------------------------------------------------------
## 
##                                       Parameter Estimates                                        
## ------------------------------------------------------------------------------------------------
##       model         Beta    Std. Error    Std. Beta      t        Sig         lower       upper 
## ------------------------------------------------------------------------------------------------
## (Intercept)    -1582.404       715.495                 -2.212    0.032    -3025.338    -139.470 
##         BMI       38.110        16.789        4.411     2.270    0.028        4.251      71.968 
##      Weight      -13.303         6.150       -5.076    -2.163    0.036      -25.706      -0.900 
##      Height        9.087         4.348        1.819     2.090    0.043        0.319      17.856 
##         Ure        2.954         1.743        0.286     1.695    0.097       -0.561       6.468 
##         Cre       -0.155         0.130       -0.212    -1.188    0.241       -0.417       0.108 
##        Chol        3.601         3.136        0.157     1.148    0.257       -2.723       9.925 
##        trig       -4.374         2.372       -0.258    -1.844    0.072       -9.159       0.410 
##         Alb        2.365         1.638        0.215     1.443    0.156       -0.939       5.669 
## ------------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    protein       0.2489       0.088    9.0848    493.9728    25.1800    
##    2    age           0.2419      0.1008    7.4713    492.4597    25.0022    
## -------------------------------------------------------------------------
## [1] "9 --- general ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - BMI 
## - Cre 
## - Height 
## - Chol 
## - protein 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                          Model Summary                           
## ----------------------------------------------------------------
## R                        0.417       RMSE                15.756 
## R-Squared                0.174       Coef. Var           35.622 
## Adj. R-Squared           0.084       MSE                248.247 
## Pred R-Squared          -0.046       MAE                 12.356 
## ----------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                                ANOVA                                 
## --------------------------------------------------------------------
##                  Sum of                                             
##                 Squares        DF    Mean Square      F        Sig. 
## --------------------------------------------------------------------
## Regression     2399.850         5        479.970    1.933    0.1070 
## Residual      11419.381        46        248.247                    
## Total         13819.231        51                                   
## --------------------------------------------------------------------
## 
##                                     Parameter Estimates                                     
## -------------------------------------------------------------------------------------------
##       model       Beta    Std. Error    Std. Beta      t        Sig        lower     upper 
## -------------------------------------------------------------------------------------------
## (Intercept)    -25.923        44.130                 -0.587    0.560    -114.752    62.905 
##         age     -0.246         0.162       -0.207    -1.522    0.135      -0.571     0.079 
##      Weight      0.356         0.228        0.218     1.560    0.126      -0.103     0.815 
##         Ure      1.059         0.936        0.164     1.131    0.264      -0.825     2.942 
##        trig     -2.936         1.459       -0.278    -2.011    0.050      -5.873     0.002 
##         Alb      1.372         0.974        0.200     1.408    0.166      -0.590     3.333 
## -------------------------------------------------------------------------------------------
## 
## 
##                            Elimination Summary                            
## -------------------------------------------------------------------------
##         Variable                  Adj.                                       
## Step    Removed     R-Square    R-Square     C(p)       AIC        RMSE      
## -------------------------------------------------------------------------
##    1    BMI           0.1893      0.0156    9.0070    448.9491    16.3320    
##    2    Cre           0.1875      0.0363    7.1016    447.0689    16.1596    
##    3    Height        0.1841      0.0543    5.2694    445.2809    16.0075    
##    4    Chol          0.1806      0.0714    3.4462    443.5031    15.8625    
##    5    protein       0.1737      0.0838    1.7994    441.9444    15.7559    
## -------------------------------------------------------------------------
## [1] "10 --- PostPT ###########"
## Backward Elimination Method 
## ---------------------------
## 
## Candidate Terms: 
## 
## 1 . age 
## 2 . BMI 
## 3 . Weight 
## 4 . Height 
## 5 . Ure 
## 6 . Cre 
## 7 . Chol 
## 8 . trig 
## 9 . Alb 
## 10 . protein 
## 
## We are eliminating variables based on p value...
## 
## Variables Removed: 
## 
## - Height 
## - Ure 
## - BMI 
## - Weight 
## - Chol 
## 
## No more variables satisfy the condition of p value = 0.3
## 
## 
## Final Model Output 
## ------------------
## 
##                         Model Summary                          
## --------------------------------------------------------------
## R                       0.583       RMSE                0.427 
## R-Squared               0.340       Coef. Var          27.065 
## Adj. R-Squared          0.268       MSE                 0.182 
## Pred R-Squared          0.142       MAE                 0.344 
## --------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
## 
##                               ANOVA                                
## ------------------------------------------------------------------
##                Sum of                                             
##               Squares        DF    Mean Square      F        Sig. 
## ------------------------------------------------------------------
## Regression      4.313         5          0.863    4.736    0.0014 
## Residual        8.379        46          0.182                    
## Total          12.692        51                                   
## ------------------------------------------------------------------
## 
##                                   Parameter Estimates                                    
## ----------------------------------------------------------------------------------------
##       model      Beta    Std. Error    Std. Beta      t        Sig      lower     upper 
## ----------------------------------------------------------------------------------------
## (Intercept)     4.036         1.256                  3.213    0.002     1.508     6.565 
##         age    -0.006         0.005       -0.168    -1.332    0.189    -0.015     0.003 
##         Cre     0.003         0.002        0.205     1.573    0.123    -0.001     0.006 
##        trig    -0.095         0.041       -0.297    -2.313    0.025    -0.178    -0.012 
##         Alb    -0.086         0.028       -0.412    -3.103    0.003    -0.141    -0.030 
##     protein     0.018         0.014        0.174     1.280    0.207    -0.010     0.046 
## ----------------------------------------------------------------------------------------
## 
## 
##                           Elimination Summary                           
## -----------------------------------------------------------------------
##         Variable                  Adj.                                     
## Step    Removed     R-Square    R-Square     C(p)       AIC       RMSE     
## -----------------------------------------------------------------------
##    1    Height        0.3731      0.2388    9.0177    71.9512    0.4352    
##    2    Ure            0.371       0.254    7.1574    70.1281    0.4309    
##    3    BMI           0.3555       0.253    6.1695    69.3913    0.4312    
##    4    Weight        0.3524       0.266    4.3762    67.6455    0.4274    
##    5    Chol          0.3398      0.2681    3.1964    66.6425    0.4268    
## -----------------------------------------------------------------------
# Viết hàm chèn dữ liệu  thiếu bằng mean: 
chen_na <- function(x) {
  x[is.na(x)] <- mean(x, na.rm = TRUE)
  return(x)
}
plot(Data_New$Alb, Data_New$PostPT)