Learn R Programming

fda.usc (version 1.2.3)

anova.RPm: Functional ANOVA with Random Project.

Description

The procedure is based on the analysis of randomly chosen one-dimensional projections. The function tests ANOVA models for functional data with continuous covariates and perform special contrasts for the factors in the formula.

Usage

## S3 method for class 'RPm':
anova(object,formula,data.fac,RP=min(30,ncol(object)),
alpha=0.95,hetero=TRUE,pr=FALSE,w=rep(1,ncol(object)),
nboot=0,contrast=NULL,...)

Arguments

object
Functional response data. Object with class fdata with n curves discretizated in m points.
formula
data.fac
Explanatory variables. Data frame with dimension (n x p), where p are the number of factors or covariate considered.
RP
Vector of random projections.
alpha
Alpha value, by defalult alpha=0.95.
hetero
=TRUE (by default) heteroskedastic ANOVA.
pr
If TRUE, print intermediate results.
w
Vector of weights.
nboot
Number of bootstrap samples, by defult no bootstrap sample, nboot=0.
contrast
List of special contrast to be used ; by default no special contrasts are used (contrast=NULL).
...
Further arguments passed to or from other methods.

Value

  • Shows:
  • projThe projection value of each point on the curves. Matrix with dimension (RP x m), where RP is the number of projection and m are the points observed in each projection curve.
  • minsminimum number for each random projection.
  • resultp-value for each random projection.
  • test.Bonfsignificance (TRUE or FALSE) for vector of random projections RP in columns and factor (and special contrast) by rows.
  • p.Bonfp-value for vector of random projections RP in columns and factor (and special contrast) by rows.
  • test.fdrFalse Discovery Rate (TRUE or FALSE) for vector of random projections RP in columns and factor (and special contrast) by rows.
  • p.fdrp-value of False Discovery Rate for vector of random projections RP in columns and factor (and special contrast) by rows.
  • test.BootFalse Discovery Rate (TRUE or FALSE) for vector of random projections RP in columns and factor (and special contrast) by rows.
  • p.Bootp-value of Bootstrap sambple for vector of random projections RP in columns and factor (and special contrast) by rows.

Details

The function allows user-defined contrasts. The list of contrast to be used for some of the factors in the formula. Each contrast matrix in the list has r rows, where r is the number of factor levels. The user can also request special predetermined contrasts, for example using the contr.helmert, contr.sum or contr.treatment functions. The function returns (by default) the significance of the variables using the Bonferroni test and the False Discovery Rate test. Bootstrap procedure provides more precision

References

Cuesta-Albertos, J.A., Febrero-Bande, M. A simple multiway ANOVA for functional data. Test 2010, DOI 10.1007/s11749-010-0185-3.

See Also

See Also as: anova.onefactor

Examples

Run this code
# ex anova.hetero
data(phoneme)
names(phoneme)
data=as.data.frame(phoneme$learn[["data"]])
group=phoneme$classlearn
n=nrow(data)
group.rand=as.factor(sample(rep(1:3,len=n),n))
RP=c(2,5,15,30)

#ex 1: real factor and random factor
m03=data.frame(group,group.rand)
resul1=anova.RPm(data,~group+group.rand,m03,RP=c(5,30))
summary.anova(resul1)

#ex 2: real factor with special contrast
m0=data.frame(group)
cr5=contr.sum(5)   #each level vs last level
resul03c1=anova.RPm(data,~group,m0,contrast=list(group=cr5))
summary.anova(resul03c1)

#ex 3: random factor with special contrast
m0=data.frame(group.rand)
cr3=contr.sum(3)   #each level vs last level
resul03c1=anova.RPm(data,~group.rand,m0,contrast=list(group.rand=cr3))
summary.anova(resul03c1)

Run the code above in your browser using DataLab