Univariate ANOVA for heteroscedastic data.
Arguments
- object
A data frame with dimension (
n
xp+1
). In the first column contains then
response values and on the followingp
columns the explanatory variables specified in the formula.- formula
as 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 estimationEst
, the factor degrees of freedomdf1
, the residual degrees of freedomdf2
, and thep-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
Author
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
Examples
if (FALSE) { # \dontrun{
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
} # }