Q: Issues with var.test We are using the var.test() function in R e.g:
T1<-rnorm(255,mean=1.432,sd=0.255)
T2<-rnorm(256,mean=1.485,sd=0.251)
var.test(T1,T2)

# F test to compare two variances
# 
# data:  T1 and T2
# F = 1.1027, num df = 254, denom df = 255, p-value = 0.436
# alternative hypothesis: true ratio of variances is not equal to 1
# 95 percent confidence interval:
#   0.8620164 1.4106568
# sample estimates:
#   ratio of variances 
# 1.102695 

However, when we rerun the test using the same data we get very different results e.g:
T1<-rnorm(255,mean=1.432,sd=0.255)
T2<-rnorm(256,mean=1.485,sd=0.251)
var.test(T1,T2)

# F test to compare two variances
# 
# data:  T1 and T2
# F = 0.79853, num df = 254, denom df = 255, p-value = 0.07334
# alternative hypothesis: true ratio of variances is not equal to 1
# 95 percent confidence interval:
#   0.6242396 1.0215441
# sample estimates:
#   ratio of variances 
# 0.7985297 

Why does this happen? Are we doing something wrong?
We have multiple data sets to analyse & we need to understand what is happening.

A: To make your analyzes reproducible you may use set.seed, which specifies the seed of the R-random number generator.
set.seed(42)  # set seed
T1 <- rnorm(255, mean=1.432, sd=0.255)
T2 <- rnorm(256, mean=1.485, sd=0.251)
var.test(T1, T2)

# same seed - same result
set.seed(42)
T1 <- rnorm(255, mean=1.432, sd=0.255)
T2 <- rnorm(256, mean=1.485, sd=0.251)
var.test(T1, T2)

# different seed - different result 
set.seed(123)
T1 <- rnorm(255, mean=1.432, sd=0.255)
T2 <- rnorm(256, mean=1.485, sd=0.251)
var.test(T1, T2)

