    # Also in the Article

Noncentrality parameter of chi-squared test statistic
This protocol is extracted from research article:
SMARTAR: an R package for designing and analyzing Sequential Multiple Assignment Randomized Trials
PeerJ, Jan 11, 2021;

Procedure

An important element of inference related to global tests in SMART is the noncentrality parameter λ of chi-squared test statistics. The function getncp helps obtain this value. In calling this function, the user needs to input the degrees of freedom, given the design structure of SMART, type I and II errors. Since no formula can calculate the value of λ directly, this function starts searching for the value by calculating the left-hand side of Eq. (7), based on a prespecified value, and then approaches the targeted value until a stopping criterion is reached. In this case, the stopping criterion is the maximal absolute difference between the left- and right-hand sides in Eq. (9). In practice, the user can set the initial value of λ by the numeric argument start and define the maximum absolute difference by d. Example 3 of the R code and the results shows the result of calling the function getncp in the CODIACS trial. Given the design structure, we calculate the degrees of freedom and input it by df = 5. We set the targeted type I and II errors as alpha=0.05 and beta=0.20, respectively. We then give an initial value of λ with start=5 and the maximal acceptable difference d=0.0001. Therefore, the computer starts the search process at λ = 5 and finally returns the value of the noncentrality parameter as 12.8249. Note that, when the getncp function is used, the start value of λdoes not affect the results of the search, although a start value closer to the result leads to a shorter search process. On the other hand, the value of d affects the accuracy of the search. Generally, a smaller maximal acceptable difference leads to better accuracy.

List 3. R code and results: Example 3

>  getncp(df = 5,alpha=0.05,beta=0.20, d = 0.0001,start=5)

 12.8249

Note: The content above has been extracted from a research article, so it may not display correctly.

Q&A