Question
I have to use notebook in rstudio program for this question 1. Calculate and report the correlation between SUD_post and SUD_followup. Include: a. A sentence
I have to use notebook in rstudio program for this question
1. Calculate and report the correlation between SUD_post and SUD_followup. Include: a. A sentence and stat block reporting the results of the main analysis. Use inline code and appropriate markdown to incorporate the degrees of freedom and correlation coefficient output directly into the sentence. (Hints: You learnt to save regression models as an object then extract only the residuals in Module 2 - you can do the same thing for cor.test(). The two elements you need to extract from cor.test() are named estimate and parameter. You do not need to adhere to APA guidelines regarding leading zeroes when formatting these two elements, but rounding must be consistent with APA guidelines).
This is what I have done and not sure if i'm on the right track. not sure if the comman id correct or not
{r setup, include = FALSE}
corr_ <- cor.test(formula = ~ SUD_post + SUD_followup, data=therapy_data)
corr_coef <- round(corr_$estimate, digits = 2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started