R/size_c.three_way_mixed_cxbina.model_5_b.R

Defines functions size_c.three_way_mixed_cxbina.model_5_b

Documented in size_c.three_way_mixed_cxbina.model_5_b

#(size c.three way mixed cx(bina). model 5 b)
# Section 3.4.4.4. test factor B in A

# Three way mixed classification. (A>B)xC, Model V
# Factor A and B are fixed, factor C is random. 
# a, b and n are given, determining c. Testing hypothesis about factor B
size_c.three_way_mixed_cxbina.model_5_b <-  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*(b-1)
		dfd <- a*(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_4_4.test_factor_B(0.05, 0.1, 0.5, 6, 5, 2, "maximin")
# size.3_4_4_4.test_factor_B(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.