I have a test datafile
I would like to run a t test.
This will work, which I already know
t.test(df_test$clin_value ~ df_test$trt_variable)
But I would like to do this:
trt_var = "trt_variable"
noquote(trt_var) # which gives me trt_variable
why I can not run this?
t.test(df_test$clin_value ~ df_test$(noquote(trt_var)))
How can I make this work?
I have to do this way, because I would like to change trt_var constantly.