Learn R Programming

NSM3 (version 1.18)

cSkilMack: Computes a critical value for the Skillings-Mack SM distribution.

Description

This function computes the critical value for the Skillings-Mack SM distribution at (or typically in the "Exact" and "Monte Carlo" cases, close to) the given alpha level.

Usage

cSkilMack(alpha, obs.mat, method = NA, n.mc = 10000)

Value

Returns a list with "NSM3Ch7c" class containing the following components:

k

number of treatments

n

number of blocks

ss

number of treatments per block

cutoff.U

upper tail cutoff at or below user-specified alpha

true.alpha.U

true alpha level corresponding to cutoff.U (if method="Exact" or "Monte Carlo")

Arguments

alpha

A numeric value between 0 and 1.

obs.mat

The incidence matrix, explained below.

method

Either "Exact", "Monte Carlo" or "Asymptotic", indicating the desired distribution. When method=NA, "Exact" will be used if the number of permutations is 10,000 or less. Otherwise, "Monte Carlo" will be used.

n.mc

If method="Monte Carlo", the number of Monte Carlo samples used to estimate the distribution. Otherwise, not used.

Author

Grant Schneider

Details

The incidence matrix, obs.mat, will be an n x k matrix of ones and zeroes, which indicate where the data are observed and unobserved, respectively.

Examples

Run this code
##Hollander, Wolfe, Chicken Example 7.8 Effect of Rhythmicity of a Metronome on Speech Fluency
obs.mat<-matrix(c(rep(1,10),0,rep(1,13)),ncol=3,byrow=TRUE)
#cSkilMack(.01,obs.mat)
cSkilMack(.01,obs.mat,n.mc=5000)

Run the code above in your browser using DataLab