search for: xbar3

Displaying 1 result from an estimated 1 matches for "xbar3".

Did you mean: xbar
2012 Jun 04
1
simulation of modified bartlett's test
...r(g1) v2=var(g2) v3=var(g3) #pooled variance A=((n1-1)*v1+(n2-1)*v2+(n3-1)*v3)/(N-k) #calculate B B=((N-k)*(log(A)))-((n1-1)*log(v1)+(n2-1)*log(v2)+(n3-1)*log(v3)) #calculate C C=1+(1/(3*(k-1))*(((1/(n1-1))+(1/(n2-1))+(1/(n3-1)))-(1/(N-k)))) #calculate layard estimator xbar1=mean(g1) xbar2=mean(g2) xbar3=mean(g3) sum1=sum((g1-xbar1)^4) sum2=sum((g2-xbar2)^4) sum3=sum((g3-xbar3)^4) sum4=sum((g1-xbar1)^2) sum5=sum((g2-xbar2)^2) sum6=sum((g3-xbar3)^2) y= (N*(sum1+sum2+sum3))/((sum4+sum5+sum6)^2) #calculate bartlett modified statistic bar2=B/(C*(1/2)*(y-1)) bar2 pv[i]<-pchisq(bar2,2,lower=FALSE) } m...