rm(list = ls()) cnt=c(6,16,2,4,2,4,6,6) a=c(1,1,1,1,2,2,2,2) A=3-2*a b=c(1,1,2,2,1,1,2,2) B=3-2*b c=c(1,2,1,2,1,2,1,2) AB=A*B C=3-2*c y=log(cnt) ts <- lm(y ~ A+B+AB+C,weights = cnt) tsp=summary(ts) tsp anova(ts) # new standard errors coef(tsp)[,2]/tsp$sigma # new z scores coef(tsp)[,3]*tsp$sigma