Fbar.dif: F-bar for inequality constraints with minimum differences...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/Fbar.R

Description

The function calculates F-bar for inequality constrained hypotheses with minimum differences between means (Type B). See Silvapulle & Sen (2011) for background on the F-bar statistic. The code of Vanbrabant (2017) is the basis to this Fbar function.

Usage

1
Fbar.dif(data,Amat,difmin,effectsize=FALSE)

Arguments

data

A dataframe with two variables: (1) a dependent variable, and (2) a grouping variable. Groups are labeled consecutively, starting at 1.

Amat

A p by q matrix, where p is the number of means in the ANOVA model, and q is the number of constraints to be imposed on the model. Each row represents one constraint where the parameter with the lower value according to the constraint receives the value -1, and the parameter with the higher value according to the constraint receives the value 1. Other parameters within the same row obtain the value 0.

difmin

A vector of length q with the minimum difference per constraint as specified in Amat.

effectsize

Logical; If TRUE the values in difmin are interpreted as Cohen's d.

Value

The value for the F-bar statistic

Author(s)

M. A. J. Zondervan-Zwijnenburg

References

Silvapulle, M. J., & Sen, P. K. (2011). Constrained statistical inference: Order, inequality, and shape constraints (Vol. 912). John Wiley & Sons. doi: 10.1002/9781118165614.ch1

Vanbrabant, L. (2017). restriktor: Restricted Statistical Estimation and Inference for Linear Models. R package version 0.1-55. https://CRAN.R-project.org/package=restriktor

See Also

See also runShiny, Fbar.ineq, and Fbar.exact.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data <- data.frame(y=ChickWeight$weight,g=ChickWeight$Diet)
aggregate(data$y,by=list(data$g),mean)


#create matrices HR: g4>(g1,g2,g3). g4-g1>0.8, g4-g2>0.5, g4-g3>0.2
HR <- create_matrices(varnames = c("g1","g2","g3","g4"),
                      hyp = "g4-g1>0.8 & g4-g2>0.5 & g4-g3>0.2")

Fbar.dif(data,Amat=HR$Amat,difmin=HR$difmin,effectsize=TRUE)

#make Amat with constraints: 1<4,2<4,3<4 (last constraint is not true)
Amat <- (rbind(c(-1,0,0,1),c(0,-1,0,1),c(0,0,-1,1)))
#minimal differences for each constraint
difmin=c(30,15,1)

Fbar.dif(data,Amat,difmin=difmin)

ANOVAreplication documentation built on Sept. 27, 2021, 9:06 a.m.