?pdf
?pdf
library(ggplot2)
library(optparse)
library(ggplot2)
library(optparse)
boxplot([1,2,3,4,5,6,7,8,9,10])
boxplot(c(1,2,3,4,5,6,7,8,9,10))
boxplot(c(1,2,3,4,5,6,7,8,9,10, 11,12))
boxplot(c(1,2,3,4,5,6,7,8,9,10))
?boxplot
quantile(c(1,2,3,4,5,6,7,8,9,10))
num_list = c(1,2,3,4,5,6,7,8,9,10)
percentile_25 = quantile(num_list)[[2]]
percentile_75 = quantile(num_list)[[4]]
quantile(num_list)
print(percentile_25)
print(percentile_75)
#Generate random data
Y = runif(n = 20)
X = c(rep("a", 10), rep("b", 10))
#Plot
boxplot(Y ~ X)
# Shapiro test of normality (if the data are normal distribution)
tapply(X = Y, INDEX = X, FUN = shapiro.test)
# F-test to compare the variances of our two groups (if the data have equal variance, which means heterogeneity)
var.test(Y ~ X)
#Otherwise, if Shapiro is not signifcant, and if F-test is significant, use Welch:
t.test(Y ~ X)
#If Shapiro is not signifcant, and if F-test is not significant, use Student's
t.test(Y ~ X, var.equal=TRUE)
