Question: Q 2 Create a 2 x 2 dataframe that shows the average number of times per week a person exercised for both those who had

Q2 Create a 2x2 dataframe that shows the average number of times per week a person exercised for both those who had a stroke and those who didn't.
- Summarize the average in a variable called `exer_avg`.
- The output should be a dataframe assigned to Q2 and look something like this:
```
CVDSTRK3 exer_avg
1
24.17
```
```{r}
### Do not edit the following line. It is used by CodeGrade.
# CG Q2 #
### TYPE YOUR CODE BELOW ###
Q2<- brf |>
filter(CVDSTRK3>=1 & CVDSTRK3<=2)|>
filter(EXEROFT1>=101 & EXEROFT1<=199)|>
group_by(CVDSTRK3)|>
summarise(exer_avg = mean(EX
this what I got so far , wrong results it's in R not Python
CVDSTRK3
1104.6944
exer_avg
2104.1656

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 Programming Questions!