hw5

.pdf

School

San Francisco State University *

*We aren’t endorsed by this school

Course

119

Subject

Statistics

Date

Apr 3, 2024

Type

pdf

Pages

9

Uploaded by HighnessKingfisher388

HW5 Maritza Romero 12/05/22 HW 05 - Introduction (100 pts). Assignment Overview The purpose of this assignment is to review ANOVA, correlation and simple linear regression. Instructions You will answer the questions directly in the Rmarkdown template file provided. Please change your name in the template file. How to insert R code chunks: You can quickly insert chunks into your R Markdown file with the keyboard shortcut Cmd + Option + I (Windows Ctrl + Alt + I). You can knit a PDF and upload the final pdf file to BB learn. Background information The American Psychological Association defines resilience as “the process of adapting well in the face of adversity, trauma, tragedy, threats or even significant sources of stress”. Resilience refers to a person’s capacity to resist adversity and is closely related to qualities such as self-confidence and persistence. Studies have suggested that resilience is an important factor in contributing to how medical students perceive their quality of life and educational environment. Survey data were collected from 1,350 students across 25 medical schools in the United States as part of a study examining the life of students and residents in healthcare professions. At each school, 54 students were randomly selected to participate in the study. Participants completed assessments measuring resilience, quality of life, perception of educational environment, depression symptoms, and anxiety symptoms. The variables related to this assignment are listed below. age . age in years. Resilience . Higher scores on the resilience assessment are indicative of greater resilience; possible scores range from 14 to 98. The scores are reported according to a standardized scale: very low (14 to 56 points), low (57 to 64 points), moderately low (65 to 73 points), moderately high (74 to 81 points), high (82 to 90 points), and very high (91 to 98 points). Depression Symptoms . The BDI questionnaire was used to assess depressive symptoms. Possible scores vary from 0 to 63, with higher scores indicating either more numerous or more severe depressive symptoms. Quality of Life . Quality of life was assessed via three measures: overall quality of life (overall QoL), medical school quality of life (MSQoL), and a questionnaire from the World Health Organization (WHOQOL). For the overall QoL and MSQoL, students were asked to rate, on a scale from 0 to 10 with a higher score indicating better QoL, their overall quality of life and their quality of life in medical school. The WHOQOL is a 26-question survey measuring quality of life in four domains (environment, 1
psychological health, social relationships, and physical health); participant responses to questions such as “Do you have enough energy for everyday life?” and “How well are you able to concentrate?” are converted to a 0 to 100 point score for each domain, with higher scores representing better quality of life. Part I: ANOVA (30 points) The question for this part is to investigate whether the mean scores for BDI (bdi) is the same across different levels of resilience groups (res). . Create a plot illustrating the relationship between resilience and depressive symptoms. Describe what you see. (Hint: try a boxplot) boxplot(resilience$bdi ~ resilience$res, ylab = "Depressive Symptoms" , xlab = "Resilience Levels" ) High Low ModHigh ModLow VeryHigh VeryLow 0 10 20 30 40 Resilience Levels Depressive Symptoms ii. Conduct a formal analysis of the relationship between resilience and depressive symptoms. Summarize your findings. You may proceed with ANOVA without checking assumptions for this sub-question. (Hint: use the aov() and summary() functions) summary(aov(resilience$bdi ~ resilience$res)) ## Df Sum Sq Mean Sq F value Pr(>F) 2
## resilience$res 5 20325 4065 118.1 <2e-16 *** ## Residuals 1344 46260 34 ## --- ## Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 iii. If the result from part I (ii) is significant, please proceed to pairwise comparisons to find out which pair(s) of groups have mean scores of BDI different from each other. (Hint: use the pairwise.t.test( ) function in R ) pairwise.t.test(resilience$bdi, resilience$res, p.adj = "none" ) ## ## Pairwise comparisons using t tests with pooled SD ## ## data: resilience$bdi and resilience$res ## ## High Low ModHigh ModLow VeryHigh ## Low < 2e-16 - - - - ## ModHigh 2.2e-06 3.0e-14 - - - ## ModLow < 2e-16 1e-04 6.2e-06 - - ## VeryHigh 4.6e-06 < 2e-16 2.5e-16 < 2e-16 - ## VeryLow < 2e-16 1.9e-11 < 2e-16 < 2e-16 < 2e-16 ## ## P value adjustment method: none Part II: Correlation (Total 25 points) Investigate whether there is a correlation between BDI (bdi) and quality of life as measured by the psychological health domain of the WHOQOL (whoqol.psych). i. Create a plot illustrating the relationship between bdi and whoqol.psych. Describe what you see. (5 pts) (Hint: try a scatter plot) x <- resilience$whoqol.psych y <- resilience$bdi plot(x,y, main = "Quality of life vs. BDI" , xlab = "BDI" , ylab = "Quality of life" ) 3
0 20 40 60 80 100 0 10 20 30 40 Quality of life vs. BDI BDI Quality of life ii. Calculate the pearson correlation coefficient r using R, and conduct a hypothesis test to see whether the population correlation between BDI and quality of life as measured by the psychological health domain of the WHOQOL (whoqol.psych) is equal to 0. Report the test statistic, p value, and your conclusion. (10 pts) (Hint: use the cor.test() function in R) cor.test(resilience$bdi, resilience$whoqol.psych) ## ## Pearson’s product-moment correlation ## ## data: resilience$bdi and resilience$whoqol.psych ## t = -40.243, df = 1348, p-value < 2.2e-16 ## alternative hypothesis: true correlation is not equal to 0 ## 95 percent confidence interval: ## -0.7620606 -0.7135140 ## sample estimates: ## cor ## -0.738744 iii. Find out the 95% confidence interval for population correlation between BDI and quality of life as mea- sured by the psychological health domain of the WHOQOL (whoqol.psych) and write your conclusion in a sentence. (10 pts) (hint: you should find your answer from the R output of part 1 (ii)) (-0.7620606, -0.7135140) 4
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