Consider performing a statistical hypothesis test and wants to achieve significance $\alpha$. What is a good rule of thumb for an allowable deviation from the desired confidence level?
Say I want to perform a hypothesis test with $\alpha=0.05$, but given the actual nature of the underlying processes and test applied, the true probability of type I error is $0.01$ or $0.10$, is this generally acceptable? Surely there are at least a few widely agreed upon standards for what decision from desired $\alpha$ is acceptable.
As an example, I've been investigating one-way ANOVA, to test the interaction of unequal variance, non-normality, and unequal sample sizes on the actual probability of rejecting the hypothesis of equal means. As long as the population variances are within a factor of even 10 of each other (for normal, factor of 4 seems good even for exponential) then it does seem to give significance close to the desired level. I also find that the populations with large variance having the same or larger sample size (but not like an order of magnitude larger) as compared to the populations with smaller variance, then it is also fairly robust still. The true probability of type I error is usually from $1\%$ to $10\%$ when actually shooting for a $5\%$ level, if these factors are controlled reasonably.
My gut tells me that a deviation of $\pm 3\%$ or so from a desired level of $5\%$ would be acceptable.
So the question is: what deviation from $\alpha$ is generally acceptable for hypothesis tests?
Here is my (probably very inefficient) R code for investigating 1-way anova with deviations from normality and equal variances:
NS=10000
sstrd=vector("numeric",length=NS)
ssed=sstrd
sstd=sstrd
nv=round(c(5+runif(1)*10,
5+runif(1)*10,
5+runif(1)*10,
5+runif(1)*10))
mv=c(0,0,0,0)
sv=c(1,1+runif(1)*1.5,1+runif(1)*2,1+runif(1)*3)
for (ns in 1:NS){
x1=rnorm(nv[1],mv[1],sv[1]) #rexp(nv[1],1/sv[1])-sv[1] #
x2=rnorm(nv[2],mv[2],sv[2]) #rexp(nv[2],1/sv[2])-sv[2]
x3=rnorm(nv[3],mv[3],sv[3]) #rexp(nv[3],1/sv[3])-sv[3]
x4=rnorm(nv[4],mv[4],sv[4]) #rexp(nv[4],1/sv[4])-sv[4]
data=c(x1,x2,x3,x4)
group=c(rep("A1",length(x1)),rep("A2",length(x2)),rep("A3",length(x3)),rep("A4",length(x4)))
group=as.factor(group)
xdd=mean(data)
SST=sum((data-xdd)^2)
g=levels(group)
k=length(g)
n=length(data)
nvec=as.numeric(table(group))
SSTr=0
xd=vector("numeric",length=length(g))
for (i in 1:length(g)){
xd[i]=mean(data[group==g[i]])
SSTr=SSTr+nvec[i]*(xd[i]-xdd)^2
}
xdvec=NULL
for (i in 1:length(g)){
xdvec=c(xdvec,rep(xd[i],nvec[i]))
}
SSE=sum((data-xdvec)^2)
pv=nv/sum(nv)
spvm=c(sum(pv[c(2,3,4)]),sum(pv[c(1,3,4)]),sum(pv[c(1,2,4)]),sum(pv[c(1,2,3)]))
sta=sum(sv^2*((1-pv)^2+pv*spvm))
sstrd[ns]=SSTr
sstd[ns]=SST
ssed[ns]=SSE
}
sta
c(mean(sstd),sd(sstd))
c(mean(sstrd),sd(sstrd))
c(mean(ssed),sd(ssed))
f=(sstrd/3)/(ssed/(sum(nv)-4))
plot(ecdf(f))
xv=seq(0,max(f),length=1000)
lines(xv,pf(xv,3,sum(nv)-4),col="red")
1-sum(f<=qf(0.95,3,sum(nv)-4))/length(f) # actual 1-alpha
Assuming a desired level of $\alpha=5\%$, the last line of code is where I calculate the actual probability of going beyond the threshold $f$ value.
I'm not looking for corrections to my R code, per se, but feel free to point out any errors if there are any.