Learn R Programming

fBasics (version 240.10067)

HypothesisTesting: Tests Class Representation and Utilities

Description

Class representation, methods and utility functions for objects of class 'fHTEST'. The class representation and methods are:

ll{ fHTEST Representation for an S4 object of class "fHTEST", show S4 print method. } Utility Functions: ll{ pPlot General finite sample probability plot, pTable interpolated probabilities from finite sample table, qTable interpolated quantiles from finite sample table. }

Usage

show.fHTEST(object)

pPlot(X, nN = 100, nStat = 100, logN = TRUE, logStat = FALSE, fill = FALSE, linear = TRUE, digits = 8, doplot = TRUE, ...) pTable(X, Stat, N, digits = 4) qTable(X, p, N, digits = 4)

Arguments

digits
an integer value with the number of rounding digits.
doplot
a logical flag. Should a plot be displayed?
fill
[pPlot] - a logical flag deciding if missing data should be filled with asymptotic values zero and one.
linear
[pPlot] - a logical flag indicating the type of interpolation.
logN, logStat
[pPlot] - two logical flags deciding if the data should be on a logarithmic scale or not.
N
an integer value or vector of sample sizes.
nN, nStat
[pPlot] - two integer values with the size of the table.
object
[show] - an S4 object of class "fHTEST".
p
a numeric value or vector of probabilities.
Stat
a numeric value or vector of quantiles or statistic values.
X
[pPlot][*Table] - a data frame or matrix of a finite sample test table.
...
[pPlot] - additional arguments to be passed.

Value

  • In contrast to R's output report from S3 objects of class "htest" a different output report is produced. The tests return an S4 object of class "fHTEST". The object contains the following slots:
  • @callthe function call.
  • @datathe data as specified by the input argument(s).
  • @testa list whose elements contail the results from the statistical test. The information provided is similar to a list object of class{"htest"}.
  • @titlea character string with the name of the test. This can be overwritten specifying a user defined input argument.
  • @descriptiona character string with an optional user defined description. By default just the current date when the test was applied will be returned.
  • The slot @test returns an object of class "list" containing the following elements:
  • statisticthe value(s) of the test statistic.
  • p.valuethe p-value(s) of the test.
  • parametersa numeric value or vector of parameters.
  • estimatea numeric value or vector of sample estimates.
  • conf.inta numeric two row vector or matrix of 95
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name(s) of the data.
  • The functions pPlot, pTable, and qTable plot and iterpolate finite sample test statistic data from a table. The table is a data frame or a matrix where columns denote the size and rows the probabilities. The column and row names must hold the sizes and probabilities as character strings. The values of the matrix hold the statistic values.

Examples

Run this code
## SOURCE("fBasics.5A-HypothesisTesting")

## fHTEST -
   getClass("fHTEST")

## pPlot -
## jbTable -
   # Interpolated plot of Small Jarque Bera Table:
   X = jbTable(type = "LM", size = "small")
   par(ask = FALSE)
   pPlot(X, linear = TRUE, logStat = TRUE)
   pPlot(X, linear = TRUE, logStat = TRUE, fill = TRUE, main = "JB LM")
   pPlot(X, linear = FALSE, logStat = TRUE)
   pPlot(X, linear = FALSE, logStat = TRUE, fill = TRUE)
    
## [pq]Table -
## jbTable - 
   # Jarque Bera B q and p Table:
   X = jbTable(type = "LM", size = "small")
   p = (1:99)/100
   plot(qTable(X, p, N = 100), p, type = "b")
   Stat = seq(0.01, 15, length = 100)
   plot(Stat, pTable(X, Stat, N = 100), type = "b")

Run the code above in your browser using DataLab