Learn R Programming

validateRS (version 1.0.0)

simul.scenario.rs: Determine cardinality and power for a statistical test.

Description

For a sample drawn with sample.knowledge.H1 and for a statistical test, the acceptance region is determined and the power for each value of H1 in the sample is computed.

Usage

simul.scenario.rs(hypo.test, p.0, sampleH1, sizes, alpha)

Arguments

hypo.test
The name of the hypothesis test: minP for the multiple test , minPp for the enhanced multiple test or sterneHull for the envelope test.
p.0
A vector containing the PDs under H0
sampleH1
The sample drawn using the function sample.knowledge.H1.
sizes
A matrix with different scenario's for the sizes of the rating classes. There should be at least two rows and the number of columns must equal the length of the parameter p.0.
alpha
The significance level

Value

  • A list with elements
  • parThe parameters passed to the function
  • powerPower for each value of H1, the average power and the standard error on the average
  • cardinality.ARThe cardinality of the acceptance region
  • executionTimeThe time it took to compute the acceptance region and to compute the power
  • knowledgeH1The characteristics ot the distribution and the sample drawn

See Also

sample.knowledge.H1,

Examples

Run this code
p.0<-c(0.001, 0.004)
sizes<-rbind( c(500, 500), 
              c(1000, 5000))
alpha<-0.05
s.nrm<-sample.knowledge.H1(n=10, 
                        par=par.dist.default(dist="tr.normal", p.0=c(0.001, 0.004)))
scen.nrm.mp<-simul.scenario.rs(hypo.test="minP", p.0=p.0, 
                        sampleH1=s.nrm, sizes=sizes, alpha=alpha)
scen.nrm.mpp<-simul.scenario.rs(hypo.test="minPp", p.0=p.0, 
                        sampleH1=s.nrm, sizes=sizes, alpha=alpha)

par.ownsample<-par.dist.default(dist="usersupplied", p.0=c(0.001, 0.004))
par.ownsample$param<-rbind(c(0.001, 0.01), c(0.004, 0.004), c(0.004, 0.01))
s.own<-sample.knowledge.H1(n=10, 
                        par=par.ownsample)

scen.ownsample.mp<-simul.scenario.rs(hypo.test="minP", p.0=p.0, 
                        sampleH1=s.own, sizes=sizes, alpha=alpha)

Run the code above in your browser using DataLab