RMSt: Conduct estimation and RMS test for one-way random-effects...

Description Usage Arguments Value References Examples

Description

We are conducting hypothesis test for a composite parameter, the RMS, defined as √{μ^2+σ_b^2+σ_w^2}:=√{ρ} , where μ is the overall mean, and (σ_b^2,σ_w^2) are the between/within-subject variances in the one-way random-effects ANOVA model, y_{ij}=μ+u_i+ε_{ij}, where u_i\sim N(0,σ_b^2) and ε_{ij}\sim N(0,σ_w^2) . We want to test H_0: ρ≥ ρ_0. We implement a parametric Bootstrap based test with “exact” p-value calculation, voiding the need for Bootstrap Monte Carlo simulation. See the reference of Bai et. al (2018). The score and Wald Z-tests, both large-sample normal approximation tests, are also implemented.

Usage

1
RMSt(Y, subj, rho = 9, REML = TRUE)

Arguments

Y

vector of outcomes

subj

subject id (factors). Observations with the sam id are coming from the same individual.

rho

null threshold of acceptable squared RMS value.

REML

using REML instead of MLE. Default to TRUE.

Value

p.value

test p-values for: QMS test, score Z-test, Wald Z-test

pars0

estimated null parameter values

pars

estimated MLE parameter values

References

Bai,Y., Wang,Z., Lystig,T.C., and Wu,B. (2018) Statistical test with sample size and power calculation for paired repeated measures designs of method comparison studies.

Examples

1
2
3
4
5
s2w=1.4^2; s2b=1.7^2; mu0=-0.4
ng = c(10,2,10,10,5,7,9,10)
A = rep(1:8, times=ng)
Y = mu0 + (rnorm(8)*sqrt(s2b))[A] + rnorm(sum(ng))*sqrt(s2w)
RMSt(Y,A)

baolinwu/SPprm documentation built on May 9, 2019, 8:41 a.m.