Zkouška z MAS02, 7. 9. 2021 Popis situace: U 23 českých profesionálních basketbalistů byly zjišťovány hodnoty těchto proměnných: vyska ... tělesná výška v cm hmotnost ... tělesná hmotnost v kg tuk ... procento tělesného tuku (u basketbalistů by se tyto hodnoty měly pohybovat od 7 % do 13 %) V02_max ... aerobní kapacita (maximální množství kyslíku za minutu, které může organismus využít při intenzívním fyzickém zatížení; jedná se o ukazatel tělesné zdatnosti; ideální hodnota by se měla pohybovat kolem 60 ml/kg) Údaje jsou uloženy v souboru basketbal.csv. Cíle výzkumu: 1. Pomocí metod korelační analýzy prozkoumat závislosti mezi proměnnými. 2. Sestavit model vícenásobné lineární regrese, který umožní popsat závislost aerobní kapacity na výšce, hmotnosti a procentu tělesného tuku. Upozornění: Pro ověření vícerozměrné normality dat je použita funkce CM.test z knihovny mvtnorm. Výstupy ze systému R > 1 ibrary(mvtnorm) > CM.test(basketbal,qqplot=T) Cramer-von Mises test for Multivariate Normality data : basketbal CM : 0.07362245 p-value : 0.5191481 Result : Data are multivariate normál (sig.level = 0.05) Chi-Square Q-Q Plot n i i i r 2 4 6 S 10 Squared Mahalanobis Distance > cor.test(basketbal$V02_max,basketbal$vyska) Pearson's product-moment correlation data: basketbal$V02_max and basketbal$vyska t = -2.7973, df = 21, p-value = 0.01079 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.7682332 -0.1385822 sample estimates: cor -0.5210216 > cor.test(basketbal$V02_max,basketbal$hmotnost) Pearson's product-moment correlation data: basketbal$V02_max and basketbal$hmotnost t = -10.194, df = 21, p-value = 1.381e-09 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.9624444 -0.8010513 sample estimates: cor -0.9120869 > cor.test(basketbal$V02_max,basketbal$tuk) Pearson's product-moment correlation data: basketbal$V02_max and basketbal$tuk t = -5.108, df = 21, p-value = 4.646e-05 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.8850136 -0.4791772 sample estimates: cor -0.7443558 > cor.test(basketbal$vyska,basketbal$hmotnost) Pearson's product-moment correlation data: basketbal$vyska and basketbal$hmotnost t = 4.0081, df = 21, p-value = 0.0006373 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.3378260 0.8420445 sample estimates: cor 0.6583511 > cor.test(basketbal$vyska,basketbal$tuk) Pearson's product-moment correlation data: basketbal$vyska and basketbal$tuk t = 1.7241, df = 21, p-value = 0.09939 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.07027838 0.66744879 sample estimates: cor 0.3521245 > cor.test(basketbal$hmotnost,basketbal$tuk) Pearson's product-moment correlation data: basketbal$hmotnost and basketbal$tuk t = 4.0019, df = 21, p-value = 0.0006467 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.3369272 0.8417491 sample estimates: cor 0.657776 pcor(basketbal [-1]) $estimate hmotnost tuk V02_max hmotnost 1.00000000 -0.07721672 tuk -0.07721672 1.00000000 -0.83992326 -0.46761575 V02_max -0.8399233 -0.4676157 1.0000000 $p.value hmotnost tuk V02_max hmotnost 0.000000e+00 0.73269113 1.011868e-06 tuk 7.326911e-01 0.00000000 2.820084e-02 V02_max 1.011868e-06 0.02820084 0.000000e+00 $statistic hmotnost tuk V02_max hmotnost 0.0000000 -0.3463578 -6.921347 tuk -0.3463578 0.0000000 -2.365840 V02_max -6.9213471 -2.3658399 0.000000 $n [1] 23 $gp [1] 1 $method [1] "pearson" > pcor (basketbal [-; $estimate vyska vyska 1.0000000 tuk -0.0626353 V02_max -0.4142560 ]) tuk V02_max -0.0626353 -0.4142560 1.0000000 -0.7020999 -0.7020999 1.0000000 $p.value vyska tuk vo2_max vyska 0.00000000 0.7818504001 0.0552699949 tuk 0.78185040 0.0000000000 0.0002701834 V02_max 0.05526999 0.0002701834 0.0000000000 $statistic vyska tuk vo2_max vyska 0.0000000 -0.2806647 -2.035475 tuk -0.2806647 0.0000000 -4.409467 V02_max -2.0354755 -4.4094672 0.000000 $n [1] 23 $gp [1] 1 $method [1] "pearson" > pcor(basketbal [-3]) $estimate vyska vyska 1.0000000 hmotnost 0.5233145 V02_max 0.2574508 hmotnost 0.5233145 V02_max 0.2574508 1.0000000 -0.8857539 -0.8857539 1.0000000 $p.value vyska 0.00000000 1.244393e-02 2 hmotnost 0.01244393 0.000000e+00 4 V02_max 0.24739789 4.233245e-08 0.000000e+00 vyska hmotnost 0.00000000 1.244393e-02 V02_max ,473979e-01 ,233245e-08 $statistic vyska vyska 0.000000 hmotnost 2.746421 V02_max 1.191520 hmotnost 2.746421 V02_max 1.191520 0.000000 -8.534241 -8.534241 0.000000 $n [1] 23 $gp [1] 1 $method [1] "pearson" pcor(basketbal) $estimate vyska hmotnost tuk V02_max vyska 1.00000000 0.52105379 hmotnost tuk V02_max 0.52105379 -0.02616148 0.2179797 1.00000000 -0.05225222 -0.8132347 -0.02616148 -0.05225222 1.00000000 -0.4505123 0.21797971 -0.81323473 -0.45051226 1.0000000 $p.value vyska hmotnost tuk V02_max vyska 0.0000000 1.543230e-02 0.91037573 3.425065e-01 hmotnost 0.0154323 0.000000e+00 0.82202548 7.399455e-06 tuk 0.9103757 8.220255e-01 0.00000000 4.041368e-02 V02_max 0.3425065 7.399455e-06 0.04041368 0.000000e+00 $statistic vyska hmotnost tuk V02_max vyska 0.0000000 2.6609928 -0.1140743 0.9735625 hmotnost 2.6609928 0.0000000 -0.2280737 -6.0914074 tuk -0.1140743 -0.2280737 0.0000000 -2.1996000 V02_max 0.9735625 -6.0914074 -2.1996000 0.0000000 $n [1] 23 $gp [1] 2 $method [1] "pearson" > model<- 1 m(basketbal$V02_max~basketbal$vyska+basketbal$hmotnost+basketbal $tuk) > summary(model) Call : lm(formula = basketbal$V02_max ~ basketbal$vyska + basketbal$hmotnost + basketbal$tuk) Residuals: Min 1Q Median 3Q Max -2.6811 -1.0552 -0.1376 0.6958 4.0287 Coefficients: Estimate Std. Error t value Pr(>|t|) (intercept) 79.60140 7.28196 10.931 1.23e-09 *** basketbal$vyska 0.04633 0.04759 0.974 0.3425 basketbal$hmotnost -0.31683 0.05201 -6.091 7.40e-06 *** basketbal$tuk -0.33671 0.15308 -2.200 0.0404 * Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.943 on 19 degrees of freedom Multiple R-squared: 0.8749, Adjusted R-squared: 0.8551 F-statistic: 44.29 on 3 and 19 DF, p-value: 9.031e-09 > model1<-1m(basketbal$V02_max~basketbal$hmotnost+basketbal$tuk) > summary(model 1) Call : lm(formula = basketbal$V02_max ~ basketbal$hmotnost + basketbal$tuk) Residuals: Min 1Q Median 3Q Max -3.0164 -1.1064 -0.3972 1.1637 4.2497 Coefficients: Estimate Std. Error t value Pr(>|t|) (intercept) 85.96030 3.21533 26.735 < 2e-16 *** basketbal$hmotnost -0.28617 0.04135 -6.921 1.01e-06 *** basketbal$tuk -0.35798 0.15131 -2.366 0.0282 * Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.94 on 20 degrees of freedom Multiple R-squared: 0.8687, Adjusted R-squared: 0.8555 F-statistic: 66.14 on 2 and 20 DF, p-value: 1.528e-09 > anova(model , modeli) Analysis of Variance Table Model 1: basketbal$V02_max ~ basketbal$vyska + basketbal$hmotnost + basketbal$tuk Model 2: basketbal$V02_max ~ basketbal$hmotnost + basketbal$tuk Res.Df RSS Df Sum of Sq F Pr(>F) 1 19 71.694 2 20 75.271 -1 -3.5765 0.9478 0.3425 > par(mfrow=c(2,2)) > piot(model 1) Residuals vs Fitted Normal Q-Q Fitted values Theoretical Quantiles Scale-Location 55 ° S- o 2t> 150 O 0 o 0 í^"~~~~~"~"——__ 0 O 0 0 o I 45 I I 60 55 Fitted values 1 60 > shapi ro.test(model 1$resi dual s) Residuals vs Leverage — Cook's distance 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 Leverage Shapiro-Wilk normality test data: modell$residuals W = 0.96952, p-value = 0.6774 > library(car) > durbinWatsonTest(model 1) lag Autocorrelation D-W Statistic p-value 1 0.02514025 1.927389 0.73 Alternative hypothesis: rho != 0 > confint(model 1) 2.5 % 97.5 % (intercept) 79.2532493 92.66735262 basketbal$hmotnost -0.3724219 -0.19992679 basketbal$tuk -0.6736194 -0.04234917 > vi f(modeli) basketbal$hmotnost basketbal$tuk 1.76264 1.76264 > (MAPE<-100 * mean(abs(modell$residuals/basketbal$V02_max))) [1] 2.753056