sscomp                package:hpower                R Documentation

_S_a_m_p_l_e _S_i_z_e _f_o_r _T_e_s_t_s _o_f _t_h_e _G_e_n_e_r_a_l _L_i_n_e_a_r _H_y_p_o_t_h_e_s_i_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute the minimum sample size required to have a specified power
     for rejecting the null hypothesis in a test of the general linear
     hypothesis.

_U_s_a_g_e:

     sscomp(alpha, power, x, bt1, sigma, cc, u, th0, test=1, ninit=1)

_A_r_g_u_m_e_n_t_s:

   alpha: type I error probability of the test. 

   power: desired power of the test. 

       x: N0-by-q design matrix. This matrix should represent the
          design for a sample of size 1. For example, if there are to
          be two groups, x should contain two rows, with the first row
          representing the design for group 1 and the second row the
          design for group 2. The sample size returned will then be the
          number per group. 

     bt1: q-by-p alternative hypothesis value of the regression
          coefficient. 

   sigma: p-by-p variance matrix of a single observation. 

      cc: a-by-q between-rows contrast matrix. 

       u: p-by-b between-columns contrast matrix. 

     th0: a-by-b null value of cc%*%beta%*%u. 

    test: test to use.  test=1 (the default) is the Wilks lambda test;
          test=2 is the Hotelling-Lawley trace test; test=3 is the
          Pillai-Bartlett trace test.  See Muller and Peterson (1984)
          for details. 

   ninit: number of replications of x to use as the starting sample
          size. The sample size algorithm is simple - it starts at
          ninit and keeps adding or subtracting 1 (that is, 1 copy of
          x) until the desired power is achieved. The default is
          ninit=1. 

_V_a_l_u_e:

     list containing two elements - n, the smallest number of copies of
     x that guarantee the desired power for the test described, and
     power, the power of the design with that sample size.

_N_O_T_E:

     The power function glhpwr is an approximation, so there may be
     slight differences when compared with more exact methods. This
     function increases (or decreases) n one unit at a time, so well
     chosen starting values can save time. Some experimentation will
     often be helpful.

_A_u_t_h_o_r(_s):

     Daniel F. Heitjan <dheitjan@peter.cpmc.columbia.edu>,   R-port by
     Stefan Funke <funke@attglobal.net>

_R_e_f_e_r_e_n_c_e_s:

     Muller, K.E. and Peterson, B.L. (1984).  Practical methods for
     computing power in testing the multivariate general linear
     hypothesis.  Computational Statistics and Data Analysis 2,
     143-158.

_S_e_e _A_l_s_o:

     `pfnc', `glhpwr'.

