fosr.perm | R Documentation |
fosr.perm()
is a wrapper function calling fosr.perm.fit()
,
which fits models to permuted data, followed by fosr.perm.test()
,
which performs the actual simultaneous hypothesis test. Calling the latter
two functions separately may be useful for performing tests at different
significance levels. By default, fosr.perm()
produces a plot using
the plot function for class fosr.perm
.
fosr.perm(
Y = NULL,
fdobj = NULL,
X,
con = NULL,
X0 = NULL,
con0 = NULL,
argvals = NULL,
lambda = NULL,
lambda0 = NULL,
multi.sp = FALSE,
nperm,
level = 0.05,
plot = TRUE,
xlabel = "",
title = NULL,
prelim = if (multi.sp) 0 else 15,
...
)
fosr.perm.fit(
Y = NULL,
fdobj = NULL,
X,
con = NULL,
X0 = NULL,
con0 = NULL,
argvals = NULL,
lambda = NULL,
lambda0 = NULL,
multi.sp = FALSE,
nperm,
prelim,
...
)
fosr.perm.test(x, level = 0.05)
## S3 method for class 'fosr.perm'
plot(x, level = 0.05, xlabel = "", title = NULL, ...)
Y , fdobj |
the functional responses, given as either an |
X |
the design matrix, whose columns represent scalar predictors. |
con |
a row vector or matrix of linear contrasts of the coefficient functions, to be restricted to equal zero. |
X0 |
design matrix for the null-hypothesis model. If |
con0 |
linear constraints for the null-hypothesis model. |
argvals |
the |
lambda |
smoothing parameter value. If |
lambda0 |
smoothing parameter for null-hypothesis model. |
multi.sp |
a logical value indicating whether separate smoothing
parameters should be estimated for each coefficient function. Currently
must be |
nperm |
number of permutations. |
level |
significance level for the simultaneous test. |
plot |
logical value indicating whether to plot the real- and permuted-data pointwise F-type statistics. |
xlabel |
x-axis label for plots. |
title |
title for plot. |
prelim |
number of preliminary permutations. The smoothing parameter
in the main permutations will be fixed to the median value from these
preliminary permutations. If |
... |
for |
x |
object of class |
fosr.perm
or fosr.perm.test
produces an object of
class fosr.perm
, which is a list with the elements below.
fosr.perm.fit
also outputs an object of this class, but without the
last five elements.
F |
pointwise F-type statistics at each of the
points given by |
F.perm |
a matrix, each of whose rows gives the pointwise F-type statistics for a permuted data set. |
argvals |
points at which F-type statistics are computed. |
lambda.real |
smoothing parameter(s) for the real-data fit. |
lambda.prelim |
smoothing parameter(s) for preliminary permuted-data fits. |
lambda.perm |
smoothing parameter(s) for main permuted-data fits. |
lambda0.real , lambda0.prelim , lambda0.perm |
as above, but for null hypothesis models. |
level |
significance level of the test. |
critval |
critical value for the test. |
signif |
vector of
logical values indicating whether significance is attained at each of the
points |
n2s |
subset of 1, ..., length(argvals) identifying the points at which the test statistic changes from non-significant to significant. |
s2n |
points at which the test statistic changes from significant to non-significant. |
Philip Reiss phil.reiss@nyumc.org and Lan Huo
Reiss, P. T., Huang, L., and Mennes, M. (2010). Fast function-on-scalar regression with penalized basis expansions. International Journal of Biostatistics, 6(1), article 28. Available at https://pubmed.ncbi.nlm.nih.gov/21969982/
fosr
## Not run:
# Test effect of region on mean temperature in the Canadian weather data
# The next two lines are taken from the fRegress.CV help file (package fda)
smallbasis <- create.fourier.basis(c(0, 365), 25)
tempfd <- smooth.basis(day.5,
CanadianWeather$dailyAv[,,"Temperature.C"], smallbasis)$fd
Xreg = cbind(1, model.matrix(~factor(CanadianWeather$region)-1))
conreg = matrix(c(0,1,1,1,1), 1) # constrain region effects to sum to 0
# This is for illustration only; for a real test, must increase nperm
# (and probably prelim as well)
regionperm = fosr.perm(fdobj=tempfd, X=Xreg, con=conreg, method="OLS", nperm=10, prelim=3)
# Redo the plot, using axisIntervals() from the fda package
plot(regionperm, axes=FALSE, xlab="")
box()
axis(2)
axisIntervals(1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.