#1
shapiro.test(X) # Тест Шапиро Pvalue<alfa=0.05 гипотезу о нормальности отвергаем
#2
library(ggpubr)
ggdensity(X,main = "Density plot of X", xlab = "X")
glot(X)gqqp
#3
library(nortest) # Библиотека для pearson.test и lillie.test
pearson.test(X$V1) # Пирсон
lillie.test(X$V1)
#4
library("sm") # Для sm.density
sm.density(X$V1, model = "Normal") # Попадаем ли в синий коридор..
#MAC:
x <- as.numeric(read.delim(pipe("pbpaste"), header = F, sep = ","))
#PC:
x<- as.numeric(read.delim("clipboard", header = F, sep = ","))
#delete NAN and string values
y <- na.omit(x)
R: z.test() (from BSDA package)
Excel: Z.TEST(array, μ₀, σ) Data Analysis: One-sample z-test
R: t.test(x, mu = μ₀)
Excel: T.TEST(array, μ₀, tails, type=1) Data Analysis: One-sample t-test
R: z.test(x, y, sigma.x=σ₁, sigma.y=σ₂)
Excel: Two-sample z-test
R: t.test(x, y, var.equal=TRUE)
Excel: T.TEST(array1, array2, tails, type=2) Data Analysis: Student's t-test (equal variances)
t.test(x, y, var.equal=FALSE)
Example: Test the null hypothesis H0: E(X)=E(Y) without the assumption of equality of variances at significance level α=0.02 against the alternative H1: E(X)>E(Y)
t.test(X,Y, alternative="greater", var.equal=FALSE, conf.level=0.98)
Excel: T.TEST(array1, array2, tails, type=3) Data Analysis: Welch’s t-test (unequal variances)
t.test(x, y, paired=TRUE)
Excel: T.TEST(array1, array2, tails, type=1) Data Analysis: Paired t-test
var.test(x, y)
Example: Test the null hypothesis H0: Var(X)=Var(Y) at significance level α=0.05 against the alternative H1: Var(X)≠Var(Y). var.test(x,y, alternative='two.sided' )
Excel: F.TEST(array1, array2) Data Analysis: F-test (Fisher’s test)
prop.test(c(x_succ, y_succ), c(n₁, n₂))
Excel: Z-test for proportions
cor.test(x, y, method="pearson")
Example: Test the hypothesis for insignificance of correlation coefficient ρ (i.e. H0: ρ=0 against the alternative H1: ρ≠0) cor.test(x, y, alternative = "two.sided")
Excel: PEARSON(array1, array2) + T.DIST for p-value Data Analysis: Pearson correlation test