so ive been trying to analyse my non parametric data for a while however I cant seem to get it to work - basically I've been trying to run a post hoc to a kruskal wallis test. however I don't know whats wrong whether its my data layout of my inputs
Stat.testFvFm0N1 <- FvFm0N %>%
wilcox.test(D0 ~ D1, paired = TRUE) %>% add_significance()
Error in wilcox.test.default(., D0 ~ D1, paired = TRUE) :
'x' must be numeric
Stat.testFvFm0H1 <- FvFm0H %>% wilcox.test(D0 ~ D1, paired = TRUE) %>% add_significance()
Error in wilcox.test.default(., D0 ~ D1, paired = TRUE) :
'x' must be numeric
Stat.testFvFm0H1 <- FvFm0H %>% wilcox.test(FvFm ~ D0*D1, paired = TRUE) %>% add_significance()
Error in wilcox.test.default(., FvFm ~ D0 * D1, paired = TRUE) :
'x' must be numeric
Stat.testFvFm0H1 <- FvFm0H %>% wilcox.test(FvFm ~ Day, paired = TRUE) %>% add_significance()
Error in wilcox.test.default(., FvFm ~ Day, paired = TRUE) :
'x' must be numeric
Stat.testFvFm0H1 <- FvFm0H %>% group_by(Day) %>% wilcox.test(FvFm ~ Day, paired = TRUE) %>% add_significance()
Error: Must group by variables found in .data.
Column Day is not found.
Run rlang::last_error() to see where the error occurred.
Stat.testFvFm0H1 <- FvFm0H %>% group_by("Day") %>% wilcox.test(FvFm ~ Day, paired = TRUE) %>% add_significance()
Error in wilcox.test.default(., FvFm ~ Day, paired = TRUE) :
'x' must be numeric
I've split my data up into different conditions for the exact same IPAM parameter to do a paired test between the days, however I don't know whats going on because my data points are numeric except there are more then two data sets in the table but can't seem to focus in on two at a time - I just don't want to have to keep importing data sets with less data in
D0 D1 D2 D3 D4 D5 D6 D7
1 0.163457469 0.187385368 0.136679322 0.10488145 0.110073797 0.095678447 0.094178232 0.106127771
2 0.142494136 0.181154612 0.143094261 0.105833764 0.104921535 0.097943358 0.087377843 0.104797048
3 0.131960693 0.175194359 0.149937526 0.114355231 0.095977698 0.083587252 0.088176672 0.105426727
this is how my data is laid out originally or I've tried to make the data long and that hasn't worked either
require(graphics)
## One-sample test.
## Hollander & Wolfe (1973), 29f.
## Hamilton depression scale factor measurements in 9 patients with
## mixed anxiety and depression, taken at the first (x) and second
## (y) visit after initiation of a therapy (administration of a
## tranquilizer).
x <- c(1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)
depression <- data.frame(first = x, second = y, change = y - x)
wilcox.test(change ~ 1, data = depression) #works
library(magrittr)
depression %>% wilcox.test(change ~ 1) #doesnt work, dont assume that data= is first param which is what the pipe relies on by default
depression %>% wilcox.test(data=.,change ~ 1) #works again use . to play the result of piping
Its ok Ive sorted it, instead of going through each time and writing X and Y values if there a way to exact certain values from my table and put them into a new data frame? i know how to merg data frames but not copy over, if this makes sense so i want the data to stay in the original data frame but also want to make a new data frame with them in