monteSample-class: Class '"monteSample"'

Description Objects from the Class Slots Methods Author(s) References See Also Examples

Description

This is a virtual class defining the base representation for objects that hold information about repeated (Monte Carlo) sampling from population objects of class "montePop". It provides a basic class setup for looking at Monte Carlo convergence of as the sample size grows larger.

Objects from the Class

A virtual Class: No objects may be created from it. For usable subclasses please see monteNTSample and monteBSSample.

Slots

mcSamples:

Object of class "numeric": A scalar numeric specifying the number of Monte Carlo samples drawn from the population.

n:

Object of class "numeric": A numeric vector listing the different sample sizes recorded in the object that have been drawn from a “montePop” population object. So, if we have drawn samples of size n = 10,20,30, then this would hold c(10,20,30), with associated names c('n.10','n.20','n.30').

alpha:

Object of class "numeric": The two-tailed alpha level for which confidence intervals have been calculated. I.e., for the 95% confidence level alpha = 0.05

replace:

Object of class "logical": TRUE if the samples have been drawn from the population with replacement, FALSE otherwise.

ranSeed:

Object of class "numeric": The random number seed as a numeric vector. Please see the R documentation on .Random.seed for information on the format of this slot. Note that it is not a simple scalar integer “seed”, but a vector of integers containing the state of the random number generator at the beginning of the simulations.

fpc:

Object of class "numeric": The finite population correction factors for each sample size n. The correction is: f = (N-n)/N.

means:

Object of class "data.frame": A data frame with mcSamples rows, and one column for each of the sample sizes in the n slot of the object. What is stored here depends on the subclass object type, so please see the respective definitions for these slots.

Note: The following six slots have the same dimensions as the means slot.

vars:

Object of class "data.frame": Contains the individual sample variances.

stDevs:

Object of class "data.frame": Contains the individual sample standard deviations.

varMeans:

Object of class "data.frame": Contains the individual variance of the mean values.

stErrs:

Object of class "data.frame": Contains the individual standard errors.

lowerCIs:

Object of class "data.frame": Contains the individual lower limit for the confidence intervals. This is defined differently for the different subclasses.

upperCIs:

Object of class "data.frame": Contains the individual upper limit for the confidence intervals. This is defined differently for the different subclasses.

caught:

Object of class "data.frame": Contains a flag where TRUE means the confidence interval caught the population mean and FALSE means it failed to catch the population mean. Taking column sums, therefore (since TRUE == 1 and FALSE == 0) will give the number of intervals that caught the population mean for each sample size. This is used to calculate the next slot below.

caughtPct:

Object of class "numeric": The percentage of times the confidence intervals caught the population mean as calculated from the data frame in the caught slot of the object.

stats:

Object of class "data.frame": A summary data frame with rows as the average of each column (i.e., over all Monte Carlo samples) from the information in the data frames above (means, vars, stDevs, varMeans, stErrs, lowerCIs, and upperCIs). The interpretation of some of the rows depends on the subclass object as has been mentioned above, please see the vignette below for more details.

Methods

hist

signature(x = "monteSample"): Histogram of the means by sample size

show

signature(object = "monteSample"): Object summary.

summary

signature(object = "monteSample"): Object summary.

Author(s)

Jeffrey H. Gove

References

The ‘“monte”: When is n Sufficiently Large?’ vignette.

See Also

monte, montePop; for subclasses, see: monteNTSample and monteBSSample.

Examples

1
showClass("monteSample")

sampSurf documentation built on March 5, 2021, 3:01 p.m.