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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Psychology Questions!