Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- ## two samples t-test
- df1 <- ... # independent variables
- df2 <- ... # dependent paired variables (time course or different measures on the same person)
- t.test(df1$LI~df2$HQ) # for long format datasets, group variable after the ~
- df1[df1$HQ == 'RH', 1] # dataset of one variable
- rh <- df1$LI[df1$HQ == 'RH'] # vector
- lh <- df1$LI[df1$HQ == 'LH']
- shapiro.test(lh) # are these distributions normal?
- shapiro.test(rh)
- t.test(lh, rh) # for normal distributions
- wilcox.test(lh, rh) # forn not normal distributions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement