class: center, middle, inverse, title-slide .title[ #
My Analysis
] .subtitle[ ##
required height of catheters
] .author[ ###
Yuanqi Zhang
] .institute[ ###
West Chester University of Pennsylvania
] .date[ ###
09/20/2022
] --- class: inverse, middle <!-- This sets the background color to black and align the text in the slide --> <!-- Comments must be placed after the line of the page of configuration and also be placed in separate lines. --> <!-- use "---" to close each slide --> <!-- not comments should placed immediately before "---" --> #For 12 young patients, catheters were fed from a principal vein #into the heart. The necessary catheter length was measured. #The height and weight of the patients was noted. We want to know does weight and height increase the length of the size of the catheter needed for patients. --- # <center>The importance of correct length</center> <iframe width="470" height="500" src="https://www.youtube.com/embed/-RysxIAgT7c"></iframe> ```r read.table("https://people.sc.fsu.edu/~jburkardt/datasets/regression/x02.txt", skip = 36) ``` ``` # V1 V2 V3 V4 # 1 1 42.8 40.0 37 # 2 2 63.5 93.5 50 # 3 3 37.5 35.5 34 # 4 4 39.5 30.0 36 # 5 5 45.5 52.0 43 # 6 6 38.5 17.0 28 # 7 7 43.0 38.5 37 # 8 8 22.5 8.5 20 # 9 9 37.0 33.0 34 # 10 10 23.5 9.5 30 # 11 11 33.0 21.0 38 # 12 12 58.0 79.0 47 ``` ```r myRegDat = read.table("https://people.sc.fsu.edu/~jburkardt/datasets/regression/x02.txt", skip = 36) names(myRegDat) = c("ID", "Weight", "height", "length") ``` --- # <center>Specified names</center> ```r fit = lm(length~ height + Weight, data = myRegDat) names(myRegDat) = c("ID", "Weight", "height", "length") myRegDat ``` ``` ID Weight height length 1 1 42.8 40.0 37 2 2 63.5 93.5 50 3 3 37.5 35.5 34 4 4 39.5 30.0 36 5 5 45.5 52.0 43 6 6 38.5 17.0 28 7 7 43.0 38.5 37 8 8 22.5 8.5 20 9 9 37.0 33.0 34 10 10 23.5 9.5 30 11 11 33.0 21.0 38 12 12 58.0 79.0 47 ``` ```r # ``` --- ```r qqnorm(myRegDat$length, pch = 1, frame = FALSE) qqline(myRegDat$length, col = "steelblue", lwd = 2) ``` <!-- --> --- # <center>R Plots</center> # We can see from our QQplot that most of the points are close to the line except that they veer off towards the end a little bit which we can assume the data is normally distributed# --- class: inverse, center, middle ```r plot(myRegDat, pch = 19, col = 'darkgray', las = 1) abline(fit, lwd = 1) ``` ``` # Warning in abline(fit, lwd = 1): only using the first two of 3 regression # coefficients ``` <!-- --> --- # <center>R Plots</center> # These are our results and p-values in order to see whether the explanatory variables are statistically significant. The standard error is the difference between our observed results and predicted results. We want to see how much does height and weight affect the length of the catheter that a patient requires. # --- ```r fit = lm(length~ height + Weight, data = myRegDat) summary(fit) ``` ``` # # Call: # lm(formula = length ~ height + Weight, data = myRegDat) # # Residuals: # Min 1Q Median 3Q Max # -6.7419 -1.2034 -0.2595 1.8892 6.6566 # # Coefficients: # Estimate Std. Error t value Pr(>|t|) # (Intercept) 20.3758 8.3859 2.430 0.038 * # height 0.1911 0.1583 1.207 0.258 # Weight 0.2107 0.3455 0.610 0.557 # --- # Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # # Residual standard error: 3.778 on 9 degrees of freedom # Multiple R-squared: 0.8254, Adjusted R-squared: 0.7865 # F-statistic: 21.27 on 2 and 9 DF, p-value: 0.0003888 ``` --- ```r fit2 = lm(length~ height + Weight + height:Weight, data = myRegDat) summary(fit2) ``` ``` # # Call: # lm(formula = length ~ height + Weight + height:Weight, data = myRegDat) # # Residuals: # Min 1Q Median 3Q Max # -5.4645 -1.8159 -0.4652 1.3364 6.7443 # # Coefficients: # Estimate Std. Error t value Pr(>|t|) # (Intercept) 18.567582 8.410597 2.208 0.0583 . # height 0.523401 0.332306 1.575 0.1539 # Weight 0.147821 0.344757 0.429 0.6794 # height:Weight -0.004591 0.004054 -1.132 0.2903 # --- # Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # # Residual standard error: 3.72 on 8 degrees of freedom # Multiple R-squared: 0.8495, Adjusted R-squared: 0.793 # F-statistic: 15.05 on 3 and 8 DF, p-value: 0.001185 ``` --- # <center>Conclusion ---Since the p-value for the interaction effect is too large, we can say that there is not a significant relationship between height and weight after controlling for weight and vice versa. Since the p-value was not statistically significant, we may be better off without adding the interaction effect in our model. class: center, middle -It is important to find the right catheter length according to the patient's weight and height otherwise they may be uncomfortable or cause pain if its too big. If its too small, it can cause leaks or it may take a while to drain liquid, while patients prepare for bladder surgery. Also, as height increases by one, the catheter height increases on average by about .191 while holding weight constant As weight increases by one, the catheter height increases by about .21 on average while holding height constant. However, our results are statistically insignificant because our p-values are below .05.Also, our final model is length = height*X1 + weight*X2 ---