final

.pdf

School

Stevens Institute Of Technology *

*We aren’t endorsed by this school

Course

222

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

25

Uploaded by JudgeRainMeerkat32

Report
Section 2 - Details of our Study We begin by reading our data: library(readxl) biomark <- read_excel( "Biomark.xls" ) voplus = biomark$voplus vominus = biomark$vominus oc = biomark$oc trap = biomark$trap knitr::kable(head(biomark)) voplus vominus oc loc trap ltrap lvoplus lvominus 1606 903 68.9 4.232656 19.4 2.965 7.382 6.806 2240 1761 56.3 4.030695 25.5 3.239 7.714 7.474 2221 1486 54.6 4.000034 19.0 2.944 7.706 7.304 896 1116 31.2 3.440418 9.0 2.197 6.798 7.018 2545 2236 36.4 3.594569 19.1 2.950 7.842 7.712 878 954 31.4 3.446808 14.6 2.681 6.778 6.861 Problem 11.36 a. #Numerical Analyses #VO+ Numerical Summary favstats(~ voplus, data= biomark) ## min Q1 median Q3 max mean sd n missing ## 285 542.5 870 1188.5 2545 985.8065 579.8581 31 0 #VO- Numerical Summary favstats(~ vominus, data= biomark) ## min Q1 median Q3 max mean sd n missing ## 254 554 903 1023 2236 889.1935 427.6161 31 0 #OC Numerical Summary favstats(~ oc, data= biomark) ## min Q1 median Q3 max mean sd n missing ## 8.1 18.6 30.2 46.05 77.9 33.41613 19.60974 31 0 #Trap Numerical Summary favstats(~ trap, data= biomark) ## min Q1 median Q3 max mean sd n missing ## 3.3 8.9 10.3 18.8 28.8 13.24839 6.52824 31 0 Now for the Graphical Analayses: hist(voplus) densityplot(~ voplus, data= biomark, main = "Density Plot of VO+" ) 1
Histogram of voplus voplus Frequency 0 1000 2000 3000 0 4 8 12 Density Plot of VO+ voplus Density 0e+00 2e-04 4e-04 6e-04 8e-04 0 1000 2000 3000 The plots of VO+ appear to be slightly right skewed as shown above hist(vominus) densityplot(~ vominus, data= biomark, main = "Density Plot of VO-" ) Histogram of vominus vominus Frequency 0 500 1500 2500 0 5 10 15 Density Plot of VO- vominus Density 0.0000 0.0002 0.0004 0.0006 0.0008 0.0010 0 500 1500 2500 The plots of VO- appear to be fairly symmetric with a slight right skew as shown above hist(oc) densityplot(~ oc, data= biomark, main = "Density Plot of OC" ) 2
Histogram of oc oc Frequency 0 20 40 60 80 0 2 4 6 8 Density Plot of OC oc Density 0.000 0.005 0.010 0.015 0.020 0 50 100 The plots of OC appear to be right skewed as shown above hist(trap) densityplot(~ trap, data= biomark, main = "Density Plot of Trap" ) Histogram of trap trap Frequency 0 5 15 25 0 4 8 12 Density Plot of Trap trap Density 0.00 0.02 0.04 0.06 0 10 20 30 The plots of Trap appear to be right skewed as shown above b. The potential correlation checked pair by pair: smallbio = subset(biomark, select= c( "voplus" , "vominus" , "oc" , "trap" )) with(biomark, cor(smallbio)) ## voplus vominus oc trap ## voplus 1.0000000 0.8957707 0.6596140 0.7648649 ## vominus 0.8957707 1.0000000 0.4547603 0.6779267 ## oc 0.6596140 0.4547603 1.0000000 0.7298519 ## trap 0.7648649 0.6779267 0.7298519 1.0000000 We can also display this data graphically: pairs(smallbio, pch= "." ) 3
voplus 500 500 2000 5 20 500 2000 vominus oc 10 40 70 5 15 25 500 10 60 trap After numerical and graphical analysis of these relationships, we learn the following: VO+ and VO- have a strong positive relationship VO+ and OC have a moderately positive relationship VO+ and Trap have a strong positive relationship VO- and OC have a weak positive relationship VO- and Trap have a moderately positive relationship OC and Trap have a fairly strong positive relationship (numerically) Problem 11.37 a. simpleOC <- lm(voplus ~ oc, data= biomark) summary.lm(simpleOC) ## ## Call: ## lm(formula = voplus ~ oc, data = biomark) ## ## Residuals: ## Min 1Q Median 3Q Max ## -727.45 -234.43 -85.08 43.66 1500.99 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 334.034 159.241 2.098 0.0448 * ## oc 19.505 4.127 4.726 5.43e-05 *** ## --- ## Signif. codes: 0 ' *** ' 0.001 ' ** ' 0.01 ' * ' 0.05 ' . ' 0.1 ' ' 1 ## ## Residual standard error: 443.3 on 29 degrees of freedom ## Multiple R-squared: 0.4351, Adjusted R-squared: 0.4156 ## F-statistic: 22.34 on 1 and 29 DF, p-value: 5.429e-05 plot(voplus ~ oc, data= biomark, main= "VO+ ~ OC" ) abline(simpleOC) 4
10 30 50 70 500 1500 VO+ ~ OC oc voplus Our linear regression equation is: [ VO+ = 334 . 034 + 19 . 505 OC H 0 : β 1 = 0 , there is no linear association between VO+ and OC. H a : β 1 ̸ = 0 , there is a substantial linear association between VO+ and OC. As shown in the summary, t = 4 . 726 and P = 5 . 43 10 5 < 0 . 05 , so we reject the null hypothesis, concluding that there is enough evidence against the consistency to say that there is a statistically significant linear association between VO+ and OC. Now, to analyze the residuals: plot(simpleOC, which= 1 ) abline( h= 0 ) plot(simpleOC, which= 2 ) hist(residuals(simpleOC)) 600 1000 1600 -1000 500 Fitted values Residuals lm(voplus ~ oc) Residuals vs Fitted 5 32 -2 -1 0 1 2 -2 0 2 4 Theoretical Quantiles Standardized residuals lm(voplus ~ oc) Normal Q-Q 5 3 2 Histogram of residuals(simpleO residuals(simpleOC) Frequency -1000 0 1000 2000 0 5 10 As shown in the Residual plot, there appears to be a curve. Also, in the Q-Q Plot of the residuals, the data appears to curve off in the extremities. Normal Q-Q plots that exhibit this behavior usually mean the data has more extreme values than would be expected if they truly came from a Normal distribution. The histogram also appears to be slightly right skewed. 5
b. OCTrapLM <- lm(voplus ~ oc + trap, data= biomark) summary.lm(OCTrapLM) ## ## Call: ## lm(formula = voplus ~ oc + trap, data = biomark) ## ## Residuals: ## Min 1Q Median 3Q Max ## -708.2 -198.6 -100.2 125.8 1224.8 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 57.704 156.539 0.369 0.71518 ## oc 6.415 5.125 1.252 0.22102 ## trap 53.874 15.393 3.500 0.00158 ** ## --- ## Signif. codes: 0 ' *** ' 0.001 ' ** ' 0.01 ' * ' 0.05 ' . ' 0.1 ' ' 1 ## ## Residual standard error: 376.3 on 28 degrees of freedom ## Multiple R-squared: 0.607, Adjusted R-squared: 0.5789 ## F-statistic: 21.62 on 2 and 28 DF, p-value: 2.096e-06 Our linear regression model is: [ VO+ = 57 . 704 + 6 . 415 OC + 53 . 874 TRAP H 0 : β 1 = β 2 = 0 , there is no linear association between VO+ and OC/Trap (respectively). H a : β 1 ̸ = 0 , β 2 ̸ = 0 , there is a substantial linear association between VO+ and OC/Trap (respectively). For the coefficient of Trap, as shown in the summary, t = 3 . 5 and P = 0 . 00158 < 0 . 05 , so we reject the null hypothesis, concluding that there is enough evidence against the consistency to say that there is a statistically significant linear association between VO+ and Trap. However, for the coefficient of OC, we fail to reject the null hypothesis because t = 1 . 252 and P = 0 . 22102 > 0 . 05 . Thus, we conclude there is not enough evidence against the consistency to say that there is a substantial linear association between VO+ and OC. These results align with our findings in Problem 11.36. We can conclude from these tests that the coefficient of OC is not significantly different from 0 whereas the coefficient of Trap is significantly different from 0. Problem 11.38 a. \ V O + = β 0 + β 1 ( OC ) + β 2 ( TRAP ) + β 3 ( V O ) + ϵ i b. allLM <- lm(voplus ~ oc + trap + vominus, data= biomark) summary.lm(allLM) ## ## Call: ## lm(formula = voplus ~ oc + trap + vominus, data = biomark) ## ## Residuals: ## Min 1Q Median 3Q Max 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help