Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tperm.fd

Permutation t-test for two groups of functional data objects.


Description

tperm.fd creates a null distribution for a test of no difference between two groups of functional data objects.

Usage

tperm.fd(x1fd, x2fd, nperm=200, q=0.05, argvals=NULL, plotres=TRUE, ...)

Arguments

x1fd

a functional data object giving the first group of functional observations.

x2fd

a functional data object giving the second group of functional observations.

nperm

number of permutations to use in creating the null distribution.

q

Critical upper-tail quantile of the null distribution to compare to the observed t-statistic.

argvals

If yfdPar is a fd object, the points at which to evaluate the point-wise t-statistic.

plotres

Argument to plot a visual display of the null distribution displaying the 1-qth quantile and observed t-statistic.

...

Additional plotting arguments that can be used with plot.

Details

The usual t-statistic is calculated pointwise and the test based on the maximal value. If argvals is not specified, it defaults to 101 equally-spaced points on the range of yfdPar.

Value

A list with the following components:

pval

the observed p-value of the permutation test.

qval

the qth quantile of the null distribution.

Tobs

the observed maximal t-statistic.

Tnull

a vector of length nperm giving the observed values of the permutation distribution.

Tvals

the pointwise values of the observed t-statistic.

Tnullvals

the pointwise values of of the permutation observations.

pvals.pts

pointwise p-values of the t-statistic.

qvals.pts

pointwise qth quantiles of the null distribution

argvals

argument values for evaluating the F-statistic if yfdParis a functional data object.

Side Effects

a plot of the functional observations

Source

Ramsay, James O., and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.

See Also

Examples

# This tests the difference between boys and girls heights in the
# Berkeley growth data.

# First set up a basis system to hold the smooths

knots  <- growth$age
norder <- 6
nbasis <- length(knots) + norder - 2
hgtbasis <- create.bspline.basis(range(knots), nbasis, norder, knots)

# Now smooth with a fourth-derivative penalty and a very small smoothing
# parameter

Lfdobj <- 4
lambda <- 1e-2
growfdPar <- fdPar(hgtbasis, Lfdobj, lambda)

hgtmfd <- smooth.basis(growth$age, growth$hgtm, growfdPar)$fd
hgtffd <- smooth.basis(growth$age, growth$hgtf, growfdPar)$fd

# Call tperm.fd

tres <- tperm.fd(hgtmfd,hgtffd)

fda

Functional Data Analysis

v5.1.9
GPL (>= 2)
Authors
J. O. Ramsay <ramsay@psych.mcgill.ca> [aut,cre], Spencer Graves <spencer.graves@effectivedefense.org> [ctb], Giles Hooker <gjh27@cornell.edu> [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.