PROVAS + LABS
p_l_color <- provas_labs_nota %>% select(-aluno,- X, -X.1) %>% rename(
facade = hasFacade,
controller = hasController,
herança = useInheritance,
interface = useInterface,
classes_abstratas = useAbstractClass,
exception = useException,
documentação = hasDoc,
testes = hasTests,
hashMap = usedHashMap )
autoplot(prcomp(p_l_color), data = provas_labs_nota, colour = 'X.1', loadings = TRUE, loadings.label = TRUE) + labs(color="nota")

pca <- prcomp(p_l_color)
hmm <- summary(pca)
difs.pca <- prcomp(p_l_color)
difs.pca.df <- data.frame(difs.pca$rotation)
kable(difs.pca.df, format = 'html') %>% kable_styling(bootstrap_options = c('hover', 'striped'))
|
|
PC1
|
PC2
|
PC3
|
PC4
|
PC5
|
PC6
|
PC7
|
PC8
|
PC9
|
PC10
|
PC11
|
|
facade
|
0.3014265
|
-0.2046022
|
0.0627942
|
-0.1857731
|
0.1206075
|
0.0945890
|
-0.2791529
|
-0.5966525
|
-0.2430271
|
0.5588822
|
0.0000000
|
|
controller
|
-0.0237928
|
-0.0236780
|
0.9339872
|
-0.0314321
|
0.0841605
|
0.2440304
|
-0.0840140
|
0.2204918
|
0.0402898
|
0.0402621
|
0.0000000
|
|
herança
|
0.3370666
|
-0.2950991
|
0.1173282
|
-0.1722173
|
-0.1198075
|
0.1129027
|
0.1372956
|
-0.3937859
|
-0.0808527
|
-0.7404880
|
0.0000000
|
|
interface
|
-0.2644563
|
0.0646584
|
0.0641857
|
-0.7397138
|
-0.0821679
|
-0.1289389
|
0.4253380
|
-0.1547561
|
0.3508211
|
0.1525509
|
0.0000000
|
|
classes_abstratas
|
0.3207531
|
-0.3093307
|
0.1078648
|
0.3351746
|
-0.5554753
|
-0.1431556
|
0.4800215
|
0.0670749
|
0.1126197
|
0.3174995
|
0.0000000
|
|
exception
|
-0.1012679
|
0.0876481
|
-0.2116206
|
0.0356236
|
-0.2227955
|
0.9208845
|
0.0835755
|
-0.0442867
|
0.1537581
|
0.0758719
|
0.0000000
|
|
hashCode
|
-0.3779977
|
-0.5803891
|
-0.0508939
|
0.0403518
|
0.1119610
|
0.0334247
|
-0.0043972
|
0.0398717
|
-0.0263366
|
0.0096234
|
0.7071068
|
|
equals
|
-0.3779977
|
-0.5803891
|
-0.0508939
|
0.0403518
|
0.1119610
|
0.0334247
|
-0.0043972
|
0.0398717
|
-0.0263366
|
0.0096234
|
-0.7071068
|
|
documentação
|
0.3956926
|
-0.2809191
|
-0.1650209
|
-0.3685548
|
-0.1632183
|
0.0126118
|
-0.4896119
|
0.4535192
|
0.3594047
|
0.0087678
|
0.0000000
|
|
testes
|
0.1266961
|
-0.0304288
|
-0.0895789
|
-0.3561922
|
-0.0056547
|
0.1256082
|
0.2713889
|
0.4321604
|
-0.7537519
|
0.0613117
|
0.0000000
|
|
hashMap
|
-0.3917884
|
0.0969591
|
0.0947854
|
-0.0899552
|
-0.7398189
|
-0.1242463
|
-0.4055083
|
-0.1195419
|
-0.2732698
|
-0.0620623
|
0.0000000
|
REGRESSAO - PROVAS
p_nota = provas_nota %>% select(-aluno, -X, -X.2, -X.3, -X.4, -X.5) %>% na.omit()
mod <- lm(X.1 ~ hasFacade + hasController + useException + useInheritance + usedHashMap + hasTests + equals + hashCode + useInterface + useAbstractClass,
data = p_nota)
mod
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = p_nota)
##
## Coefficients:
## (Intercept) hasFacade hasController useException
## 4.01584 -0.60508 -0.03655 0.28476
## useInheritance usedHashMap hasTests equals
## 0.05499 0.39235 3.02713 0.08197
## hashCode useInterface useAbstractClass
## NA 1.45936 1.02445
summary(mod)
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = p_nota)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.0825 -0.8181 0.2161 0.9669 3.7258
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.01584 0.50178 8.003 2.01e-12 ***
## hasFacade -0.60508 0.29854 -2.027 0.0453 *
## hasController -0.03655 0.29367 -0.124 0.9012
## useException 0.28476 0.30871 0.922 0.3585
## useInheritance 0.05499 0.37693 0.146 0.8843
## usedHashMap 0.39235 0.41183 0.953 0.3430
## hasTests 3.02713 0.32351 9.357 2.15e-15 ***
## equals 0.08197 0.28529 0.287 0.7745
## hashCode NA NA NA NA
## useInterface 1.45936 0.31613 4.616 1.14e-05 ***
## useAbstractClass 1.02445 0.44740 2.290 0.0241 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.465 on 102 degrees of freedom
## Multiple R-squared: 0.6075, Adjusted R-squared: 0.5729
## F-statistic: 17.54 on 9 and 102 DF, p-value: < 2.2e-16
tidy(mod)
## # A tibble: 10 x 5
## term estimate std.error statistic p.value
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 (Intercept) 4.02 0.502 8.00 2.01e-12
## 2 hasFacade -0.605 0.299 -2.03 4.53e- 2
## 3 hasController -0.0366 0.294 -0.124 9.01e- 1
## 4 useException 0.285 0.309 0.922 3.58e- 1
## 5 useInheritance 0.0550 0.377 0.146 8.84e- 1
## 6 usedHashMap 0.392 0.412 0.953 3.43e- 1
## 7 hasTests 3.03 0.324 9.36 2.15e-15
## 8 equals 0.0820 0.285 0.287 7.74e- 1
## 9 useInterface 1.46 0.316 4.62 1.14e- 5
## 10 useAbstractClass 1.02 0.447 2.29 2.41e- 2
nota = 4.015 - (0.605) * Facade - (0.03) * Controller + (0.284) * Exception + (0.05499) * Herança + (0.39235) * hashMap + (3.02713) * Testes + (0.08197) * equals + (0.08197) * hashCode + (1.45936) * Interface + (1.02445) * ClasseAbstrata que explica 60% da variável de resposta (R² = 0.6075). Podemos observar, a partir do modelo que a variável Testes é aquela que mais tem influencia, seguida do uso de Interface e classes abstratas.
LABS
l_nota = labs_nota %>% select(-aluno, -X, -X.2, -X.3, -X.4)
mod <- lm(X.1 ~ hasFacade + hasController + useException + useInheritance + usedHashMap + hasTests + equals + hashCode + useInterface + useAbstractClass,
data = l_nota)
mod
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = l_nota)
##
## Coefficients:
## (Intercept) hasFacade hasController useException
## 5.04101 -0.18287 -0.19136 -0.10531
## useInheritance usedHashMap hasTests equals
## 2.33319 0.29382 1.64019 0.14771
## hashCode useInterface useAbstractClass
## NA -0.04985 0.35728
summary(mod)
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = l_nota)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.1792 -0.2974 0.2026 0.5610 2.4585
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.04101 1.08584 4.642 1.04e-05 ***
## hasFacade -0.18287 0.73048 -0.250 0.80283
## hasController -0.19136 0.19035 -1.005 0.31714
## useException -0.10531 0.23320 -0.452 0.65255
## useInheritance 2.33319 0.72216 3.231 0.00167 **
## usedHashMap 0.29382 0.22471 1.308 0.19400
## hasTests 1.64019 0.34756 4.719 7.63e-06 ***
## equals 0.14771 0.20021 0.738 0.46236
## hashCode NA NA NA NA
## useInterface -0.04985 0.23554 -0.212 0.83282
## useAbstractClass 0.35728 0.20054 1.782 0.07782 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9817 on 101 degrees of freedom
## Multiple R-squared: 0.2999, Adjusted R-squared: 0.2375
## F-statistic: 4.807 on 9 and 101 DF, p-value: 2.416e-05
tidy(mod)
## # A tibble: 10 x 5
## term estimate std.error statistic p.value
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 (Intercept) 5.04 1.09 4.64 0.0000104
## 2 hasFacade -0.183 0.730 -0.250 0.803
## 3 hasController -0.191 0.190 -1.01 0.317
## 4 useException -0.105 0.233 -0.452 0.653
## 5 useInheritance 2.33 0.722 3.23 0.00167
## 6 usedHashMap 0.294 0.225 1.31 0.194
## 7 hasTests 1.64 0.348 4.72 0.00000763
## 8 equals 0.148 0.200 0.738 0.462
## 9 useInterface -0.0498 0.236 -0.212 0.833
## 10 useAbstractClass 0.357 0.201 1.78 0.0778
LABS + PROVAS
l_p_nota = provas_labs_nota %>% select(-aluno, -X)
mod <- lm(X.1 ~ hasFacade + hasController + useException + useInheritance + usedHashMap + hasTests + equals + hashCode + useInterface + useAbstractClass,
data = l_p_nota)
mod
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = l_p_nota)
##
## Coefficients:
## (Intercept) hasFacade hasController useException
## 5.1678 -0.2757 -0.3002 -0.0932
## useInheritance usedHashMap hasTests equals
## 1.0051 -0.1622 2.6591 0.1316
## hashCode useInterface useAbstractClass
## NA 0.6179 0.6083
summary(mod)
##
## Call:
## lm(formula = X.1 ~ hasFacade + hasController + useException +
## useInheritance + usedHashMap + hasTests + equals + hashCode +
## useInterface + useAbstractClass, data = l_p_nota)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.8422 -0.6921 0.2436 0.7624 4.3335
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.1678 0.3234 15.982 < 2e-16 ***
## hasFacade -0.2757 0.2434 -1.133 0.258443
## hasController -0.3002 0.1668 -1.799 0.073162 .
## useException -0.0932 0.1989 -0.469 0.639712
## useInheritance 1.0051 0.2589 3.882 0.000131 ***
## usedHashMap -0.1622 0.1854 -0.875 0.382441
## hasTests 2.6591 0.2306 11.530 < 2e-16 ***
## equals 0.1316 0.1718 0.766 0.444221
## hashCode NA NA NA NA
## useInterface 0.6179 0.1945 3.176 0.001670 **
## useAbstractClass 0.6083 0.1965 3.095 0.002182 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.352 on 261 degrees of freedom
## Multiple R-squared: 0.4782, Adjusted R-squared: 0.4603
## F-statistic: 26.58 on 9 and 261 DF, p-value: < 2.2e-16
tidy(mod)
## # A tibble: 10 x 5
## term estimate std.error statistic p.value
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 (Intercept) 5.17 0.323 16.0 1.47e-40
## 2 hasFacade -0.276 0.243 -1.13 2.58e- 1
## 3 hasController -0.300 0.167 -1.80 7.32e- 2
## 4 useException -0.0932 0.199 -0.469 6.40e- 1
## 5 useInheritance 1.01 0.259 3.88 1.31e- 4
## 6 usedHashMap -0.162 0.185 -0.875 3.82e- 1
## 7 hasTests 2.66 0.231 11.5 3.91e-25
## 8 equals 0.132 0.172 0.766 4.44e- 1
## 9 useInterface 0.618 0.195 3.18 1.67e- 3
## 10 useAbstractClass 0.608 0.197 3.10 2.18e- 3