rms.pval: P-value for root-mean-square goodness-of-fit test for simple...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Returns the P-value associated with a root-mean-square test.

Usage

1
rms.pval(observed, expected, num_sim= 1000)

Arguments

observed

The observed data

expected

The expected data

num_sim

Number of Monte-Carlo simulations desired. The default is 1,000 simulations.

Details

This function calls on test.rms() to calculate the root-mean-square test statistic before calculating the P-value using Monte-Carlo simulation.

Value

Returns the P-value associated with the root-mean-square test.

Author(s)

Shubhodeep Mukherji <deep.mukherji@utexas.edu>

References

"Chi-square and classical exact tests often wildly misreport significance; the remedy lies in computers," by Will Perkins, Mark Tygert, and Rachel Ward.

See Also

test.rms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#This example is from section 5.1.2 of the referenced text

k <- c(1:128)
#Define model distribution (exp) and observed distribution (obs)
C1 <- 1/sum(1/k)
exp <- C1/k

C2 <- 1/sum(1/k^2)
obs <- C2/k^2

rms.pval(obs,exp,10000)

rms.gof documentation built on May 2, 2019, 6:50 a.m.