Inspector <- c (1:12)
Inspector <- as.character(Inspector)
Caliper1 <- c(0.265,0.265,0.266,0.267,0.267,0.265,0.267,0.267,0.265,0.268,0.268,0.265)
Caliper2 <- c(0.264,0.265,0.264,0.266,0.267,0.268,0.264,0.265,0.265,0.267,0.268,0.269)
dat1 <- cbind(Inspector,Caliper1,Caliper2)
dat1 <- as.data.frame(dat1)
str(dat1)
## 'data.frame': 12 obs. of 3 variables:
## $ Inspector: chr "1" "2" "3" "4" ...
## $ Caliper1 : chr "0.265" "0.265" "0.266" "0.267" ...
## $ Caliper2 : chr "0.264" "0.265" "0.264" "0.266" ...
dat1$Caliper1 <- as.numeric(dat1$Caliper1)
dat1$Caliper2 <- as.numeric(dat1$Caliper2)
cor(Caliper1,Caliper2)
## [1] 0.1276307
Hence , Lets check if we can go with Two Sample T Test.
qqnorm(Caliper1,main="NPP for Caliper 1")
qqline(Caliper1)
qqnorm(Caliper2,main="NPP for Caliper 2")
qqline(Caliper2)
boxplot(Caliper1,Caliper2)
library(dplyr)
t.test(dat1$Caliper1,dat1$Caliper2,alternative="two.sided",var.equal = TRUE)
##
## Two Sample t-test
##
## data: dat1$Caliper1 and dat1$Caliper2
## t = 0.40519, df = 22, p-value = 0.6893
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.001029568 0.001529568
## sample estimates:
## mean of x mean of y
## 0.26625 0.26600
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
str(dat2)
library(dplyr)
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
str(dat2)
## 'data.frame': 9 obs. of 3 variables:
## $ grider: Factor w/ 8 levels "S1/1","S2/1",..: 1 2 6 7 8 2 3 4 5
## $ K : num 1.19 1.15 1.32 1.34 1.2 ...
## $ L : num 1.061 0.992 1.063 1.062 1.065 ...
cor(dat2$K,dat2$L)
## [1] 0.3821669
t.test(dat2$K,dat2$L,alternative="two.sided",paired = TRUE)
##
## Paired t-test
##
## data: dat2$K and dat2$L
## t = 6.0819, df = 8, p-value = 0.0002953
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.1700423 0.3777355
## sample estimates:
## mean of the differences
## 0.2738889
qqnorm(dat2$K,main="Karlsruhe Method")
qqline(dat2$K)
qqnorm(dat2$L,main = "Lehigh Method")
qqline(dat2$L)
qqnorm(dat2$K-dat2$L)
qqline(dat2$K-dat2$L)
Thick95<-c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315)
Thick100<-c(5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
dat3 <-cbind(Thick100,Thick95)
dat3 <- as.data.frame(dat3)
t.test(Thick95,Thick100,var.equal = TRUE,alternative = "greater")
##
## Two Sample t-test
##
## data: Thick95 and Thick100
## t = 2.6751, df = 14, p-value = 0.009059
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 0.8608158 Inf
## sample estimates:
## mean of x mean of y
## 9.366625 6.846625
qqnorm(dat3$Thick100,main="NPP for Thick 100")
qqline(dat3$Thick100)
qqnorm(dat3$Thick95, main = "NPP for Thick 95")
qqline(dat3$Thick95)
library(pwr)
power.t.test(n=8,delta=2.5,sd=1.866,sig.level = 0.05,power=NULL,type = "two.sample",alternative = "one.sided")
##
## Two-sample t test power calculation
##
## n = 8
## delta = 2.5
## sd = 1.866
## sig.level = 0.05
## power = 0.8164169
## alternative = one.sided
##
## NOTE: n is number in *each* group
flow125 <- c(2.7,4.6,2.6,3.0,3.2,3.8)
flow200 <- c(4.6,3.4,2.9,3.5,4.1,5.1)
wilcox.test(flow125,flow200)
## Warning in wilcox.test.default(flow125, flow200): cannot compute exact p-value
## with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: flow125 and flow200
## W = 9.5, p-value = 0.1994
## alternative hypothesis: true location shift is not equal to 0