R/size_c.three_way_cross.model_3_axb.R

Defines functions size_c.three_way_cross.model_3_axb

Documented in size_c.three_way_cross.model_3_axb

#(size c.three way cross.model 3 axb)
# Section 3.4.1.2 test interaction AxB

# Three way cross classification - Model III
# Factor A and B fixed, C random. n is fixed to 2. 
# a and b are given. Determining c
# Hypothesis: Factor AxB has no effects. 
size_c.three_way_cross.model_3_axb <-  function(alpha, beta, delta, a, b, n, cases)
{
	c <- 5    
	c.new <- 1000
	while (abs(c -c.new)>1e-6)
	{
		c <- c.new
		dfn <- (a-1)*(b-1)
		dfd <- (a-1)*(b-1)*(c-1)
		lambda <- ncp(dfn,dfd,alpha,beta)
		if (cases == "maximin")
		{
			c.new <- 2*lambda/(n*delta*delta)
		}
		else if (cases == "minimin")
		{
			c.new <- 4*lambda/(a*b*n*delta*delta)
		}
	}  
	return(ceiling(c.new))
}


# example
# size.3_4_1_2.interaction.ab(0.05, 0.1, 0.5, 6, 5, 2, "maximin")
# size.3_4_1_2.interaction.ab(0.05, 0.1, 0.5, 6, 5, 2, "minimin")

Try the OPDOE package in your browser

Any scripts or data that you put into this service are public.

OPDOE documentation built on May 1, 2019, 8:45 p.m.