I´m very new to R and am working with EEG´s derived from sleeping patients. Now I have a table similar to this:
ID C3-M2 C4-M1 Disorder
12 347 325 Control
13 397 346 Bipolar
14 368 363 Control
15 370 379 Control
16 368 310 Bipolar
Because I needed the mean value of C3-M2 and C4-M1 I created a vector:
fast_spin_numb <- c((`C3-M2`+ `C4-M1`)/2)
fast_spin_numb therefore should contain 5 values.
Now I would like to create two separate vectors of which fast_spin_bipo should contain only the means of the bipolar patients and fast_spin_cont only the means of the controls.
I have tried it with
split(fast_spin_numb, disorder == "control", drop = FALSE)
but I couldn't find a solution how to put the numbers automatically into new vectors.
As well I have tried this:
tapply(fast_spin_numb, disorder, shapiro.test)
which allows me at least to run some tests. But it doesn't help me with creating a qqplot
(only for controls) for example.
Thank you very very much already!!