fda.usc (version 2.0.1)

fanova.hetero: ANOVA for heteroscedastic data

Description

Univariate ANOVA for heteroscedastic data.

Usage

fanova.hetero(object = NULL, formula, pr = FALSE, contrast = NULL, ...)

Arguments

object

A data frame with dimension (n x p+1). In the first column contains the n response values and on the following p columns the explanatory variables specified in the formula.

formula
pr

If TRUE, print intermediate results.

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

Return:

  • ans A list with components including: the Beta estimation Est, the factor degrees of freedom df1, the residual degrees of freedom df2 and p-value for each factor.

  • contrast List of special contrasts.

Details

This function fits a univariate analysis of variance model and allows calculate special contrasts defined by the user. The list of special contrast to be used for some of the factors in the formula. Each matrix of the list has r rows and r-1 columns.

The user can also request special predetermined contrasts, for example using contr.helmert, contr.sum or contr.treatment functions.

References

Brunner, E., Dette, H., Munk, A. Box-Type Approximations in Nonparametric Factorial Designs. Journal of the American Statistical Association, Vol. 92, No. 440 (Dec., 1997), pp. 1494-1502.

See Also

See Also as: fanova.RPm

Examples

Run this code
# NOT RUN {
data(phoneme)
ind=1 # beetwen 1:150
fdataobj=data.frame(phoneme$learn[["data"]][,ind])
n=dim(fdataobj)[1]
group<-factor(phoneme$classlearn)

#ex 1: real factor and random factor
group.rand=as.factor(sample(rep(1:3,n),n))
f=data.frame(group,group.rand)
mm=data.frame(fdataobj,f)
colnames(mm)=c("value","group","group.rand")
out1=fanova.hetero(object=mm[,-2],value~group.rand,pr=FALSE)
out2=fanova.hetero(object=mm[,-3],value~group,pr=FALSE)
out1
out2

#ex 2: real factor, random factor and  special contrasts
cr5=contr.sum(5)  #each level vs last level
cr3=c(1,0,-1)			#first level vs last level
out.contrast=fanova.hetero(object=mm[,-3],value~group,pr=FALSE,
contrast=list(group=cr5))
out.contrast
# }

Run the code above in your browser using DataCamp Workspace