Hi
I have this df called new_clean_m here.
I used these two libraries
library(tidyvere)
library(readr)
using this code: to calculate the mean, sd, cv within the following group_by conditions
new_ce = new_clean_m %>%
group_by(stim_ending_t, visbility, soundvolume, Opening_text) %>%
summarize(m = mean(key_resp_2.rt),
sd = sd(key_resp_2.rt),
coefVar = cv(key_resp_2.rt))
Q: I need to subtract "stim_ending_t values" from the mean "m" so I can get something called constant error.
Here is what I tried to do this:
df_ce = new_clean_m %>%
group_by(stim_ending_t, visbility, soundvolume, Opening_text) %>%
summarize(m = mean(key_resp_2.rt),
sd = sd(key_resp_2.rt),
ce = (stim_ending_t - m),
coefVar = cv(key_resp_2.rt))
I got the following error: Column `ce` must be length 1 (a summary value), not 210
and this
df_ce = new_clean_m %>%
group_by(stim_ending_t, visbility, soundvolume, Opening_text) %>%
summarize(ce = (stim_ending_t - m))
I got the following error: Error: object 'm' not found