I'm working on improving my skills for R and I'm quite confused on how to do this
clean_data <- data.frame %>%
drop_na()
# Calculate means for each group
group_means <- clean_data %>%
group_by(height) %>%
summarise_all(mean)
# Print the group means
print(group_means)
# Calculate the difference between the two variables
data <- group_means %>%
mutate(difference = 1 - 2)
# Print the updated data with the difference
print(data)
row_diff <- group_means[1, ] - group_means[2, ]
# Print the differences
print(row_diff)
I'm not sure how to do the t-test part and is the above code correct. Do you guys have any recommendations on how a beginner can get better really quick. Thanks for the help